-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtypes.ts
39 lines (33 loc) · 1.17 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { Kernel } from '@jupyterlab/services';
import { Token } from '@lumino/coreutils';
import { IJupyterYModel } from '../types';
export interface IJupyterYWidgetModelRegistry {
getModel(id: string): IJupyterYModel | undefined;
setModel(id: string, model: IJupyterYModel): void;
}
export interface IJupyterYModelFactory {
new (...args: any[]): IJupyterYModel;
}
export interface IJupyterYWidgetFactory {
new (...args: any[]): IJupyterYWidget;
}
export interface IJupyterYWidgetManager {
registerNotebook(notebookId: string): IJupyterYWidgetModelRegistry;
registerKernel(kernel: Kernel.IKernelConnection): void;
registerWidget(
name: string,
yModelFactory: IJupyterYModelFactory,
yWidgetFactory: IJupyterYWidgetFactory
): void;
getWidgetModel(kernelId: string, commId: string): IJupyterYModel | undefined;
getWidgetFactory(modelName: string): any | undefined;
yModelFactories: Map<string, IJupyterYModelFactory>;
}
export const IJupyterYWidgetManager = new Token<IJupyterYWidgetManager>(
'yjs-widgets:IJupyterYWidgetManager',
'A manager of Yjs-based Jupyter widgets.'
);
export interface IJupyterYWidget {
node: HTMLElement;
yModel: IJupyterYModel;
}