forked from jupyterlab-contrib/jupyterlab-variableInspector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtokens.ts
79 lines (70 loc) · 2.15 KB
/
tokens.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
import { Kernel, KernelMessage } from '@jupyterlab/services';
import { Token } from '@lumino/coreutils';
import { DataModel } from '@lumino/datagrid';
import { IObservableDisposable } from '@lumino/disposable';
import { ISignal } from '@lumino/signaling';
import type { VariableInspectionHandler } from './handler';
export const IVariableInspectorManager = new Token<IVariableInspectorManager>(
'jupyterlab_extension/variableinspector:IVariableInspectorManager'
);
export interface IVariableInspectorManager {
source: IVariableInspector.IInspectable | null;
hasHandler(id: string): boolean;
getHandler(id: string): VariableInspectionHandler;
addHandler(handler: VariableInspectionHandler): void;
}
/**
* The inspector panel token.
*/
export const IVariableInspector = new Token<IVariableInspector>(
'jupyterlab_extension/variableinspector:IVariableInspector'
);
/**
* An interface for an inspector.
*/
export interface IVariableInspector {
source: IVariableInspector.IInspectable | null;
}
/**
* A namespace for inspector interfaces.
*/
export namespace IVariableInspector {
export interface IInspectable extends IObservableDisposable {
inspected: ISignal<IInspectable, IVariableInspectorUpdate>;
rendermime: IRenderMimeRegistry | null;
enabled: boolean;
performInspection(): void;
performMatrixInspection(
varName: string,
maxRows?: number
): Promise<DataModel>;
performWidgetInspection(
varName: string
): Kernel.IShellFuture<
KernelMessage.IExecuteRequestMsg,
KernelMessage.IExecuteReplyMsg
>;
performDelete(varName: string): void;
}
export interface ISettings {
maxItems: number;
}
export interface IVariableInspectorUpdate {
title: IVariableTitle;
payload: Array<IVariable>;
}
export interface IVariable {
varName: string;
varSize: string;
varShape: string;
varContent: string;
varType: string;
isMatrix: boolean;
isWidget: boolean;
}
export interface IVariableTitle {
kernelName?: string;
contextName?: string; //Context currently reserved for special information.
}
}