UNPKG

1.84 kBTypeScriptView Raw
1import { ISettingRegistry } from '@jupyterlab/settingregistry';
2import { DataConnector } from '@jupyterlab/statedb';
3import { ServerConnection } from '../serverconnection';
4/**
5 * The settings API service manager.
6 */
7export declare class SettingManager extends DataConnector<ISettingRegistry.IPlugin, string> {
8 /**
9 * Create a new setting manager.
10 */
11 constructor(options?: SettingManager.IOptions);
12 /**
13 * The server settings used to make API requests.
14 */
15 readonly serverSettings: ServerConnection.ISettings;
16 /**
17 * Fetch a plugin's settings.
18 *
19 * @param id - The plugin's ID.
20 *
21 * @returns A promise that resolves if successful.
22 */
23 fetch(id: string): Promise<ISettingRegistry.IPlugin>;
24 /**
25 * Fetch the list of all plugin setting bundles.
26 *
27 * @returns A promise that resolves if successful.
28 */
29 list(query?: 'ids'): Promise<{
30 ids: string[];
31 values: ISettingRegistry.IPlugin[];
32 }>;
33 /**
34 * Save a plugin's settings.
35 *
36 * @param id - The plugin's ID.
37 *
38 * @param raw - The user setting values as a raw string of JSON with comments.
39 *
40 * @returns A promise that resolves if successful.
41 */
42 save(id: string, raw: string): Promise<void>;
43}
44/**
45 * A namespace for `SettingManager` statics.
46 */
47export declare namespace SettingManager {
48 /**
49 * The instantiation options for a setting manager.
50 */
51 interface IOptions {
52 /**
53 * The server settings used to make API requests.
54 */
55 serverSettings?: ServerConnection.ISettings;
56 }
57}
58/**
59 * A namespace for setting API interfaces.
60 */
61export declare namespace Setting {
62 /**
63 * The interface for the setting system manager.
64 */
65 interface IManager extends SettingManager {
66 }
67}