UNPKG

1.49 kBTypeScriptView Raw
1import { IObservableList } from '@jupyterlab/observables';
2import { ISettingRegistry } from '@jupyterlab/settingregistry';
3import { ITranslator } from '@jupyterlab/translation';
4import { Toolbar } from '@jupyterlab/ui-components';
5import { Widget } from '@lumino/widgets';
6import { IToolbarWidgetRegistry, ToolbarRegistry } from '../tokens';
7/**
8 * Create the toolbar factory for a given container widget based
9 * on a data description stored in settings
10 *
11 * @param toolbarRegistry Toolbar widgets registry
12 * @param settingsRegistry Settings registry
13 * @param factoryName Toolbar container factory name
14 * @param pluginId Settings plugin id
15 * @param translator Translator
16 * @param propertyId Toolbar definition key in the settings plugin
17 * @returns List of toolbar widgets factory
18 */
19export declare function createToolbarFactory(toolbarRegistry: IToolbarWidgetRegistry, settingsRegistry: ISettingRegistry, factoryName: string, pluginId: string, translator: ITranslator, propertyId?: string): (widget: Widget) => IObservableList<ToolbarRegistry.IToolbarItem>;
20/**
21 * Set the toolbar items of a widget from a factory
22 *
23 * @param widget Widget with the toolbar to set
24 * @param factory Toolbar items factory
25 * @param toolbar Separated toolbar if widget is a raw widget
26 */
27export declare function setToolbar(widget: Toolbar.IWidgetToolbar | Widget, factory: (widget: Widget) => IObservableList<ToolbarRegistry.IToolbarItem> | ToolbarRegistry.IToolbarItem[], toolbar?: Toolbar): void;