UNPKG

jupyterlab-emrys

Version:

A computational environment for Jupyter. Powered by Emrys

100 lines (99 loc) 2.18 kB
import { IDisposable } from 'phosphor-disposable'; import { ObservableList } from '../../common/observablelist'; /** * An object which is JSON-able. */ export interface IJSONable { /** * Convert the object to JSON. */ toJSON(): any; } /** * An observable list that supports undo/redo. */ export declare class ObservableUndoableList<T extends IJSONable> extends ObservableList<T> implements IDisposable { /** * Construct a new undoable observable list. */ constructor(factory: (value: any) => T); /** * Whether the object can redo changes. * * #### Notes * This is a read-only property. */ canRedo: boolean; /** * Whether the object can undo changes. * * #### Notes * This is a read-only property. */ canUndo: boolean; /** * Get whether the object is disposed. * * #### Notes * This is a read-only property. */ isDisposed: boolean; /** * Dispose of the resources held by the model. */ dispose(): void; /** * Begin a compound operation. */ beginCompoundOperation(isUndoAble?: boolean): void; /** * End a compound operation. */ endCompoundOperation(): void; /** * Undo an operation. */ undo(): void; /** * Redo an operation. */ redo(): void; /** * Clear the change stack. */ clearUndo(): void; /** * Handle a change in the list. */ private _onListChanged(list, change); /** * Undo a change event. */ private _undoChange(change); /** * Redo a change event. */ private _redoChange(change); /** * Create a value from JSON. */ private _createValue(data); /** * Create a list of cell models from JSON. */ private _createValues(bundles); /** * Copy a change as JSON. */ private _copyChange(change); /** * Copy a replace change as JSON. */ private _copyReplace(change); private _inCompound; private _isUndoable; private _madeCompoundChange; private _index; private _stack; private _factory; }