UNPKG

1.46 kBTypeScriptView Raw
1import { ICellModel } from '@jupyterlab/cells';
2import { IObservableList } from '@jupyterlab/observables';
3import { ISharedNotebook } from '@jupyter/ydoc';
4import { ISignal } from '@lumino/signaling';
5/**
6 * A cell list object that supports undo/redo.
7 */
8export declare class CellList {
9 protected model: ISharedNotebook;
10 /**
11 * Construct the cell list.
12 */
13 constructor(model: ISharedNotebook);
14 /**
15 * A signal emitted when the cell list has changed.
16 */
17 get changed(): ISignal<this, IObservableList.IChangedArgs<ICellModel>>;
18 /**
19 * Test whether the cell list has been disposed.
20 */
21 get isDisposed(): boolean;
22 /**
23 * Get the length of the cell list.
24 *
25 * @returns The number of cells in the cell list.
26 */
27 get length(): number;
28 /**
29 * Create an iterator over the cells in the cell list.
30 *
31 * @returns A new iterator starting at the front of the cell list.
32 */
33 [Symbol.iterator](): IterableIterator<ICellModel>;
34 /**
35 * Dispose of the resources held by the cell list.
36 */
37 dispose(): void;
38 /**
39 * Get the cell at the specified index.
40 *
41 * @param index - The positive integer index of interest.
42 *
43 * @returns The cell at the specified index.
44 */
45 get(index: number): ICellModel;
46 private _insertCells;
47 private _onSharedModelChanged;
48 private _cellMap;
49 private _changed;
50 private _isDisposed;
51}