1 | import { Cell, CodeCell, ICellModel, MarkdownCell, RawCell } from '@jupyterlab/cells';
|
2 | import { IEditorMimeTypeService } from '@jupyterlab/codeeditor';
|
3 | import { IChangedArgs } from '@jupyterlab/coreutils';
|
4 | import * as nbformat from '@jupyterlab/nbformat';
|
5 | import { IObservableList } from '@jupyterlab/observables';
|
6 | import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
7 | import type { IMapChange } from '@jupyter/ydoc';
|
8 | import { ITranslator } from '@jupyterlab/translation';
|
9 | import { WindowedList } from '@jupyterlab/ui-components';
|
10 | import { Message } from '@lumino/messaging';
|
11 | import { AttachedProperty } from '@lumino/properties';
|
12 | import { ISignal } from '@lumino/signaling';
|
13 | import { PanelLayout, Widget } from '@lumino/widgets';
|
14 | import { CellList } from './celllist';
|
15 | import { INotebookHistory } from './history';
|
16 | import { INotebookModel } from './model';
|
17 | import { NotebookViewModel } from './windowing';
|
18 | type RenderingLayout = 'default' | 'side-by-side';
|
19 |
|
20 |
|
21 |
|
22 | export type NotebookMode = 'command' | 'edit';
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 | export declare class StaticNotebook extends WindowedList<NotebookViewModel> {
|
33 | |
34 |
|
35 |
|
36 | constructor(options: StaticNotebook.IOptions);
|
37 | get cellCollapsed(): ISignal<this, Cell>;
|
38 | get cellInViewportChanged(): ISignal<this, Cell>;
|
39 | /**
|
40 | * A signal emitted when the model of the notebook changes.
|
41 | */
|
42 | get modelChanged(): ISignal<this, void>;
|
43 | /**
|
44 | * A signal emitted when the model content changes.
|
45 | *
|
46 | * #### Notes
|
47 | * This is a convenience signal that follows the current model.
|
48 | */
|
49 | get modelContentChanged(): ISignal<this, void>;
|
50 | /**
|
51 | * A signal emitted when the rendering layout of the notebook changes.
|
52 | */
|
53 | get renderingLayoutChanged(): ISignal<this, RenderingLayout>;
|
54 | /**
|
55 | * The cell factory used by the widget.
|
56 | */
|
57 | readonly contentFactory: StaticNotebook.IContentFactory;
|
58 | /**
|
59 | * The Rendermime instance used by the widget.
|
60 | */
|
61 | readonly rendermime: IRenderMimeRegistry;
|
62 | /**
|
63 | * Translator to be used by cell renderers
|
64 | */
|
65 | readonly translator: ITranslator;
|
66 | /**
|
67 | * The model for the widget.
|
68 | */
|
69 | get model(): INotebookModel | null;
|
70 | set model(newValue: INotebookModel | null);
|
71 | /**
|
72 | * Get the mimetype for code cells.
|
73 | */
|
74 | get codeMimetype(): string;
|
75 | /**
|
76 | * A read-only sequence of the widgets in the notebook.
|
77 | */
|
78 | get widgets(): ReadonlyArray<Cell>;
|
79 | /**
|
80 | * A configuration object for cell editor settings.
|
81 | */
|
82 | get editorConfig(): StaticNotebook.IEditorConfig;
|
83 | set editorConfig(value: StaticNotebook.IEditorConfig);
|
84 | /**
|
85 | * A configuration object for notebook settings.
|
86 | */
|
87 | get notebookConfig(): StaticNotebook.INotebookConfig;
|
88 | set notebookConfig(value: StaticNotebook.INotebookConfig);
|
89 | get renderingLayout(): RenderingLayout | undefined;
|
90 | set renderingLayout(value: RenderingLayout | undefined);
|
91 | /**
|
92 | * Dispose of the resources held by the widget.
|
93 | */
|
94 | dispose(): void;
|
95 | /**
|
96 | * Move cells preserving widget view state.
|
97 | *
|
98 | * #### Notes
|
99 | * This is required because at the model level a move is a deletion
|
100 | * followed by an insertion. Hence the view state is not preserved.
|
101 | *
|
102 | * @param from The index of the cell to move
|
103 | * @param to The new index of the cell
|
104 | * @param n Number of cells to move
|
105 | */
|
106 | moveCell(from: number, to: number, n?: number): void;
|
107 | /**
|
108 | * Force rendering the cell outputs of a given cell if it is still a placeholder.
|
109 | *
|
110 | * #### Notes
|
111 | * The goal of this method is to allow search on cell outputs (that is based
|
112 | * on DOM tree introspection).
|
113 | *
|
114 | * @param index The cell index
|
115 | */
|
116 | renderCellOutputs(index: number): void;
|
117 | /**
|
118 | * Adds a message to the notebook as a header.
|
119 | */
|
120 | protected addHeader(): void;
|
121 | /**
|
122 | * Removes the header.
|
123 | */
|
124 | protected removeHeader(): void;
|
125 | /**
|
126 | * Handle a new model.
|
127 | *
|
128 | * #### Notes
|
129 | * This method is called after the model change has been handled
|
130 | * internally and before the `modelChanged` signal is emitted.
|
131 | * The default implementation is a no-op.
|
132 | */
|
133 | protected onModelChanged(oldValue: INotebookModel | null, newValue: INotebookModel | null): void;
|
134 | /**
|
135 | * Handle changes to the notebook model content.
|
136 | *
|
137 | * #### Notes
|
138 | * The default implementation emits the `modelContentChanged` signal.
|
139 | */
|
140 | protected onModelContentChanged(model: INotebookModel, args: void): void;
|
141 | /**
|
142 | * Handle changes to the notebook model metadata.
|
143 | *
|
144 | * #### Notes
|
145 | * The default implementation updates the mimetypes of the code cells
|
146 | * when the `language_info` metadata changes.
|
147 | */
|
148 | protected onMetadataChanged(sender: INotebookModel, args: IMapChange): void;
|
149 | /**
|
150 | * Handle a cell being inserted.
|
151 | *
|
152 | * The default implementation is a no-op
|
153 | */
|
154 | protected onCellInserted(index: number, cell: Cell): void;
|
155 | /**
|
156 | * Handle a cell being removed.
|
157 | *
|
158 | * The default implementation is a no-op
|
159 | */
|
160 | protected onCellRemoved(index: number, cell: Cell): void;
|
161 | /**
|
162 | * A message handler invoked on an `'update-request'` message.
|
163 | *
|
164 | * #### Notes
|
165 | * The default implementation of this handler is a no-op.
|
166 | */
|
167 | protected onUpdateRequest(msg: Message): void;
|
168 | /**
|
169 | * Handle a new model on the widget.
|
170 | */
|
171 | private _onModelChanged;
|
172 | /**
|
173 | * Handle a change cells event.
|
174 | */
|
175 | protected _onCellsChanged(sender: CellList, args: IObservableList.IChangedArgs<ICellModel>): void;
|
176 | /**
|
177 | * Create a cell widget and insert into the notebook.
|
178 | */
|
179 | private _insertCell;
|
180 | /**
|
181 | * Create a code cell widget from a code cell model.
|
182 | */
|
183 | private _createCodeCell;
|
184 | /**
|
185 | * Create a markdown cell widget from a markdown cell model.
|
186 | */
|
187 | private _createMarkdownCell;
|
188 | /**
|
189 | * Create a raw cell widget from a raw cell model.
|
190 | */
|
191 | private _createRawCell;
|
192 | /**
|
193 | * Remove a cell widget.
|
194 | */
|
195 | private _removeCell;
|
196 | /**
|
197 | * Update the mimetype of the notebook.
|
198 | */
|
199 | private _updateMimetype;
|
200 | /**
|
201 | * Callback when a cell collapsed status changes.
|
202 | *
|
203 | * @param cell Cell changed
|
204 | * @param collapsed New collapsed status
|
205 | */
|
206 | private _onCellCollapsed;
|
207 | /**
|
208 | * Callback when a cell viewport status changes.
|
209 | *
|
210 | * @param cell Cell changed
|
211 | */
|
212 | private _onCellInViewportChanged;
|
213 | /**
|
214 | * Ensure to load in the DOM a cell requesting an user input
|
215 | *
|
216 | * @param cell Cell requesting an input
|
217 | */
|
218 | private _onInputRequested;
|
219 | private _scheduleCellRenderOnIdle;
|
220 | private _updateDataWindowedListIndex;
|
221 | /**
|
222 | * Update editor settings for notebook cells.
|
223 | */
|
224 | private _updateEditorConfig;
|
225 | private _runOnIdleTime;
|
226 | private _updateForDeferMode;
|
227 | /**
|
228 | * Apply updated notebook settings.
|
229 | */
|
230 | private _updateNotebookConfig;
|
231 | protected cellsArray: Array<Cell>;
|
232 | private _cellCollapsed;
|
233 | private _cellInViewportChanged;
|
234 | private _editorConfig;
|
235 | private _idleCallBack;
|
236 | private _mimetype;
|
237 | private _mimetypeService;
|
238 | readonly kernelHistory: INotebookHistory | undefined;
|
239 | private _modelChanged;
|
240 | private _modelContentChanged;
|
241 | private _notebookConfig;
|
242 | private _notebookModel;
|
243 | private _renderingLayout;
|
244 | private _renderingLayoutChanged;
|
245 | }
|
246 | /**
|
247 | * The namespace for the `StaticNotebook` class statics.
|
248 | */
|
249 | export declare namespace StaticNotebook {
|
250 | |
251 |
|
252 |
|
253 | interface IOptions {
|
254 | |
255 |
|
256 |
|
257 | rendermime: IRenderMimeRegistry;
|
258 | |
259 |
|
260 |
|
261 | languagePreference?: string;
|
262 | |
263 |
|
264 |
|
265 | contentFactory: IContentFactory;
|
266 | |
267 |
|
268 |
|
269 | editorConfig?: IEditorConfig;
|
270 | |
271 |
|
272 |
|
273 | notebookConfig?: INotebookConfig;
|
274 | |
275 |
|
276 |
|
277 | mimeTypeService: IEditorMimeTypeService;
|
278 | |
279 |
|
280 |
|
281 | translator?: ITranslator;
|
282 | |
283 |
|
284 |
|
285 | kernelHistory?: INotebookHistory;
|
286 | |
287 |
|
288 |
|
289 | renderer?: WindowedList.IRenderer;
|
290 | }
|
291 | |
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 | interface IContentFactory extends Cell.IContentFactory {
|
300 | |
301 |
|
302 |
|
303 | createCodeCell(options: CodeCell.IOptions): CodeCell;
|
304 | |
305 |
|
306 |
|
307 | createMarkdownCell(options: MarkdownCell.IOptions): MarkdownCell;
|
308 | |
309 |
|
310 |
|
311 | createRawCell(options: RawCell.IOptions): RawCell;
|
312 | }
|
313 | |
314 |
|
315 |
|
316 | interface IEditorConfig {
|
317 | |
318 |
|
319 |
|
320 | readonly code: Record<string, any>;
|
321 | |
322 |
|
323 |
|
324 | readonly markdown: Record<string, any>;
|
325 | |
326 |
|
327 |
|
328 | readonly raw: Record<string, any>;
|
329 | }
|
330 | |
331 |
|
332 |
|
333 | const defaultEditorConfig: IEditorConfig;
|
334 | |
335 |
|
336 |
|
337 | interface INotebookConfig {
|
338 | |
339 |
|
340 |
|
341 | defaultCell: nbformat.CellType;
|
342 | |
343 |
|
344 |
|
345 | disableDocumentWideUndoRedo: boolean;
|
346 | |
347 |
|
348 |
|
349 | enableKernelInitNotification: boolean;
|
350 | |
351 |
|
352 |
|
353 | maxNumberOutputs: number;
|
354 | |
355 |
|
356 |
|
357 | inputHistoryScope: 'global' | 'session';
|
358 | |
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 |
|
366 |
|
367 |
|
368 | overscanCount: number;
|
369 | |
370 |
|
371 |
|
372 | recordTiming: boolean;
|
373 | |
374 |
|
375 |
|
376 | renderingLayout: RenderingLayout;
|
377 | |
378 |
|
379 |
|
380 | scrollPastEnd: boolean;
|
381 | |
382 |
|
383 |
|
384 | showHiddenCellsButton: boolean;
|
385 | |
386 |
|
387 |
|
388 | showEditorForReadOnlyMarkdown?: boolean;
|
389 | |
390 |
|
391 |
|
392 | sideBySideLeftMarginOverride: string;
|
393 | |
394 |
|
395 |
|
396 | sideBySideRightMarginOverride: string;
|
397 | |
398 |
|
399 |
|
400 | sideBySideOutputRatio: number;
|
401 | |
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 | windowingMode: 'defer' | 'full' | 'none';
|
409 | accessKernelHistory?: boolean;
|
410 | }
|
411 | |
412 |
|
413 |
|
414 | const defaultNotebookConfig: INotebookConfig;
|
415 | |
416 |
|
417 |
|
418 | class ContentFactory extends Cell.ContentFactory implements IContentFactory {
|
419 | |
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 | createCodeCell(options: CodeCell.IOptions): CodeCell;
|
427 | |
428 |
|
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 | createMarkdownCell(options: MarkdownCell.IOptions): MarkdownCell;
|
435 | |
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 | createRawCell(options: RawCell.IOptions): RawCell;
|
443 | }
|
444 | |
445 |
|
446 |
|
447 | namespace ContentFactory {
|
448 | |
449 |
|
450 |
|
451 | interface IOptions extends Cell.ContentFactory.IOptions {
|
452 | }
|
453 | }
|
454 | }
|
455 |
|
456 |
|
457 |
|
458 | export declare class Notebook extends StaticNotebook {
|
459 | |
460 |
|
461 |
|
462 | constructor(options: Notebook.IOptions);
|
463 | /**
|
464 | * List of selected and active cells
|
465 | */
|
466 | get selectedCells(): Cell[];
|
467 | /**
|
468 | * Adds a footer to the notebook.
|
469 | */
|
470 | protected addFooter(): void;
|
471 | /**
|
472 | * Handle a change cells event.
|
473 | */
|
474 | protected _onCellsChanged(sender: CellList, args: IObservableList.IChangedArgs<ICellModel>): void;
|
475 | /**
|
476 | * A signal emitted when the active cell changes.
|
477 | *
|
478 | * #### Notes
|
479 | * This can be due to the active index changing or the
|
480 | * cell at the active index changing.
|
481 | */
|
482 | get activeCellChanged(): ISignal<this, Cell | null>;
|
483 | /**
|
484 | * A signal emitted when the state of the notebook changes.
|
485 | */
|
486 | get stateChanged(): ISignal<this, IChangedArgs<any>>;
|
487 | /**
|
488 | * A signal emitted when the selection state of the notebook changes.
|
489 | */
|
490 | get selectionChanged(): ISignal<this, void>;
|
491 | /**
|
492 | * The interactivity mode of the notebook.
|
493 | */
|
494 | get mode(): NotebookMode;
|
495 | set mode(newValue: NotebookMode);
|
496 | /**
|
497 | * Set the notebook mode.
|
498 | *
|
499 | * @param newValue Notebook mode
|
500 | * @param options Control mode side-effect
|
501 | * @param options.focus Whether to ensure focus (default) or not when setting the mode.
|
502 | */
|
503 | protected setMode(newValue: NotebookMode, options?: {
|
504 | focus?: boolean;
|
505 | }): void;
|
506 | /**
|
507 | * The active cell index of the notebook.
|
508 | *
|
509 | * #### Notes
|
510 | * The index will be clamped to the bounds of the notebook cells.
|
511 | */
|
512 | get activeCellIndex(): number;
|
513 | set activeCellIndex(newValue: number);
|
514 | /**
|
515 | * Get the active cell widget.
|
516 | *
|
517 | * #### Notes
|
518 | * This is a cell or `null` if there is no active cell.
|
519 | */
|
520 | get activeCell(): Cell | null;
|
521 | get lastClipboardInteraction(): 'copy' | 'cut' | 'paste' | null;
|
522 | set lastClipboardInteraction(newValue: 'copy' | 'cut' | 'paste' | null);
|
523 | /**
|
524 | * Dispose of the resources held by the widget.
|
525 | */
|
526 | dispose(): void;
|
527 | /**
|
528 | * Move cells preserving widget view state.
|
529 | *
|
530 | * #### Notes
|
531 | * This is required because at the model level a move is a deletion
|
532 | * followed by an insertion. Hence the view state is not preserved.
|
533 | *
|
534 | * @param from The index of the cell to move
|
535 | * @param to The new index of the cell
|
536 | * @param n Number of cells to move
|
537 | */
|
538 | moveCell(from: number, to: number, n?: number): void;
|
539 | /**
|
540 | * Select a cell widget.
|
541 | *
|
542 | * #### Notes
|
543 | * It is a no-op if the value does not change.
|
544 | * It will emit the `selectionChanged` signal.
|
545 | */
|
546 | select(widget: Cell): void;
|
547 | /**
|
548 | * Deselect a cell widget.
|
549 | *
|
550 | * #### Notes
|
551 | * It is a no-op if the value does not change.
|
552 | * It will emit the `selectionChanged` signal.
|
553 | */
|
554 | deselect(widget: Cell): void;
|
555 | /**
|
556 | * Whether a cell is selected.
|
557 | */
|
558 | isSelected(widget: Cell): boolean;
|
559 | /**
|
560 | * Whether a cell is selected or is the active cell.
|
561 | */
|
562 | isSelectedOrActive(widget: Cell): boolean;
|
563 | /**
|
564 | * Deselect all of the cells.
|
565 | */
|
566 | deselectAll(): void;
|
567 | /**
|
568 | * Move the head of an existing contiguous selection to extend the selection.
|
569 | *
|
570 | * @param index - The new head of the existing selection.
|
571 | *
|
572 | * #### Notes
|
573 | * If there is no existing selection, the active cell is considered an
|
574 | * existing one-cell selection.
|
575 | *
|
576 | * If the new selection is a single cell, that cell becomes the active cell
|
577 | * and all cells are deselected.
|
578 | *
|
579 | * There is no change if there are no cells (i.e., activeCellIndex is -1).
|
580 | */
|
581 | extendContiguousSelectionTo(index: number): void;
|
582 | /**
|
583 | * Get the head and anchor of a contiguous cell selection.
|
584 | *
|
585 | * The head of a contiguous selection is always the active cell.
|
586 | *
|
587 | * If there are no cells selected, `{head: null, anchor: null}` is returned.
|
588 | *
|
589 | * Throws an error if the currently selected cells do not form a contiguous
|
590 | * selection.
|
591 | */
|
592 | getContiguousSelection(): {
|
593 | head: number;
|
594 | anchor: number;
|
595 | } | {
|
596 | head: null;
|
597 | anchor: null;
|
598 | };
|
599 | /**
|
600 | * Scroll so that the given cell is in view. Selects and activates cell.
|
601 | *
|
602 | * @param cell - A cell in the notebook widget.
|
603 | * @param align - Type of alignment.
|
604 | *
|
605 | */
|
606 | scrollToCell(cell: Cell, align?: WindowedList.ScrollToAlign): Promise<void>;
|
607 | private _parseFragment;
|
608 | /**
|
609 | * Set URI fragment identifier.
|
610 | */
|
611 | setFragment(fragment: string): Promise<void>;
|
612 | /**
|
613 | * Handle the DOM events for the widget.
|
614 | *
|
615 | * @param event - The DOM event sent to the widget.
|
616 | *
|
617 | * #### Notes
|
618 | * This method implements the DOM `EventListener` interface and is
|
619 | * called in response to events on the notebook panel's node. It should
|
620 | * not be called directly by user code.
|
621 | */
|
622 | handleEvent(event: Event): void;
|
623 | /**
|
624 | * Handle `after-attach` messages for the widget.
|
625 | */
|
626 | protected onAfterAttach(msg: Message): void;
|
627 | /**
|
628 | * Handle `before-detach` messages for the widget.
|
629 | */
|
630 | protected onBeforeDetach(msg: Message): void;
|
631 | /**
|
632 | * A message handler invoked on an `'after-show'` message.
|
633 | */
|
634 | protected onAfterShow(msg: Message): void;
|
635 | /**
|
636 | * A message handler invoked on a `'resize'` message.
|
637 | */
|
638 | protected onResize(msg: Widget.ResizeMessage): void;
|
639 | /**
|
640 | * A message handler invoked on an `'before-hide'` message.
|
641 | */
|
642 | protected onBeforeHide(msg: Message): void;
|
643 | /**
|
644 | * Handle `'activate-request'` messages.
|
645 | */
|
646 | protected onActivateRequest(msg: Message): void;
|
647 | /**
|
648 | * Handle `update-request` messages sent to the widget.
|
649 | */
|
650 | protected onUpdateRequest(msg: Message): void;
|
651 | /**
|
652 | * Handle a cell being inserted.
|
653 | */
|
654 | protected onCellInserted(index: number, cell: Cell): void;
|
655 | /**
|
656 | * Handle a cell being removed.
|
657 | */
|
658 | protected onCellRemoved(index: number, cell: Cell): void;
|
659 | /**
|
660 | * Handle a new model.
|
661 | */
|
662 | protected onModelChanged(oldValue: INotebookModel, newValue: INotebookModel): void;
|
663 | /**
|
664 | * Handle edge request signals from cells.
|
665 | */
|
666 | private _onEdgeRequest;
|
667 | /**
|
668 | * Ensure that the notebook has proper focus.
|
669 | */
|
670 | private _ensureFocus;
|
671 | /**
|
672 | * Find the cell index containing the target html element.
|
673 | *
|
674 | * #### Notes
|
675 | * Returns -1 if the cell is not found.
|
676 | */
|
677 | private _findCell;
|
678 | /**
|
679 | * Find the target of html mouse event and cell index containing this target.
|
680 | *
|
681 | * #### Notes
|
682 | * Returned index is -1 if the cell is not found.
|
683 | */
|
684 | private _findEventTargetAndCell;
|
685 | /**
|
686 | * Find heading with given ID in any of the cells.
|
687 | */
|
688 | _findHeading(queryId: string): Promise<Private.IScrollTarget | null>;
|
689 | /**
|
690 | * Find cell by its unique ID.
|
691 | */
|
692 | _findCellById(queryId: string): Private.IScrollTarget | null;
|
693 | /**
|
694 | * Handle `contextmenu` event.
|
695 | */
|
696 | private _evtContextMenuCapture;
|
697 | /**
|
698 | * Handle `mousedown` event in the capture phase for the widget.
|
699 | */
|
700 | private _evtMouseDownCapture;
|
701 | /**
|
702 | * Handle `mousedown` events for the widget.
|
703 | */
|
704 | private _evtMouseDown;
|
705 | /**
|
706 | * Handle the `'mouseup'` event on the document.
|
707 | */
|
708 | private _evtDocumentMouseup;
|
709 | /**
|
710 | * Handle the `'mousemove'` event for the widget.
|
711 | */
|
712 | private _evtDocumentMousemove;
|
713 | /**
|
714 | * Handle the `'lm-dragenter'` event for the widget.
|
715 | */
|
716 | private _evtDragEnter;
|
717 | /**
|
718 | * Handle the `'lm-dragleave'` event for the widget.
|
719 | */
|
720 | private _evtDragLeave;
|
721 | /**
|
722 | * Handle the `'lm-dragover'` event for the widget.
|
723 | */
|
724 | private _evtDragOver;
|
725 | /**
|
726 | * Handle the `'lm-drop'` event for the widget.
|
727 | */
|
728 | private _evtDrop;
|
729 | /**
|
730 | * Start a drag event.
|
731 | */
|
732 | private _startDrag;
|
733 | /**
|
734 | * Update the notebook node with class indicating read-write state.
|
735 | */
|
736 | private _updateReadWrite;
|
737 | /**
|
738 | * Handle `focus` events for the widget.
|
739 | */
|
740 | private _evtFocusIn;
|
741 | /**
|
742 | * Handle `focusout` events for the notebook.
|
743 | */
|
744 | private _evtFocusOut;
|
745 | /**
|
746 | * Handle `dblclick` events for the widget.
|
747 | */
|
748 | private _evtDblClick;
|
749 | /**
|
750 | * Remove selections from inactive cells to avoid
|
751 | * spurious cursors.
|
752 | */
|
753 | private _trimSelections;
|
754 | private _activeCellIndex;
|
755 | private _activeCell;
|
756 | private _mode;
|
757 | private _drag;
|
758 | private _dragData;
|
759 | private _selectData;
|
760 | private _mouseMode;
|
761 | private _activeCellChanged;
|
762 | private _stateChanged;
|
763 | private _selectionChanged;
|
764 | private _cellLayoutStateCache?;
|
765 | private _checkCacheOnNextResize;
|
766 | private _lastClipboardInteraction;
|
767 | private _updateSelectedCells;
|
768 | private _selectedCells;
|
769 | }
|
770 | /**
|
771 | * The namespace for the `Notebook` class statics.
|
772 | */
|
773 | export declare namespace Notebook {
|
774 | /**
|
775 | * An options object for initializing a notebook widget.
|
776 | */
|
777 | interface IOptions extends StaticNotebook.IOptions {
|
778 | }
|
779 | /**
|
780 | * The content factory for the notebook widget.
|
781 | */
|
782 | interface IContentFactory extends StaticNotebook.IContentFactory {
|
783 | }
|
784 | /**
|
785 | * The default implementation of a notebook content factory..
|
786 | *
|
787 | * #### Notes
|
788 | * Override methods on this class to customize the default notebook factory
|
789 | * methods that create notebook content.
|
790 | */
|
791 | class ContentFactory extends StaticNotebook.ContentFactory {
|
792 | }
|
793 | /**
|
794 | * A namespace for the notebook content factory.
|
795 | */
|
796 | namespace ContentFactory {
|
797 | /**
|
798 | * An options object for initializing a notebook content factory.
|
799 | */
|
800 | interface IOptions extends StaticNotebook.ContentFactory.IOptions {
|
801 | }
|
802 | }
|
803 | }
|
804 | /**
|
805 | * A namespace for private data.
|
806 | */
|
807 | declare namespace Private {
|
808 | /**
|
809 | * An attached property for the selected state of a cell.
|
810 | */
|
811 | const selectedProperty: AttachedProperty<Cell<ICellModel>, boolean>;
|
812 | /**
|
813 | * A custom panel layout for the notebook.
|
814 | */
|
815 | class NotebookPanelLayout extends PanelLayout {
|
816 | /**
|
817 | * A message handler invoked on an `'update-request'` message.
|
818 | *
|
819 | * #### Notes
|
820 | * This is a reimplementation of the base class method,
|
821 | * and is a no-op.
|
822 | */
|
823 | protected onUpdateRequest(msg: Message): void;
|
824 | }
|
825 | /**
|
826 | * Create a cell drag image.
|
827 | */
|
828 | function createDragImage(count: number, promptNumber: string, cellContent: string): HTMLElement;
|
829 | /**
|
830 | * Information about resolved scroll target defined by URL fragment.
|
831 | */
|
832 | interface IScrollTarget {
|
833 | /**
|
834 | * Target cell.
|
835 | */
|
836 | cell: Cell;
|
837 | /**
|
838 | * Element to scroll to within the cell.
|
839 | */
|
840 | element?: HTMLElement;
|
841 | }
|
842 | /**
|
843 | * Parsed fragment identifier data.
|
844 | */
|
845 | interface IFragmentData {
|
846 | /**
|
847 | * The kind of notebook element targeted by the fragment identifier.
|
848 | */
|
849 | kind: 'heading' | 'cell-id';
|
850 | value: string;
|
851 | }
|
852 | }
|
853 | export {};
|
854 |
|
\ | No newline at end of file |