sophon-notebook-notebook
Version:
JupyterLab - Notebook
71 lines (70 loc) • 2.2 kB
TypeScript
import * as React from 'react';
import { DocumentRegistry } from 'sophon-notebook-docregistry';
import { Widget } from '@phosphor/widgets';
import { ReactWidget } from 'sophon-notebook-apputils';
import { NotebookPanel } from './panel';
import { Notebook } from './widget';
/**
* A namespace for the default toolbar items.
*/
export declare namespace ToolbarItems {
/**
* Create save button toolbar item.
*/
function createSaveButton(panel: NotebookPanel): Widget;
/**
* Create an insert toolbar item.
*/
function createInsertButton(panel: NotebookPanel): Widget;
/**
* Create a cut toolbar item.
*/
function createCutButton(panel: NotebookPanel): Widget;
/**
* Create a copy toolbar item.
*/
function createCopyButton(panel: NotebookPanel): Widget;
/**
* Create a paste toolbar item.
*/
function createPasteButton(panel: NotebookPanel): Widget;
/**
* Create a run toolbar item.
*/
function createRunButton(panel: NotebookPanel): Widget;
/**
* Create a cell type switcher item.
*
* #### Notes
* It will display the type of the current active cell.
* If more than one cell is selected but are of different types,
* it will display `'-'`.
* When the user changes the cell type, it will change the
* cell types of the selected cells.
* It can handle a change to the context.
*/
function createCellTypeItem(panel: NotebookPanel): Widget;
/**
* Get the default toolbar items for panel
*/
function getDefaultItems(panel: NotebookPanel): DocumentRegistry.IToolbarItem[];
}
/**
* A toolbar widget that switches cell types.
*/
export declare class CellTypeSwitcher extends ReactWidget {
/**
* Construct a new cell type switcher.
*/
constructor(widget: Notebook);
/**
* Handle `change` events for the HTMLSelect component.
*/
handleChange: (event: React.ChangeEvent<HTMLSelectElement>) => void;
/**
* Handle `keydown` events for the HTMLSelect component.
*/
handleKeyDown: (event: React.KeyboardEvent<Element>) => void;
render(): JSX.Element;
private _notebook;
}