forked from QuantStack/yjs-widgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
37 lines (31 loc) · 1.04 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
import { Kernel } from '@jupyterlab/services';
import { Token } from '@lumino/coreutils';
import { IJupyterYModel } from '../types';
export interface IJupyterYWidgetModelRegistry {
getModel(id: string): IJupyterYModel | undefined;
}
export interface IJupyterYModelFactory {
new (...args: any[]): IJupyterYModel;
}
export interface IJupyterYWidgetFactory {
new (...args: any[]): IJupyterYWidget;
}
export interface IJupyterYWidgetManager {
registerKernel(kernel: Kernel.IKernelConnection): void;
registerWidget(
name: string,
yModelFactory: IJupyterYModelFactory,
yWidgetFactory: IJupyterYWidgetFactory
): void;
getWidgetModel(kernelId: string, commId: string): IJupyterYModel | undefined;
getWidgetFactory(modelName: string): IJupyterYWidgetFactory | undefined;
}
export const IJupyterYWidgetManager = new Token<IJupyterYWidgetManager>(
'yjs-widgets:IJupyterYWidgetManager',
'A manager of Yjs-based Jupyter widgets.'
);
export interface IJupyterYWidget {
node: HTMLElement;
yModel: IJupyterYModel;
dispose?(): void;
}