import type { FieldProps } from '@rjsf/utils'; import type { IEditorLanguageRegistry } from '@jupyterlab/codemirror'; import type { INotebookTracker } from '@jupyterlab/notebook'; import { NotebookTools } from '@jupyterlab/notebook'; declare namespace Private { /** * Custom active cell field options. */ interface IOptions { /** * The tracker to the notebook panel. */ tracker: INotebookTracker; /** * Editor languages registry */ languages: IEditorLanguageRegistry; } } /** * The active cell field, displaying the first line and execution count of the active cell. * * ## Note * This field does not work as other metadata form fields, as it does not update metadata. * * A single instance is meant to be shared by every render of the field. The * displayed cell follows the notebook tracker rather than the render calls, so * that the field keeps working when the metadata form is not being rebuilt, and * so that it does not hold on to a cell model of a closed notebook. * * One instance owns one node, so the field can only be mounted in one place at * a time: `render` moves the node to the most recent mount point and leaves any * earlier one empty. Nothing renders this field twice today. */ export declare class ActiveCellTool extends NotebookTools.Tool { constructor(options: Private.IOptions); dispose(): void; render(props: FieldProps): JSX.Element; /** * Follow the active cell of the tracker, which is null once the last * notebook is closed. */ private _onActiveCellChanged; /** * Handle a change to the current cell source, mime type or execution count. */ private _onCellContentChanged; /** * Stop listening to the cell model the tool is currently displaying. */ private _disconnectCellModel; /** * Reflect the execution count of the current cell. */ private _updatePrompt; /** * Refresh the preview, writing an outdated prompt along with it. * * The prompt is written in the same task as the preview it belongs with, so * that the field never shows the prompt of one cell above the source line of * another while a language mode is being loaded. */ private _update; private _tracker; private _languages; private _cellModel; private _previewDebouncer; private _updateId; private _pendingUpdate; private _promptOutdated; private _editorEl; private _inputPrompt; } export {};