UNPKG

4.21 kBTypeScriptView Raw
1import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
2import { Token } from '@lumino/coreutils';
3import { JupyterFrontEnd, JupyterFrontEndPlugin } from './frontend';
4import { ILabShell } from './shell';
5import { LabStatus } from './status';
6/**
7 * JupyterLab is the main application class. It is instantiated once and shared.
8 */
9export declare class JupyterLab extends JupyterFrontEnd<ILabShell> {
10 /**
11 * Construct a new JupyterLab object.
12 */
13 constructor(options?: JupyterLab.IOptions);
14 /**
15 * The name of the JupyterLab application.
16 */
17 readonly name: string;
18 /**
19 * A namespace/prefix plugins may use to denote their provenance.
20 */
21 readonly namespace: string;
22 /**
23 * A list of all errors encountered when registering plugins.
24 */
25 readonly registerPluginErrors: Array<Error>;
26 /**
27 * Promise that resolves when state is first restored, returning layout
28 * description.
29 */
30 readonly restored: Promise<void>;
31 /**
32 * The application busy and dirty status signals and flags.
33 */
34 readonly status: LabStatus;
35 /**
36 * The version of the JupyterLab application.
37 */
38 readonly version: string;
39 /**
40 * The JupyterLab application information dictionary.
41 */
42 get info(): JupyterLab.IInfo;
43 /**
44 * The JupyterLab application paths dictionary.
45 */
46 get paths(): JupyterFrontEnd.IPaths;
47 /**
48 * Register plugins from a plugin module.
49 *
50 * @param mod - The plugin module to register.
51 */
52 registerPluginModule(mod: JupyterLab.IPluginModule): void;
53 /**
54 * Register the plugins from multiple plugin modules.
55 *
56 * @param mods - The plugin modules to register.
57 */
58 registerPluginModules(mods: JupyterLab.IPluginModule[]): void;
59 private _info;
60 private _paths;
61}
62/**
63 * The namespace for `JupyterLab` class statics.
64 */
65export declare namespace JupyterLab {
66 /**
67 * The options used to initialize a JupyterLab object.
68 */
69 interface IOptions extends Partial<JupyterFrontEnd.IOptions<ILabShell>>, Partial<IInfo> {
70 paths?: Partial<JupyterFrontEnd.IPaths>;
71 }
72 /**
73 * The layout restorer token.
74 */
75 const IInfo: Token<IInfo>;
76 /**
77 * The information about a JupyterLab application.
78 */
79 interface IInfo {
80 /**
81 * Whether the application is in dev mode.
82 */
83 readonly devMode: boolean;
84 /**
85 * The collection of deferred extension patterns and matched extensions.
86 */
87 readonly deferred: {
88 patterns: string[];
89 matches: string[];
90 };
91 /**
92 * The collection of disabled extension patterns and matched extensions.
93 */
94 readonly disabled: {
95 patterns: string[];
96 matches: string[];
97 };
98 /**
99 * The mime renderer extensions.
100 */
101 readonly mimeExtensions: IRenderMime.IExtensionModule[];
102 /**
103 * Whether files are cached on the server.
104 */
105 readonly filesCached: boolean;
106 /**
107 * Every periodic network polling should be paused while this is set
108 * to `false`. Extensions should use this value to decide whether to proceed
109 * with the polling.
110 * The extensions may also set this value to `false` if there is no need to
111 * fetch anything from the server backend basing on some conditions
112 * (e.g. when an error message dialog is displayed).
113 * At the same time, the extensions are responsible for setting this value
114 * back to `true`.
115 */
116 isConnected: boolean;
117 }
118 /**
119 * The default JupyterLab application info.
120 */
121 const defaultInfo: IInfo;
122 /**
123 * The default JupyterLab application paths.
124 */
125 const defaultPaths: JupyterFrontEnd.IPaths;
126 /**
127 * The interface for a module that exports a plugin or plugins as
128 * the default value.
129 */
130 interface IPluginModule {
131 /**
132 * The default export.
133 */
134 default: JupyterFrontEndPlugin<any, any, any> | JupyterFrontEndPlugin<any, any, any>[];
135 }
136}