UNPKG

@voila-dashboards/jupyterlab-gridstack

Version:

A gridstack-based template for [![voila-gridstack](assets/voila.png)](https://github.com/voila-dashboards/voila).

116 lines (115 loc) 3.38 kB
import { INotebookModel, NotebookPanel, StaticNotebook } from '@jupyterlab/notebook'; import { IEditorMimeTypeService } from '@jupyterlab/codeeditor'; import { IRenderMimeRegistry } from '@jupyterlab/rendermime'; import { DocumentRegistry } from '@jupyterlab/docregistry'; import { Panel, Widget } from '@lumino/widgets'; import { Message } from '@lumino/messaging'; /** * A Widget to host and interact with gridstack. */ export declare class VoilaGridStackPanel extends Panel { /** * Construct a `VoilaGridstackPanel`. * * @param options - The options to construct `VoilaGridstackPanel`. */ constructor(options: VoilaGridStackPanel.IOptions); /** * Dispose of the resources held by the widget. */ dispose(): void; /** * The rendermime instance for this context. */ readonly rendermime: IRenderMimeRegistry; /** * A notebook panel content factory. */ readonly contentFactory: NotebookPanel.IContentFactory; /** * The service used to look up mime types. */ readonly mimeTypeService: IEditorMimeTypeService; /** * Getter for the notebook cell editor configuration. */ get editorConfig(): StaticNotebook.IEditorConfig; /** * Setter for the notebook cell editor configuration. * * @param value - The `EditorConfig` of the notebook. */ set editorConfig(value: StaticNotebook.IEditorConfig); /** * Getter for the notebook configuration. */ get notebookConfig(): StaticNotebook.INotebookConfig; /** * Setter for the notebook configuration. * * @param value - The configuration of the notebook. */ set notebookConfig(value: StaticNotebook.INotebookConfig); /** * Getter for the list of grid items widgets */ get gridWidgets(): Widget[]; /** * Handle `update-request` messages sent to the widget. */ protected onUpdateRequest(msg: Message): void; /** * Compact the dashboard on the top left corner. */ compact(): void; /** * Open a dialog to edit the gridstack metadata information. */ info(): void; /** * Reload the notebook from the disk */ revert(): void; /** * Save the gridstack configuration into the notebook metadata. */ save(): void; private _context; private _editorConfig; private _notebookConfig; private _gridstackWidget; } /** * A namespace for VoilaGridStackPanel statics. */ export declare namespace VoilaGridStackPanel { /** * Options interface for VoilaGridstackPanel */ interface IOptions { /** * The Notebook context. */ context: DocumentRegistry.IContext<INotebookModel>; /** * The rendermime instance for this context. */ rendermime: IRenderMimeRegistry; /** * A notebook panel content factory. */ contentFactory: NotebookPanel.IContentFactory; /** * The service used to look up mime types. */ mimeTypeService: IEditorMimeTypeService; /** * A config object for cell editors */ editorConfig: StaticNotebook.IEditorConfig; /** * A config object for notebook widget */ notebookConfig: StaticNotebook.INotebookConfig; } }