UNPKG

3.63 kBTypeScriptView Raw
1import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
2import { Token } from '@lumino/coreutils';
3import { JupyterFrontEnd, JupyterFrontEndPlugin } from './frontend';
4import { ILabShell, LabShell } 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 JupyterFrontEnd.IOptions<LabShell>, 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 /**
108 * The default JupyterLab application info.
109 */
110 const defaultInfo: IInfo;
111 /**
112 * The default JupyterLab application paths.
113 */
114 const defaultPaths: JupyterFrontEnd.IPaths;
115 /**
116 * The interface for a module that exports a plugin or plugins as
117 * the default value.
118 */
119 interface IPluginModule {
120 /**
121 * The default export.
122 */
123 default: JupyterFrontEndPlugin<any, any, any> | JupyterFrontEndPlugin<any, any, any>[];
124 }
125}