-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
tokens.ts
81 lines (72 loc) · 1.98 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
80
81
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import { Token } from '@lumino/coreutils';
import { ISignal } from '@lumino/signaling';
import { Widget } from '@lumino/widgets';
/**
* The inspector panel token.
*/
export const IInspector = new Token<IInspector>(
'@jupyterlab/inspector:IInspector',
`A service for adding contextual help to widgets (visible using "Show Contextual Help" from the Help menu).
Use this to hook into the contextual help system in your extension.`
);
/**
* An interface for an inspector.
*/
export interface IInspector {
/**
* The source of events the inspector listens for.
*/
source: IInspector.IInspectable | null;
}
/**
* A namespace for inspector interfaces.
*/
export namespace IInspector {
/**
* The definition of an inspectable source.
*/
export interface IInspectable {
/**
* A signal emitted when the inspector should clear all items.
*/
cleared: ISignal<any, void>;
/**
* A signal emitted when the inspectable is disposed.
*/
disposed: ISignal<any, void>;
/**
* A signal emitted when an inspector value is generated.
*/
inspected: ISignal<any, IInspectorUpdate>;
/**
* Test whether the inspectable has been disposed.
*/
isDisposed: boolean;
/**
* Indicates whether the inspectable source emits signals.
*
* #### Notes
* The use case for this attribute is to limit the API traffic when no
* inspector is visible. It can be modified by the consumer of the source.
*/
standby: boolean;
/**
* Handle a text changed signal from an editor.
*
* #### Notes
* Update the hints inspector based on a text change.
*/
onEditorChange(customText?: string): void;
}
/**
* An update value for code inspectors.
*/
export interface IInspectorUpdate {
/**
* The content being sent to the inspector for display.
*/
content: Widget | null;
}
}