-
Notifications
You must be signed in to change notification settings - Fork 276
/
tokens.ts
75 lines (63 loc) 路 1.48 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
import { ISettingRegistry } from '@jupyterlab/settingregistry';
import { JSONObject, PartialJSONObject, Token } from '@lumino/coreutils';
/**
* The token for the settings service.
*/
export const ISettings = new Token<ISettings>('@jupyterlite/settings:ISettings');
/**
* The settings file to request
*/
export type SettingsFile = 'all.json' | 'all_federated.json';
/**
* An interface for the plugin settings.
*/
export interface IPlugin extends PartialJSONObject {
/**
* The name of the plugin.
*/
id: string;
/**
* The settings for the plugin.
*/
settings: JSONObject;
/**
* The raw user settings data as a string containing JSON with comments.
*/
raw: string;
/**
* The JSON schema for the plugin.
*/
schema: ISettingRegistry.ISchema;
/**
* The published version of the NPM package containing the plugin.
*/
version: string;
}
/**
* The interface for the Settings service.
*/
export interface ISettings {
/**
* A promise that resolves after the settings have been full initialized
*/
ready: Promise<void>;
/**
* Get settings by plugin id
*
* @param pluginId the id of the plugin
*
*/
get(pluginId: string): Promise<IPlugin | undefined>;
/**
* Get all the settings
*/
getAll(): Promise<{ settings: IPlugin[] }>;
/**
* Save settings for a given plugin id
*
* @param pluginId The id of the plugin
* @param raw The raw settings
*
*/
save(pluginId: string, raw: string): Promise<void>;
}