-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtokens.ts
57 lines (50 loc) · 1.29 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
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import { Token } from '@lumino/coreutils';
import { Widget } from '@lumino/widgets';
import { CodeEditor } from './editor';
import { IEditorFactoryService } from './factory';
import { IEditorMimeTypeService } from './mimetype';
/**
* Code editor services token.
*/
export const IEditorServices = new Token<IEditorServices>(
'@jupyterlab/codeeditor:IEditorServices'
);
/**
* Code editor services.
*/
export interface IEditorServices {
/**
* The code editor factory.
*/
readonly factoryService: IEditorFactoryService;
/**
* The editor mime type service.
*/
readonly mimeTypeService: IEditorMimeTypeService;
}
/**
* Code editor cursor position token.
*/
export const IPositionModel = new Token<IPositionModel>(
'@jupyterlab/codeeditor:IPositionModel'
);
/**
* Code editor cursor position model.
*/
export interface IPositionModel {
/**
* Add a editor provider.
*
* A provider will receive the currently active widget and must return the
* associated editor if it can or null otherwise.
*/
addEditorProvider: (
provider: (widget: Widget | null) => CodeEditor.IEditor | null
) => void;
/**
* Callback to force updating the provider
*/
update(): void;
}