UNPKG

1.08 kBTypeScriptView Raw
1import { Token } from '@lumino/coreutils';
2import { WidgetModel, WidgetView } from './widget';
3/**
4 * A runtime interface token for a widget registry.
5 */
6export declare const IJupyterWidgetRegistry: Token<IJupyterWidgetRegistry>;
7/**
8 * A registry of Jupyter Widgets.
9 *
10 * This is used by widget managers that support an external registry.
11 */
12export interface IJupyterWidgetRegistry {
13 /**
14 * Register a widget module.
15 */
16 registerWidget(data: IWidgetRegistryData): void;
17}
18export type ExportMap = {
19 [key: string]: typeof WidgetModel | typeof WidgetView;
20};
21export type ExportData = ExportMap | Promise<ExportMap> | (() => ExportMap) | (() => Promise<ExportMap>);
22export interface IWidgetRegistryData {
23 /**
24 * The widget module name.
25 */
26 name: string;
27 /**
28 * The widget module version.
29 */
30 version: string;
31 /**
32 * A map of object names to widget classes provided by the module, or a
33 * promise to such a map, or a function returning the same.
34 */
35 exports: ExportData;
36}
37//# sourceMappingURL=registry.d.ts.map
\No newline at end of file