@jupyterlab/application 0.19.1-alpha.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +34 -0
- package/lib/index.d.ts +241 -241
- package/lib/index.js +283 -283
- package/lib/layoutrestorer.d.ts +205 -205
- package/lib/layoutrestorer.js +423 -423
- package/lib/mimerenderers.d.ts +22 -22
- package/lib/mimerenderers.js +137 -134
- package/lib/router.d.ts +204 -204
- package/lib/router.js +145 -145
- package/lib/shell.d.ts +277 -277
- package/lib/shell.js +857 -854
- package/package.json +13 -10
package/lib/router.d.ts
CHANGED
|
@@ -1,204 +1,204 @@
|
|
|
1
|
-
import { CommandRegistry } from '@phosphor/commands';
|
|
2
|
-
import { ReadonlyJSONObject, Token } from '@phosphor/coreutils';
|
|
3
|
-
import { IDisposable } from '@phosphor/disposable';
|
|
4
|
-
import { ISignal } from '@phosphor/signaling';
|
|
5
|
-
/**
|
|
6
|
-
* The URL Router token.
|
|
7
|
-
*/
|
|
8
|
-
export declare const IRouter: Token<IRouter>;
|
|
9
|
-
/**
|
|
10
|
-
* A static class that routes URLs within the application.
|
|
11
|
-
*/
|
|
12
|
-
export interface IRouter {
|
|
13
|
-
/**
|
|
14
|
-
* The base URL for the router.
|
|
15
|
-
*/
|
|
16
|
-
readonly base: string;
|
|
17
|
-
/**
|
|
18
|
-
* The command registry used by the router.
|
|
19
|
-
*/
|
|
20
|
-
readonly commands: CommandRegistry;
|
|
21
|
-
/**
|
|
22
|
-
* The parsed current URL of the application.
|
|
23
|
-
*/
|
|
24
|
-
readonly current: IRouter.ILocation;
|
|
25
|
-
/**
|
|
26
|
-
* A signal emitted when the router routes a route.
|
|
27
|
-
*/
|
|
28
|
-
readonly routed: ISignal<IRouter, IRouter.ILocation>;
|
|
29
|
-
/**
|
|
30
|
-
* If a matching rule's command resolves with the `stop` token during routing,
|
|
31
|
-
* no further matches will execute.
|
|
32
|
-
*/
|
|
33
|
-
readonly stop: Token<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Navigate to a new path within the application.
|
|
36
|
-
*
|
|
37
|
-
* @param path - The new path or empty string if redirecting to root.
|
|
38
|
-
*
|
|
39
|
-
* @param options - The navigation options.
|
|
40
|
-
*/
|
|
41
|
-
navigate(path: string, options?: IRouter.INavOptions): void;
|
|
42
|
-
/**
|
|
43
|
-
* Register a rule that maps a path pattern to a command.
|
|
44
|
-
*
|
|
45
|
-
* @param options - The route registration options.
|
|
46
|
-
*
|
|
47
|
-
* @returns A disposable that removes the registered rule from the router.
|
|
48
|
-
*/
|
|
49
|
-
register(options: IRouter.IRegisterOptions): IDisposable;
|
|
50
|
-
/**
|
|
51
|
-
* Cause a hard reload of the document.
|
|
52
|
-
*/
|
|
53
|
-
reload(): void;
|
|
54
|
-
/**
|
|
55
|
-
* Route a specific path to an action.
|
|
56
|
-
*
|
|
57
|
-
* @param url - The URL string that will be routed.
|
|
58
|
-
*
|
|
59
|
-
* #### Notes
|
|
60
|
-
* If a pattern is matched, its command will be invoked with arguments that
|
|
61
|
-
* match the `IRouter.ILocation` interface.
|
|
62
|
-
*/
|
|
63
|
-
route(url: string): void;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* A namespace for the `IRouter` specification.
|
|
67
|
-
*/
|
|
68
|
-
export declare namespace IRouter {
|
|
69
|
-
/**
|
|
70
|
-
* The parsed location currently being routed.
|
|
71
|
-
*/
|
|
72
|
-
interface ILocation extends ReadonlyJSONObject {
|
|
73
|
-
/**
|
|
74
|
-
* The location hash.
|
|
75
|
-
*/
|
|
76
|
-
hash: string;
|
|
77
|
-
/**
|
|
78
|
-
* The path that matched a routing pattern.
|
|
79
|
-
*/
|
|
80
|
-
path: string;
|
|
81
|
-
/**
|
|
82
|
-
* The request being routed with the router `base` omitted.
|
|
83
|
-
*
|
|
84
|
-
* #### Notes
|
|
85
|
-
* This field includes the query string and hash, if they exist.
|
|
86
|
-
*/
|
|
87
|
-
request: string;
|
|
88
|
-
/**
|
|
89
|
-
* The search element, including leading question mark (`'?'`), if any,
|
|
90
|
-
* of the path.
|
|
91
|
-
*/
|
|
92
|
-
search: string;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* The options passed into a navigation request.
|
|
96
|
-
*/
|
|
97
|
-
interface INavOptions {
|
|
98
|
-
/**
|
|
99
|
-
* Whether the navigation should be hard URL change instead of an HTML
|
|
100
|
-
* history API change.
|
|
101
|
-
*/
|
|
102
|
-
hard?: boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Whether the navigation should be added to the browser's history.
|
|
105
|
-
*/
|
|
106
|
-
silent?: boolean;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* The specification for registering a route with the router.
|
|
110
|
-
*/
|
|
111
|
-
interface IRegisterOptions {
|
|
112
|
-
/**
|
|
113
|
-
* The command string that will be invoked upon matching.
|
|
114
|
-
*/
|
|
115
|
-
command: string;
|
|
116
|
-
/**
|
|
117
|
-
* The regular expression that will be matched against URLs.
|
|
118
|
-
*/
|
|
119
|
-
pattern: RegExp;
|
|
120
|
-
/**
|
|
121
|
-
* The rank order of the registered rule. A lower rank denotes a higher
|
|
122
|
-
* priority. The default rank is `100`.
|
|
123
|
-
*/
|
|
124
|
-
rank?: number;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* A static class that routes URLs within the application.
|
|
129
|
-
*/
|
|
130
|
-
export declare class Router implements IRouter {
|
|
131
|
-
/**
|
|
132
|
-
* Create a URL router.
|
|
133
|
-
*/
|
|
134
|
-
constructor(options: Router.IOptions);
|
|
135
|
-
/**
|
|
136
|
-
* The base URL for the router.
|
|
137
|
-
*/
|
|
138
|
-
readonly base: string;
|
|
139
|
-
/**
|
|
140
|
-
* The command registry used by the router.
|
|
141
|
-
*/
|
|
142
|
-
readonly commands: CommandRegistry;
|
|
143
|
-
/**
|
|
144
|
-
* Returns the parsed current URL of the application.
|
|
145
|
-
*/
|
|
146
|
-
readonly current: IRouter.ILocation;
|
|
147
|
-
/**
|
|
148
|
-
* A signal emitted when the router routes a route.
|
|
149
|
-
*/
|
|
150
|
-
readonly routed: ISignal<this, IRouter.ILocation>;
|
|
151
|
-
/**
|
|
152
|
-
* If a matching rule's command resolves with the `stop` token during routing,
|
|
153
|
-
* no further matches will execute.
|
|
154
|
-
*/
|
|
155
|
-
readonly stop: Token<void>;
|
|
156
|
-
/**
|
|
157
|
-
* Navigate to a new path within the application.
|
|
158
|
-
*
|
|
159
|
-
* @param path - The new path or empty string if redirecting to root.
|
|
160
|
-
*
|
|
161
|
-
* @param options - The navigation options.
|
|
162
|
-
*/
|
|
163
|
-
navigate(path: string, options?: IRouter.INavOptions): void;
|
|
164
|
-
/**
|
|
165
|
-
* Register to route a path pattern to a command.
|
|
166
|
-
*
|
|
167
|
-
* @param options - The route registration options.
|
|
168
|
-
*
|
|
169
|
-
* @returns A disposable that removes the registered rule from the router.
|
|
170
|
-
*/
|
|
171
|
-
register(options: IRouter.IRegisterOptions): IDisposable;
|
|
172
|
-
/**
|
|
173
|
-
* Cause a hard reload of the document.
|
|
174
|
-
*/
|
|
175
|
-
reload(): void;
|
|
176
|
-
/**
|
|
177
|
-
* Route a specific path to an action.
|
|
178
|
-
*
|
|
179
|
-
* #### Notes
|
|
180
|
-
* If a pattern is matched, its command will be invoked with arguments that
|
|
181
|
-
* match the `IRouter.ILocation` interface.
|
|
182
|
-
*/
|
|
183
|
-
route(): void;
|
|
184
|
-
private _routed;
|
|
185
|
-
private _rules;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* A namespace for `Router` class statics.
|
|
189
|
-
*/
|
|
190
|
-
export declare namespace Router {
|
|
191
|
-
/**
|
|
192
|
-
* The options for instantiating a JupyterLab URL router.
|
|
193
|
-
*/
|
|
194
|
-
interface IOptions {
|
|
195
|
-
/**
|
|
196
|
-
* The fully qualified base URL for the router.
|
|
197
|
-
*/
|
|
198
|
-
base: string;
|
|
199
|
-
/**
|
|
200
|
-
* The command registry used by the router.
|
|
201
|
-
*/
|
|
202
|
-
commands: CommandRegistry;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
1
|
+
import { CommandRegistry } from '@phosphor/commands';
|
|
2
|
+
import { ReadonlyJSONObject, Token } from '@phosphor/coreutils';
|
|
3
|
+
import { IDisposable } from '@phosphor/disposable';
|
|
4
|
+
import { ISignal } from '@phosphor/signaling';
|
|
5
|
+
/**
|
|
6
|
+
* The URL Router token.
|
|
7
|
+
*/
|
|
8
|
+
export declare const IRouter: Token<IRouter>;
|
|
9
|
+
/**
|
|
10
|
+
* A static class that routes URLs within the application.
|
|
11
|
+
*/
|
|
12
|
+
export interface IRouter {
|
|
13
|
+
/**
|
|
14
|
+
* The base URL for the router.
|
|
15
|
+
*/
|
|
16
|
+
readonly base: string;
|
|
17
|
+
/**
|
|
18
|
+
* The command registry used by the router.
|
|
19
|
+
*/
|
|
20
|
+
readonly commands: CommandRegistry;
|
|
21
|
+
/**
|
|
22
|
+
* The parsed current URL of the application.
|
|
23
|
+
*/
|
|
24
|
+
readonly current: IRouter.ILocation;
|
|
25
|
+
/**
|
|
26
|
+
* A signal emitted when the router routes a route.
|
|
27
|
+
*/
|
|
28
|
+
readonly routed: ISignal<IRouter, IRouter.ILocation>;
|
|
29
|
+
/**
|
|
30
|
+
* If a matching rule's command resolves with the `stop` token during routing,
|
|
31
|
+
* no further matches will execute.
|
|
32
|
+
*/
|
|
33
|
+
readonly stop: Token<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Navigate to a new path within the application.
|
|
36
|
+
*
|
|
37
|
+
* @param path - The new path or empty string if redirecting to root.
|
|
38
|
+
*
|
|
39
|
+
* @param options - The navigation options.
|
|
40
|
+
*/
|
|
41
|
+
navigate(path: string, options?: IRouter.INavOptions): void;
|
|
42
|
+
/**
|
|
43
|
+
* Register a rule that maps a path pattern to a command.
|
|
44
|
+
*
|
|
45
|
+
* @param options - The route registration options.
|
|
46
|
+
*
|
|
47
|
+
* @returns A disposable that removes the registered rule from the router.
|
|
48
|
+
*/
|
|
49
|
+
register(options: IRouter.IRegisterOptions): IDisposable;
|
|
50
|
+
/**
|
|
51
|
+
* Cause a hard reload of the document.
|
|
52
|
+
*/
|
|
53
|
+
reload(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Route a specific path to an action.
|
|
56
|
+
*
|
|
57
|
+
* @param url - The URL string that will be routed.
|
|
58
|
+
*
|
|
59
|
+
* #### Notes
|
|
60
|
+
* If a pattern is matched, its command will be invoked with arguments that
|
|
61
|
+
* match the `IRouter.ILocation` interface.
|
|
62
|
+
*/
|
|
63
|
+
route(url: string): void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A namespace for the `IRouter` specification.
|
|
67
|
+
*/
|
|
68
|
+
export declare namespace IRouter {
|
|
69
|
+
/**
|
|
70
|
+
* The parsed location currently being routed.
|
|
71
|
+
*/
|
|
72
|
+
interface ILocation extends ReadonlyJSONObject {
|
|
73
|
+
/**
|
|
74
|
+
* The location hash.
|
|
75
|
+
*/
|
|
76
|
+
hash: string;
|
|
77
|
+
/**
|
|
78
|
+
* The path that matched a routing pattern.
|
|
79
|
+
*/
|
|
80
|
+
path: string;
|
|
81
|
+
/**
|
|
82
|
+
* The request being routed with the router `base` omitted.
|
|
83
|
+
*
|
|
84
|
+
* #### Notes
|
|
85
|
+
* This field includes the query string and hash, if they exist.
|
|
86
|
+
*/
|
|
87
|
+
request: string;
|
|
88
|
+
/**
|
|
89
|
+
* The search element, including leading question mark (`'?'`), if any,
|
|
90
|
+
* of the path.
|
|
91
|
+
*/
|
|
92
|
+
search: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* The options passed into a navigation request.
|
|
96
|
+
*/
|
|
97
|
+
interface INavOptions {
|
|
98
|
+
/**
|
|
99
|
+
* Whether the navigation should be hard URL change instead of an HTML
|
|
100
|
+
* history API change.
|
|
101
|
+
*/
|
|
102
|
+
hard?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Whether the navigation should be added to the browser's history.
|
|
105
|
+
*/
|
|
106
|
+
silent?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The specification for registering a route with the router.
|
|
110
|
+
*/
|
|
111
|
+
interface IRegisterOptions {
|
|
112
|
+
/**
|
|
113
|
+
* The command string that will be invoked upon matching.
|
|
114
|
+
*/
|
|
115
|
+
command: string;
|
|
116
|
+
/**
|
|
117
|
+
* The regular expression that will be matched against URLs.
|
|
118
|
+
*/
|
|
119
|
+
pattern: RegExp;
|
|
120
|
+
/**
|
|
121
|
+
* The rank order of the registered rule. A lower rank denotes a higher
|
|
122
|
+
* priority. The default rank is `100`.
|
|
123
|
+
*/
|
|
124
|
+
rank?: number;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* A static class that routes URLs within the application.
|
|
129
|
+
*/
|
|
130
|
+
export declare class Router implements IRouter {
|
|
131
|
+
/**
|
|
132
|
+
* Create a URL router.
|
|
133
|
+
*/
|
|
134
|
+
constructor(options: Router.IOptions);
|
|
135
|
+
/**
|
|
136
|
+
* The base URL for the router.
|
|
137
|
+
*/
|
|
138
|
+
readonly base: string;
|
|
139
|
+
/**
|
|
140
|
+
* The command registry used by the router.
|
|
141
|
+
*/
|
|
142
|
+
readonly commands: CommandRegistry;
|
|
143
|
+
/**
|
|
144
|
+
* Returns the parsed current URL of the application.
|
|
145
|
+
*/
|
|
146
|
+
readonly current: IRouter.ILocation;
|
|
147
|
+
/**
|
|
148
|
+
* A signal emitted when the router routes a route.
|
|
149
|
+
*/
|
|
150
|
+
readonly routed: ISignal<this, IRouter.ILocation>;
|
|
151
|
+
/**
|
|
152
|
+
* If a matching rule's command resolves with the `stop` token during routing,
|
|
153
|
+
* no further matches will execute.
|
|
154
|
+
*/
|
|
155
|
+
readonly stop: Token<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Navigate to a new path within the application.
|
|
158
|
+
*
|
|
159
|
+
* @param path - The new path or empty string if redirecting to root.
|
|
160
|
+
*
|
|
161
|
+
* @param options - The navigation options.
|
|
162
|
+
*/
|
|
163
|
+
navigate(path: string, options?: IRouter.INavOptions): void;
|
|
164
|
+
/**
|
|
165
|
+
* Register to route a path pattern to a command.
|
|
166
|
+
*
|
|
167
|
+
* @param options - The route registration options.
|
|
168
|
+
*
|
|
169
|
+
* @returns A disposable that removes the registered rule from the router.
|
|
170
|
+
*/
|
|
171
|
+
register(options: IRouter.IRegisterOptions): IDisposable;
|
|
172
|
+
/**
|
|
173
|
+
* Cause a hard reload of the document.
|
|
174
|
+
*/
|
|
175
|
+
reload(): void;
|
|
176
|
+
/**
|
|
177
|
+
* Route a specific path to an action.
|
|
178
|
+
*
|
|
179
|
+
* #### Notes
|
|
180
|
+
* If a pattern is matched, its command will be invoked with arguments that
|
|
181
|
+
* match the `IRouter.ILocation` interface.
|
|
182
|
+
*/
|
|
183
|
+
route(): void;
|
|
184
|
+
private _routed;
|
|
185
|
+
private _rules;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* A namespace for `Router` class statics.
|
|
189
|
+
*/
|
|
190
|
+
export declare namespace Router {
|
|
191
|
+
/**
|
|
192
|
+
* The options for instantiating a JupyterLab URL router.
|
|
193
|
+
*/
|
|
194
|
+
interface IOptions {
|
|
195
|
+
/**
|
|
196
|
+
* The fully qualified base URL for the router.
|
|
197
|
+
*/
|
|
198
|
+
base: string;
|
|
199
|
+
/**
|
|
200
|
+
* The command registry used by the router.
|
|
201
|
+
*/
|
|
202
|
+
commands: CommandRegistry;
|
|
203
|
+
}
|
|
204
|
+
}
|