sample-cross-fx 0.15.0-beta.4630 → 0.15.0-beta.4670
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/app/{index.469eb3.js → index.972786.js} +139 -52
- package/app/{index.469eb3.js.map → index.972786.js.map} +1 -1
- package/app/index.d.ts +1168 -1166
- package/app/index.html +1 -1
- package/app/index.js +1 -1
- package/files.tar +0 -0
- package/files_once.tar +0 -0
- package/package.json +20 -20
package/app/index.d.ts
CHANGED
|
@@ -8,1208 +8,1210 @@ import * as SolidJs from 'solid-js';
|
|
|
8
8
|
import * as ReactRouter from 'react-router';
|
|
9
9
|
import * as AngularCore from '@angular/core';
|
|
10
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Defines the API accessible from pilets.
|
|
13
|
+
*/
|
|
14
|
+
export interface PiletApi extends EventEmitter, PiletCustomApi, PiletCoreApi {
|
|
15
|
+
/**
|
|
16
|
+
* Gets the metadata of the current pilet.
|
|
17
|
+
*/
|
|
18
|
+
meta: PiletMetadata;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The emitter for Piral app shell events.
|
|
23
|
+
*/
|
|
24
|
+
export interface EventEmitter {
|
|
25
|
+
/**
|
|
26
|
+
* Attaches a new event listener.
|
|
27
|
+
* @param type The type of the event to listen for.
|
|
28
|
+
* @param callback The callback to trigger.
|
|
29
|
+
*/
|
|
30
|
+
on<K extends keyof PiralEventMap>(type: K, callback: Listener<PiralEventMap[K]>): EventEmitter;
|
|
31
|
+
/**
|
|
32
|
+
* Detaches an existing event listener.
|
|
33
|
+
* @param type The type of the event to listen for.
|
|
34
|
+
* @param callback The callback to trigger.
|
|
35
|
+
*/
|
|
36
|
+
off<K extends keyof PiralEventMap>(type: K, callback: Listener<PiralEventMap[K]>): EventEmitter;
|
|
37
|
+
/**
|
|
38
|
+
* Emits a new event with the given type.
|
|
39
|
+
* @param type The type of the event to emit.
|
|
40
|
+
* @param arg The payload of the event.
|
|
41
|
+
*/
|
|
42
|
+
emit<K extends keyof PiralEventMap>(type: K, arg: PiralEventMap[K]): EventEmitter;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Custom Pilet API parts defined outside of piral-core.
|
|
47
|
+
*/
|
|
48
|
+
export interface PiletCustomApi extends PiletVueApi, PiletNgApi, PiletNgjsApi, PiletHyperappApi, PiletInfernoApi, PiletPreactApi, PiletLazyApi, PiletLitElApi, PiletMithrilApi, PiletAureliaApi, PiletRiotApi, PiletElmApi, PiletSvelteApi, PiletBlazorApi, PiletSolidApi, PiletDashboardApi {}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Defines the Pilet API from piral-core.
|
|
52
|
+
* This interface will be consumed by pilet developers so that their pilet can interact with the piral instance.
|
|
53
|
+
*/
|
|
54
|
+
export interface PiletCoreApi {
|
|
55
|
+
/**
|
|
56
|
+
* Gets a shared data value.
|
|
57
|
+
* @param name The name of the data to retrieve.
|
|
58
|
+
*/
|
|
59
|
+
getData<TKey extends string>(name: TKey): SharedData[TKey];
|
|
60
|
+
/**
|
|
61
|
+
* Sets the data using a given name. The name needs to be used exclusively by the current pilet.
|
|
62
|
+
* Using the name occupied by another pilet will result in no change.
|
|
63
|
+
* @param name The name of the data to store.
|
|
64
|
+
* @param value The value of the data to store.
|
|
65
|
+
* @param options The optional configuration for storing this piece of data.
|
|
66
|
+
* @returns True if the data could be set, otherwise false.
|
|
67
|
+
*/
|
|
68
|
+
setData<TKey extends string>(name: TKey, value: SharedData[TKey], options?: DataStoreOptions): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Registers a route for predefined page component.
|
|
71
|
+
* The route needs to be unique and can contain params.
|
|
72
|
+
* Params are following the path-to-regexp notation, e.g., :id for an id parameter.
|
|
73
|
+
* @param route The route to register.
|
|
74
|
+
* @param Component The component to render the page.
|
|
75
|
+
* @param meta The optional metadata to use.
|
|
76
|
+
*/
|
|
77
|
+
registerPage(route: string, Component: AnyComponent<PageComponentProps>, meta?: PiralPageMeta): RegistrationDisposer;
|
|
78
|
+
/**
|
|
79
|
+
* Unregisters the page identified by the given route.
|
|
80
|
+
* @param route The route that was previously registered.
|
|
81
|
+
*/
|
|
82
|
+
unregisterPage(route: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Registers an extension component with a predefined extension component.
|
|
85
|
+
* The name must refer to the extension slot.
|
|
86
|
+
* @param name The global name of the extension slot.
|
|
87
|
+
* @param Component The component to be rendered.
|
|
88
|
+
* @param defaults Optionally, sets the default values for the expected data.
|
|
89
|
+
*/
|
|
90
|
+
registerExtension<TName>(name: TName extends string ? TName : string, Component: AnyExtensionComponent<TName>, defaults?: Partial<ExtensionParams<TName>>): RegistrationDisposer;
|
|
91
|
+
/**
|
|
92
|
+
* Unregisters a global extension component.
|
|
93
|
+
* Only previously registered extension components can be unregistered.
|
|
94
|
+
* @param name The name of the extension slot to unregister from.
|
|
95
|
+
* @param Component The registered extension component to unregister.
|
|
96
|
+
*/
|
|
97
|
+
unregisterExtension<TName>(name: TName extends string ? TName : string, Component: AnyExtensionComponent<TName>): void;
|
|
98
|
+
/**
|
|
99
|
+
* React component for displaying extensions for a given name.
|
|
100
|
+
* @param props The extension's rendering props.
|
|
101
|
+
* @return The created React element.
|
|
102
|
+
*/
|
|
103
|
+
Extension<TName>(props: ExtensionSlotProps<TName>): React.ReactElement | null;
|
|
104
|
+
/**
|
|
105
|
+
* Renders an extension in a plain DOM component.
|
|
106
|
+
* @param element The DOM element or shadow root as a container for rendering the extension.
|
|
107
|
+
* @param props The extension's rendering props.
|
|
108
|
+
* @return The disposer to clear the extension.
|
|
109
|
+
*/
|
|
110
|
+
renderHtmlExtension<TName>(element: HTMLElement | ShadowRoot, props: ExtensionSlotProps<TName>): Disposable;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Describes the metadata of a pilet available in its API.
|
|
115
|
+
*/
|
|
116
|
+
export interface PiletMetadata {
|
|
117
|
+
/**
|
|
118
|
+
* The name of the pilet, i.e., the package id.
|
|
119
|
+
*/
|
|
120
|
+
name: string;
|
|
121
|
+
/**
|
|
122
|
+
* The version of the pilet. Should be semantically versioned.
|
|
123
|
+
*/
|
|
124
|
+
version: string;
|
|
125
|
+
/**
|
|
126
|
+
* Provides the version of the specification for this pilet.
|
|
127
|
+
*/
|
|
128
|
+
spec: string;
|
|
129
|
+
/**
|
|
130
|
+
* Provides some custom metadata for the pilet.
|
|
131
|
+
*/
|
|
132
|
+
custom?: any;
|
|
133
|
+
/**
|
|
134
|
+
* Optionally indicates the global require reference, if any.
|
|
135
|
+
*/
|
|
136
|
+
requireRef?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Additional shared dependencies from the pilet.
|
|
139
|
+
*/
|
|
140
|
+
dependencies: Record<string, string>;
|
|
141
|
+
/**
|
|
142
|
+
* Provides some configuration to be used in the pilet.
|
|
143
|
+
*/
|
|
144
|
+
config: Record<string, any>;
|
|
145
|
+
/**
|
|
146
|
+
* The URL of the main script of the pilet.
|
|
147
|
+
*/
|
|
148
|
+
link: string;
|
|
149
|
+
/**
|
|
150
|
+
* The base path to the pilet. Can be used to make resource requests
|
|
151
|
+
* and override the public path.
|
|
152
|
+
*/
|
|
153
|
+
basePath: string;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Listener for Piral app shell events.
|
|
158
|
+
*/
|
|
159
|
+
export interface Listener<T> {
|
|
160
|
+
(arg: T): void;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* The map of known Piral app shell events.
|
|
165
|
+
*/
|
|
166
|
+
export interface PiralEventMap extends PiralCustomEventMap {
|
|
167
|
+
"unload-pilet": PiralUnloadPiletEvent;
|
|
168
|
+
[custom: string]: any;
|
|
169
|
+
"store-data": PiralStoreDataEvent;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Defines the provided set of Vue Pilet API extensions.
|
|
174
|
+
*/
|
|
175
|
+
export interface PiletVueApi {
|
|
176
|
+
/**
|
|
177
|
+
* Wraps a Vue component for use in Piral.
|
|
178
|
+
* @param component The root component.
|
|
179
|
+
* @param captured The optionally captured props.
|
|
180
|
+
* @returns The Piral Vue component.
|
|
181
|
+
*/
|
|
182
|
+
fromVue<TProps>(component: Vue.Component<TProps>, captured?: Record<string, any>): VueComponent<TProps>;
|
|
183
|
+
/**
|
|
184
|
+
* Vue component for displaying extensions of the given name.
|
|
185
|
+
*/
|
|
186
|
+
VueExtension: Vue.Component<ExtensionSlotProps>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Defines the provided set of Angular Pilet API extensions.
|
|
191
|
+
*/
|
|
192
|
+
export interface PiletNgApi {
|
|
193
|
+
/**
|
|
194
|
+
* Defines the module to use when bootstrapping the Angular pilet.
|
|
195
|
+
*/
|
|
196
|
+
defineNgModule: NgModuleDefiner;
|
|
197
|
+
/**
|
|
198
|
+
* Wraps an Angular component for use in Piral. Might reuse a previously
|
|
199
|
+
* defined module if the component was exported from it.
|
|
200
|
+
* Alternatively, a module might be passed in, where the first component
|
|
201
|
+
* of either the bootstrap or the entryComponents declaration is used.
|
|
202
|
+
* @param component The component root.
|
|
203
|
+
* @returns The Piral Ng component.
|
|
204
|
+
*/
|
|
205
|
+
fromNg(component: any): NgComponent;
|
|
206
|
+
/**
|
|
207
|
+
* Angular component for displaying extensions of the given name.
|
|
208
|
+
*/
|
|
209
|
+
NgExtension: any;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Defines the provided set of Angular Pilet API extensions.
|
|
214
|
+
*/
|
|
215
|
+
export interface PiletNgjsApi {
|
|
216
|
+
/**
|
|
217
|
+
* Wraps an Angular.js module for use in Piral.
|
|
218
|
+
* @param name The name of the component.
|
|
219
|
+
* @param root The module root.
|
|
220
|
+
* @returns The Piral Ngjs component.
|
|
221
|
+
*/
|
|
222
|
+
fromNgjs(name: string, root: Angular.IModule): NgjsComponent;
|
|
223
|
+
/**
|
|
224
|
+
* Angular.js component for displaying extensions of the given name.
|
|
225
|
+
*/
|
|
226
|
+
NgjsExtension: Angular.IModule;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Defines the provided set of the Hyperapp plugin.
|
|
231
|
+
*/
|
|
232
|
+
export interface PiletHyperappApi {
|
|
233
|
+
/**
|
|
234
|
+
* Wraps a Hyperapp component for use in Piral.
|
|
235
|
+
* @param component The component root.
|
|
236
|
+
* @param state The local state of the component.
|
|
237
|
+
* @param actions The actions available to the component.
|
|
238
|
+
* @returns The Piral Hyperapp component.
|
|
239
|
+
*/
|
|
240
|
+
fromHyperapp<TProps>(component: Component<TProps>, state?: any, actions?: any): HyperappComponent<TProps>;
|
|
241
|
+
/**
|
|
242
|
+
* Hyperapp component for displaying extensions of the given name.
|
|
243
|
+
*/
|
|
244
|
+
HyperappExtension: Component<ExtensionSlotProps>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Defines the provided set of Pilet API extensions from the Inferno plugin.
|
|
249
|
+
*/
|
|
250
|
+
export interface PiletInfernoApi {
|
|
251
|
+
/**
|
|
252
|
+
* Wraps an Inferno component for use in Piral.
|
|
253
|
+
* @param component The component root.
|
|
254
|
+
* @returns The Piral Inferno component.
|
|
255
|
+
*/
|
|
256
|
+
fromInferno<TProps>(component: Inferno.ComponentType<TProps>): InfernoComponent<TProps>;
|
|
257
|
+
/**
|
|
258
|
+
* Inferno component for displaying extensions of the given name.
|
|
259
|
+
*/
|
|
260
|
+
InfernoExtension: Inferno.Component<ExtensionSlotProps>;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Defines the provided set of Preact Pilet API extensions.
|
|
265
|
+
*/
|
|
266
|
+
export interface PiletPreactApi {
|
|
267
|
+
/**
|
|
268
|
+
* Wraps an Preact component for use in Piral.
|
|
269
|
+
* @param component The component root.
|
|
270
|
+
* @returns The Piral Preact component.
|
|
271
|
+
*/
|
|
272
|
+
fromPreact<TProps>(component: Preact.ComponentType<TProps>): PreactComponent<TProps>;
|
|
273
|
+
/**
|
|
274
|
+
* Preact component for displaying extensions of the given name.
|
|
275
|
+
*/
|
|
276
|
+
PreactExtension: Preact.ComponentType<ExtensionSlotProps>;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Defines the provided set of lazy loading Pilet API extensions.
|
|
281
|
+
*/
|
|
282
|
+
export interface PiletLazyApi {
|
|
283
|
+
/**
|
|
284
|
+
* Defines a dependency for lazy loading.
|
|
285
|
+
* @param name The name of the dependency.
|
|
286
|
+
* @param loader The associated dependency loader.
|
|
287
|
+
*/
|
|
288
|
+
defineDependency(name: string, loader: LazyDependencyLoader): void;
|
|
289
|
+
/**
|
|
290
|
+
* Properly introduces a lazy loaded foreign component.
|
|
291
|
+
* @param cb The callback to trigger when the component should be loaded.
|
|
292
|
+
* @param deps The optional names of the dependencies to load beforehand.
|
|
293
|
+
* @returns The lazy loading component.
|
|
294
|
+
*/
|
|
295
|
+
fromLazy<T extends BaseComponentProps>(cb: LazyComponentLoader<T>, deps?: Array<string>): React.ComponentType<T & {
|
|
296
|
+
deps?: Record<string, any>;
|
|
297
|
+
}>;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Defines the provided set of LitElement Pilet API extensions.
|
|
302
|
+
*/
|
|
303
|
+
export interface PiletLitElApi {
|
|
304
|
+
/**
|
|
305
|
+
* Wraps a LitElement component for use in Piral.
|
|
306
|
+
* @param component The name of the root component.
|
|
307
|
+
* @returns The Piral LitElement component.
|
|
308
|
+
*/
|
|
309
|
+
fromLitEl(elementName: string): LitElComponent;
|
|
310
|
+
/**
|
|
311
|
+
* Gets the name of the LitElement extension.
|
|
312
|
+
*/
|
|
313
|
+
LitElExtension: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Defines the provided set of Mithril.js Pilet API extensions.
|
|
318
|
+
*/
|
|
319
|
+
export interface PiletMithrilApi {
|
|
320
|
+
/**
|
|
321
|
+
* Wraps an Mithril.js component for use in Piral.
|
|
322
|
+
* @param component The component root.
|
|
323
|
+
* @param captured The optionally captured props.
|
|
324
|
+
* @returns The Piral Mithril.js component.
|
|
325
|
+
*/
|
|
326
|
+
fromMithril<TProps>(component: Component___1<TProps>, captured?: Record<string, any>): MithrilComponent<TProps>;
|
|
327
|
+
/**
|
|
328
|
+
* Mithril.js component for displaying extensions of the given name.
|
|
329
|
+
*/
|
|
330
|
+
MithrilExtension: Component___1<ExtensionSlotProps>;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Defines the provided set of Aurelia Pilet API extensions.
|
|
335
|
+
*/
|
|
336
|
+
export interface PiletAureliaApi {
|
|
337
|
+
/**
|
|
338
|
+
* Wraps an Aurelia component for use in Piral.
|
|
339
|
+
* @param component The component root.
|
|
340
|
+
* @returns The Piral Aurelia component.
|
|
341
|
+
*/
|
|
342
|
+
fromAurelia<TProps>(component: AureliaModule<TProps>): AureliaComponent<TProps>;
|
|
343
|
+
/**
|
|
344
|
+
* Aurelia component for displaying extensions of the given name.
|
|
345
|
+
*/
|
|
346
|
+
AureliaExtension: AureliaModule<ExtensionSlotProps>;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Defines the provided set of Riot.js Pilet API extensions.
|
|
351
|
+
*/
|
|
352
|
+
export interface PiletRiotApi {
|
|
353
|
+
/**
|
|
354
|
+
* Wraps an Riot.js component for use in Piral.
|
|
355
|
+
* @param component The component root.
|
|
356
|
+
* @param captured The optionally captured props.
|
|
357
|
+
* @returns The Piral Riot.js component.
|
|
358
|
+
*/
|
|
359
|
+
fromRiot<TProps>(component: Riot.RiotComponentShell<TProps>, captured?: Record<string, any>): RiotComponent<TProps>;
|
|
360
|
+
/**
|
|
361
|
+
* Riot.js component for displaying extensions of the given name.
|
|
362
|
+
*/
|
|
363
|
+
RiotExtension: Riot.RiotComponentShell<ExtensionSlotProps>;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Defines the provided set of Elm Pilet API extensions.
|
|
368
|
+
*/
|
|
369
|
+
export interface PiletElmApi {
|
|
370
|
+
/**
|
|
371
|
+
* Wraps a Elm module for use in Piral.
|
|
372
|
+
* @param main The name of the root component.
|
|
373
|
+
* @param captured The optionally captured props.
|
|
374
|
+
* @returns The Piral Elm component.
|
|
375
|
+
*/
|
|
376
|
+
fromElm<TProps>(main: ElmModule<TProps>, captured?: Record<string, any>): ElmComponent<TProps>;
|
|
377
|
+
/**
|
|
378
|
+
* Gets the name of the Elm extension.
|
|
379
|
+
*/
|
|
380
|
+
ElmExtension: string;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Defines the provided set of Svelte Pilet API extensions.
|
|
385
|
+
*/
|
|
386
|
+
export interface PiletSvelteApi {
|
|
387
|
+
/**
|
|
388
|
+
* Wraps a Svelte module for use in Piral.
|
|
389
|
+
* @param Component The name of the root component.
|
|
390
|
+
* @param captured The optionally captured props.
|
|
391
|
+
* @returns The Piral Svelte component.
|
|
392
|
+
*/
|
|
393
|
+
fromSvelte<TProps>(Component: SvelteModule<TProps>, captured?: Record<string, any>): SvelteComponent<TProps>;
|
|
394
|
+
/**
|
|
395
|
+
* Gets the name of the Svelte extension.
|
|
396
|
+
*/
|
|
397
|
+
SvelteExtension: string;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Defines the provided set of Blazor Pilet API extensions.
|
|
402
|
+
*/
|
|
403
|
+
export interface PiletBlazorApi {
|
|
404
|
+
/**
|
|
405
|
+
* Defines the additional libraries (and their symbols) to Blazor via
|
|
406
|
+
* their URLs.
|
|
407
|
+
* @param referenceUrls The URLs pointing to the different DLLs to include.
|
|
408
|
+
*/
|
|
409
|
+
defineBlazorReferences(referenceUrls: Array<string>): void;
|
|
410
|
+
/**
|
|
411
|
+
* Wraps a Blazor module for use in Piral.
|
|
412
|
+
* @param moduleName The name of the exposed Blazor component.
|
|
413
|
+
* @param args The optional props to use as arguments for the Blazor component.
|
|
414
|
+
* @returns The Piral Blazor component.
|
|
415
|
+
*/
|
|
416
|
+
fromBlazor(moduleName: string, args?: Record<string, any>): BlazorComponent;
|
|
417
|
+
/**
|
|
418
|
+
* Defines the additional options to be shared by all Blazor components.
|
|
419
|
+
* @param options The options for the Blazor components.
|
|
420
|
+
*/
|
|
421
|
+
defineBlazorOptions(options: BlazorOptions): void;
|
|
422
|
+
/**
|
|
423
|
+
* Releases all defined blazor references from the current pilet.
|
|
424
|
+
*/
|
|
425
|
+
releaseBlazorReferences(): void;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Defines the provided set of Solid Pilet API extensions.
|
|
430
|
+
*/
|
|
431
|
+
export interface PiletSolidApi {
|
|
432
|
+
/**
|
|
433
|
+
* Wraps a Solid component for use in Piral.
|
|
434
|
+
* @param component The name of the root component.
|
|
435
|
+
* @returns The Piral Solid component.
|
|
436
|
+
*/
|
|
437
|
+
fromSolid<TProps>(root: SolidJs.Component<TProps>): SolidComponent<TProps>;
|
|
438
|
+
/**
|
|
439
|
+
* Gets the name of the Solid extension.
|
|
440
|
+
*/
|
|
441
|
+
SolidExtension: SolidJs.Component<ExtensionSlotProps>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export interface PiletDashboardApi {
|
|
445
|
+
/**
|
|
446
|
+
* Registers a tile with a predefined tile components.
|
|
447
|
+
* The name has to be unique within the current pilet.
|
|
448
|
+
* @param name The name of the tile.
|
|
449
|
+
* @param Component The component to be rendered within the Dashboard.
|
|
450
|
+
* @param preferences The optional preferences to be supplied to the Dashboard for the tile.
|
|
451
|
+
*/
|
|
452
|
+
registerTile(name: string, Component: AnyComponent<TileComponentProps>, preferences?: TilePreferences): RegistrationDisposer;
|
|
453
|
+
/**
|
|
454
|
+
* Registers a tile for predefined tile components.
|
|
455
|
+
* @param Component The component to be rendered within the Dashboard.
|
|
456
|
+
* @param preferences The optional preferences to be supplied to the Dashboard for the tile.
|
|
457
|
+
*/
|
|
458
|
+
registerTile(Component: AnyComponent<TileComponentProps>, preferences?: TilePreferences): RegistrationDisposer;
|
|
459
|
+
/**
|
|
460
|
+
* Unregisters a tile known by the given name.
|
|
461
|
+
* Only previously registered tiles can be unregistered.
|
|
462
|
+
* @param name The name of the tile to unregister.
|
|
463
|
+
*/
|
|
464
|
+
unregisterTile(name: string): void;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Defines the shape of the data store for storing shared data.
|
|
469
|
+
*/
|
|
470
|
+
export interface SharedData<TValue = any> {
|
|
471
|
+
[key: string]: TValue;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Defines the options to be used for storing data.
|
|
476
|
+
*/
|
|
477
|
+
export type DataStoreOptions = DataStoreTarget | CustomDataStoreOptions;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Possible shapes for a component.
|
|
481
|
+
*/
|
|
482
|
+
export type AnyComponent<T> = React.ComponentType<T> | FirstParametersOf<ComponentConverters<T>>;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* The props used by a page component.
|
|
486
|
+
*/
|
|
487
|
+
export interface PageComponentProps<T = any, S = any> extends RouteBaseProps<T, S> {
|
|
488
|
+
/**
|
|
489
|
+
* The meta data registered with the page.
|
|
490
|
+
*/
|
|
491
|
+
meta: PiralPageMeta;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* The meta data registered for a page.
|
|
496
|
+
*/
|
|
497
|
+
export interface PiralPageMeta extends PiralCustomPageMeta, PiralCustomPageMeta {}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The shape of an implicit unregister function.
|
|
501
|
+
*/
|
|
502
|
+
export interface RegistrationDisposer {
|
|
503
|
+
(): void;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Shorthand for the definition of an extension component.
|
|
508
|
+
*/
|
|
509
|
+
export type AnyExtensionComponent<TName> = TName extends keyof PiralExtensionSlotMap ? AnyComponent<ExtensionComponentProps<TName>> : TName extends string ? AnyComponent<ExtensionComponentProps<any>> : AnyComponent<ExtensionComponentProps<TName>>;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Gives the extension params shape for the given extension slot name.
|
|
513
|
+
*/
|
|
514
|
+
export type ExtensionParams<TName> = TName extends keyof PiralExtensionSlotMap ? PiralExtensionSlotMap[TName] : TName extends string ? any : TName;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* The props for defining an extension slot.
|
|
518
|
+
*/
|
|
519
|
+
export type ExtensionSlotProps<TName = string> = BaseExtensionSlotProps<TName extends string ? TName : string, ExtensionParams<TName>>;
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Can be implemented by functions to be used for disposal purposes.
|
|
523
|
+
*/
|
|
524
|
+
export interface Disposable {
|
|
525
|
+
(): void;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Custom events defined outside of piral-core.
|
|
530
|
+
*/
|
|
531
|
+
export interface PiralCustomEventMap {}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Gets fired when a pilet gets unloaded.
|
|
535
|
+
*/
|
|
536
|
+
export interface PiralUnloadPiletEvent {
|
|
537
|
+
/**
|
|
538
|
+
* The name of the pilet to be unloaded.
|
|
539
|
+
*/
|
|
540
|
+
name: string;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Gets fired when a data item gets stored in piral.
|
|
545
|
+
*/
|
|
546
|
+
export interface PiralStoreDataEvent<TValue = any> {
|
|
547
|
+
/**
|
|
548
|
+
* The name of the item that was stored.
|
|
549
|
+
*/
|
|
550
|
+
name: string;
|
|
551
|
+
/**
|
|
552
|
+
* The storage target of the item.
|
|
553
|
+
*/
|
|
554
|
+
target: string;
|
|
555
|
+
/**
|
|
556
|
+
* The value that was stored.
|
|
557
|
+
*/
|
|
558
|
+
value: TValue;
|
|
559
|
+
/**
|
|
560
|
+
* The owner of the item.
|
|
561
|
+
*/
|
|
562
|
+
owner: string;
|
|
563
|
+
/**
|
|
564
|
+
* The expiration of the item.
|
|
565
|
+
*/
|
|
566
|
+
expires: number;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
export interface VueComponent<TProps> {
|
|
570
|
+
/**
|
|
571
|
+
* The root component of Vue rendering tree.
|
|
572
|
+
*/
|
|
573
|
+
root: Vue.Component<TProps>;
|
|
574
|
+
/**
|
|
575
|
+
* The type of the Vue component.
|
|
576
|
+
*/
|
|
577
|
+
type: "vue";
|
|
578
|
+
/**
|
|
579
|
+
* Captures props for transport into the Vue component.
|
|
580
|
+
*/
|
|
581
|
+
captured?: Record<string, any>;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Represents the interface implemented by a module definer function.
|
|
586
|
+
*/
|
|
587
|
+
export interface NgModuleDefiner {
|
|
588
|
+
(module: any, opts?: NgOptions): void;
|
|
589
|
+
}
|
|
428
590
|
|
|
591
|
+
export interface NgComponent {
|
|
429
592
|
/**
|
|
430
|
-
*
|
|
593
|
+
* The component root.
|
|
431
594
|
*/
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
fromSolid<TProps>(root: SolidJs.Component<TProps>): SolidComponent<TProps>;
|
|
439
|
-
/**
|
|
440
|
-
* Gets the name of the Solid extension.
|
|
441
|
-
*/
|
|
442
|
-
SolidExtension: SolidJs.Component<ExtensionSlotProps>;
|
|
443
|
-
}
|
|
595
|
+
component: any;
|
|
596
|
+
/**
|
|
597
|
+
* The type of the Angular component.
|
|
598
|
+
*/
|
|
599
|
+
type: "ng";
|
|
600
|
+
}
|
|
444
601
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
602
|
+
export interface NgjsComponent {
|
|
603
|
+
/**
|
|
604
|
+
* The module root.
|
|
605
|
+
*/
|
|
606
|
+
root: Angular.IModule;
|
|
607
|
+
/**
|
|
608
|
+
* The name of the component.
|
|
609
|
+
*/
|
|
610
|
+
name: string;
|
|
611
|
+
/**
|
|
612
|
+
* The type of the Angular.js component.
|
|
613
|
+
*/
|
|
614
|
+
type: "ngjs";
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* A Component is a function that returns a custom VNode or View.
|
|
619
|
+
* @memberOf [VDOM]
|
|
620
|
+
*/
|
|
621
|
+
export interface Component<Attributes = {}, State = {}, Actions = {}> {
|
|
622
|
+
(attributes: Attributes, children?: Array<VNode | string>): VNode<Attributes> | View<State, Actions>;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
export interface HyperappComponent<TProps> {
|
|
626
|
+
/**
|
|
627
|
+
* The component root.
|
|
628
|
+
*/
|
|
629
|
+
root: Component<TProps>;
|
|
630
|
+
/**
|
|
631
|
+
* The local state of the component.
|
|
632
|
+
*/
|
|
633
|
+
state: any;
|
|
634
|
+
/**
|
|
635
|
+
* The actions of the component.
|
|
636
|
+
*/
|
|
637
|
+
actions: any;
|
|
638
|
+
/**
|
|
639
|
+
* The type of the Hyperapp component.
|
|
640
|
+
*/
|
|
641
|
+
type: "hyperapp";
|
|
642
|
+
}
|
|
467
643
|
|
|
644
|
+
export interface InfernoComponent<TProps> {
|
|
645
|
+
/**
|
|
646
|
+
* The component root.
|
|
647
|
+
*/
|
|
648
|
+
root: Inferno.ComponentType<TProps>;
|
|
468
649
|
/**
|
|
469
|
-
*
|
|
650
|
+
* The type of the Inferno component.
|
|
470
651
|
*/
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}
|
|
652
|
+
type: "inferno";
|
|
653
|
+
}
|
|
474
654
|
|
|
655
|
+
export interface PreactComponent<TProps> {
|
|
656
|
+
/**
|
|
657
|
+
* The component root.
|
|
658
|
+
*/
|
|
659
|
+
root: Preact.ComponentType<TProps>;
|
|
475
660
|
/**
|
|
476
|
-
*
|
|
661
|
+
* The type of the Preact component.
|
|
477
662
|
*/
|
|
478
|
-
|
|
663
|
+
type: "preact";
|
|
664
|
+
}
|
|
479
665
|
|
|
666
|
+
export interface LazyDependencyLoader {
|
|
667
|
+
(): Promise<any>;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
export interface LazyComponentLoader<TProps> {
|
|
671
|
+
(): Promise<AnyComponent<TProps>>;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* The props that every registered component obtains.
|
|
676
|
+
*/
|
|
677
|
+
export interface BaseComponentProps {
|
|
480
678
|
/**
|
|
481
|
-
*
|
|
679
|
+
* The currently used pilet API.
|
|
482
680
|
*/
|
|
483
|
-
|
|
681
|
+
piral: PiletApi;
|
|
682
|
+
}
|
|
484
683
|
|
|
684
|
+
export interface LitElComponent {
|
|
485
685
|
/**
|
|
486
|
-
* The
|
|
686
|
+
* The name of the LitElement root component to render.
|
|
487
687
|
*/
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
688
|
+
elementName: string;
|
|
689
|
+
/**
|
|
690
|
+
* The type of the LitElement component.
|
|
691
|
+
*/
|
|
692
|
+
type: "litel";
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export interface Component___1<TProps> {
|
|
696
|
+
view(vnode: ComponentProps<TProps>): any;
|
|
697
|
+
}
|
|
494
698
|
|
|
699
|
+
export interface MithrilComponent<TProps> {
|
|
495
700
|
/**
|
|
496
|
-
* The
|
|
701
|
+
* The component.
|
|
497
702
|
*/
|
|
498
|
-
|
|
703
|
+
component: Component___1<TProps>;
|
|
704
|
+
/**
|
|
705
|
+
* Captures props for transport into the Mithril.js component.
|
|
706
|
+
*/
|
|
707
|
+
captured?: Record<string, any>;
|
|
708
|
+
/**
|
|
709
|
+
* The type of the Mithril.js component.
|
|
710
|
+
*/
|
|
711
|
+
type: "mithril";
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
export type AureliaModule<TProps> = any;
|
|
499
715
|
|
|
716
|
+
export interface AureliaComponent<TProps> {
|
|
500
717
|
/**
|
|
501
|
-
* The
|
|
718
|
+
* The component root.
|
|
502
719
|
*/
|
|
503
|
-
|
|
504
|
-
(): void;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Shorthand for the definition of an extension component.
|
|
509
|
-
*/
|
|
510
|
-
export type AnyExtensionComponent<TName> = TName extends keyof PiralExtensionSlotMap ? AnyComponent<ExtensionComponentProps<TName>> : TName extends string ? AnyComponent<ExtensionComponentProps<any>> : AnyComponent<ExtensionComponentProps<TName>>;
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* Gives the extension params shape for the given extension slot name.
|
|
514
|
-
*/
|
|
515
|
-
export type ExtensionParams<TName> = TName extends keyof PiralExtensionSlotMap ? PiralExtensionSlotMap[TName] : TName extends string ? any : TName;
|
|
516
|
-
|
|
720
|
+
root: AureliaModule<TProps>;
|
|
517
721
|
/**
|
|
518
|
-
* The
|
|
722
|
+
* The type of the Aurelia component.
|
|
519
723
|
*/
|
|
520
|
-
|
|
724
|
+
type: "aurelia";
|
|
725
|
+
}
|
|
521
726
|
|
|
727
|
+
export interface RiotComponent<TProps> {
|
|
522
728
|
/**
|
|
523
|
-
*
|
|
729
|
+
* The component.
|
|
524
730
|
*/
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
731
|
+
component: Riot.RiotComponentShell<TProps>;
|
|
732
|
+
/**
|
|
733
|
+
* Captures props for transport into the Riot.js component.
|
|
734
|
+
*/
|
|
735
|
+
captured?: Record<string, any>;
|
|
736
|
+
/**
|
|
737
|
+
* The type of the Riot.js component.
|
|
738
|
+
*/
|
|
739
|
+
type: "riot";
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
export interface ElmModule<TProps> {
|
|
743
|
+
init(opts: {
|
|
744
|
+
node: Element;
|
|
745
|
+
flags?: TProps;
|
|
746
|
+
}): void;
|
|
747
|
+
}
|
|
528
748
|
|
|
749
|
+
export interface ElmComponent<TProps> {
|
|
750
|
+
/**
|
|
751
|
+
* The name of the Elm main module to render.
|
|
752
|
+
*/
|
|
753
|
+
main: ElmModule<TProps>;
|
|
754
|
+
/**
|
|
755
|
+
* Captures props for transport into the Elm component.
|
|
756
|
+
*/
|
|
757
|
+
captured?: Record<string, any>;
|
|
529
758
|
/**
|
|
530
|
-
*
|
|
759
|
+
* The type of the Elm component.
|
|
531
760
|
*/
|
|
532
|
-
|
|
761
|
+
type: "elm";
|
|
762
|
+
}
|
|
533
763
|
|
|
764
|
+
export interface SvelteModule<TProps> {
|
|
765
|
+
new (opts: SvelteOptions<TProps>): SvelteComponentInstance<TProps>;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
export interface SvelteComponent<TProps> {
|
|
769
|
+
/**
|
|
770
|
+
* The name of the Svelte main module to render.
|
|
771
|
+
*/
|
|
772
|
+
Component: SvelteModule<TProps>;
|
|
773
|
+
/**
|
|
774
|
+
* Captures props for transport into the Svelte component.
|
|
775
|
+
*/
|
|
776
|
+
captured?: Record<string, any>;
|
|
777
|
+
/**
|
|
778
|
+
* The type of the Svelte component.
|
|
779
|
+
*/
|
|
780
|
+
type: "svelte";
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
export interface BlazorComponent {
|
|
784
|
+
/**
|
|
785
|
+
* The name of the Blazor module to render.
|
|
786
|
+
*/
|
|
787
|
+
moduleName: string;
|
|
788
|
+
/**
|
|
789
|
+
* The args to transport into activation function.
|
|
790
|
+
*/
|
|
791
|
+
args?: Record<string, any>;
|
|
792
|
+
/**
|
|
793
|
+
* An optional dependency that needs to load before
|
|
794
|
+
* the component can be properly displayed.
|
|
795
|
+
*/
|
|
796
|
+
dependency?(): Promise<void>;
|
|
797
|
+
/**
|
|
798
|
+
* The type of the Blazor component.
|
|
799
|
+
*/
|
|
800
|
+
type: "blazor";
|
|
801
|
+
/**
|
|
802
|
+
* Additional options for the Blazor component.
|
|
803
|
+
*/
|
|
804
|
+
options?: BlazorOptions;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* Additional options for the Blazor component
|
|
809
|
+
*/
|
|
810
|
+
export interface BlazorOptions {
|
|
534
811
|
/**
|
|
535
|
-
*
|
|
812
|
+
* The root path where resources are located
|
|
536
813
|
*/
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
* The name of the pilet to be unloaded.
|
|
540
|
-
*/
|
|
541
|
-
name: string;
|
|
542
|
-
}
|
|
814
|
+
resourcePathRoot?: string;
|
|
815
|
+
}
|
|
543
816
|
|
|
817
|
+
export interface SolidComponent<TProps> {
|
|
544
818
|
/**
|
|
545
|
-
*
|
|
819
|
+
* The component root.
|
|
546
820
|
*/
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
target: string;
|
|
556
|
-
/**
|
|
557
|
-
* The value that was stored.
|
|
558
|
-
*/
|
|
559
|
-
value: TValue;
|
|
560
|
-
/**
|
|
561
|
-
* The owner of the item.
|
|
562
|
-
*/
|
|
563
|
-
owner: string;
|
|
564
|
-
/**
|
|
565
|
-
* The expiration of the item.
|
|
566
|
-
*/
|
|
567
|
-
expires: number;
|
|
568
|
-
}
|
|
821
|
+
root: SolidJs.Component<TProps>;
|
|
822
|
+
/**
|
|
823
|
+
* The type of the Solid component.
|
|
824
|
+
*/
|
|
825
|
+
type: "solid";
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
export type TileComponentProps = BaseComponentProps & BareTileComponentProps;
|
|
569
829
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
*
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
export interface LazyComponentLoader<TProps> {
|
|
672
|
-
(): Promise<AnyComponent<TProps>>;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
/**
|
|
676
|
-
* The props that every registered component obtains.
|
|
677
|
-
*/
|
|
678
|
-
export interface BaseComponentProps {
|
|
679
|
-
/**
|
|
680
|
-
* The currently used pilet API.
|
|
681
|
-
*/
|
|
682
|
-
piral: PiletApi;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
export interface LitElComponent {
|
|
686
|
-
/**
|
|
687
|
-
* The name of the LitElement root component to render.
|
|
688
|
-
*/
|
|
689
|
-
elementName: string;
|
|
690
|
-
/**
|
|
691
|
-
* The type of the LitElement component.
|
|
692
|
-
*/
|
|
693
|
-
type: "litel";
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
export interface Component___1<TProps> {
|
|
697
|
-
view(vnode: ComponentProps<TProps>): any;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
export interface MithrilComponent<TProps> {
|
|
701
|
-
/**
|
|
702
|
-
* The component.
|
|
703
|
-
*/
|
|
704
|
-
component: Component___1<TProps>;
|
|
705
|
-
/**
|
|
706
|
-
* Captures props for transport into the Mithril.js component.
|
|
707
|
-
*/
|
|
708
|
-
captured?: Record<string, any>;
|
|
709
|
-
/**
|
|
710
|
-
* The type of the Mithril.js component.
|
|
711
|
-
*/
|
|
712
|
-
type: "mithril";
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
export type AureliaModule<TProps> = any;
|
|
716
|
-
|
|
717
|
-
export interface AureliaComponent<TProps> {
|
|
718
|
-
/**
|
|
719
|
-
* The component root.
|
|
720
|
-
*/
|
|
721
|
-
root: AureliaModule<TProps>;
|
|
722
|
-
/**
|
|
723
|
-
* The type of the Aurelia component.
|
|
724
|
-
*/
|
|
725
|
-
type: "aurelia";
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
export interface RiotComponent<TProps> {
|
|
729
|
-
/**
|
|
730
|
-
* The component.
|
|
731
|
-
*/
|
|
732
|
-
component: Riot.RiotComponentShell<TProps>;
|
|
733
|
-
/**
|
|
734
|
-
* Captures props for transport into the Riot.js component.
|
|
735
|
-
*/
|
|
736
|
-
captured?: Record<string, any>;
|
|
737
|
-
/**
|
|
738
|
-
* The type of the Riot.js component.
|
|
739
|
-
*/
|
|
740
|
-
type: "riot";
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
export interface ElmModule<TProps> {
|
|
744
|
-
init(opts: {
|
|
745
|
-
node: Element;
|
|
746
|
-
flags?: TProps;
|
|
747
|
-
}): void;
|
|
748
|
-
}
|
|
749
|
-
|
|
750
|
-
export interface ElmComponent<TProps> {
|
|
751
|
-
/**
|
|
752
|
-
* The name of the Elm main module to render.
|
|
753
|
-
*/
|
|
754
|
-
main: ElmModule<TProps>;
|
|
755
|
-
/**
|
|
756
|
-
* Captures props for transport into the Elm component.
|
|
757
|
-
*/
|
|
758
|
-
captured?: Record<string, any>;
|
|
759
|
-
/**
|
|
760
|
-
* The type of the Elm component.
|
|
761
|
-
*/
|
|
762
|
-
type: "elm";
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
export interface SvelteModule<TProps> {
|
|
766
|
-
new (opts: SvelteOptions<TProps>): SvelteComponentInstance<TProps>;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
export interface SvelteComponent<TProps> {
|
|
770
|
-
/**
|
|
771
|
-
* The name of the Svelte main module to render.
|
|
772
|
-
*/
|
|
773
|
-
Component: SvelteModule<TProps>;
|
|
774
|
-
/**
|
|
775
|
-
* Captures props for transport into the Svelte component.
|
|
776
|
-
*/
|
|
777
|
-
captured?: Record<string, any>;
|
|
778
|
-
/**
|
|
779
|
-
* The type of the Svelte component.
|
|
780
|
-
*/
|
|
781
|
-
type: "svelte";
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
export interface BlazorComponent {
|
|
785
|
-
/**
|
|
786
|
-
* The name of the Blazor module to render.
|
|
787
|
-
*/
|
|
788
|
-
moduleName: string;
|
|
789
|
-
/**
|
|
790
|
-
* The args to transport into activation function.
|
|
791
|
-
*/
|
|
792
|
-
args?: Record<string, any>;
|
|
793
|
-
/**
|
|
794
|
-
* An optional dependency that needs to load before
|
|
795
|
-
* the component can be properly displayed.
|
|
796
|
-
*/
|
|
797
|
-
dependency?(): Promise<void>;
|
|
798
|
-
/**
|
|
799
|
-
* The type of the Blazor component.
|
|
800
|
-
*/
|
|
801
|
-
type: "blazor";
|
|
802
|
-
/**
|
|
803
|
-
* Additional options for the Blazor component.
|
|
804
|
-
*/
|
|
805
|
-
options?: BlazorOptions;
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Additional options for the Blazor component
|
|
810
|
-
*/
|
|
811
|
-
export interface BlazorOptions {
|
|
812
|
-
/**
|
|
813
|
-
* The root path where resources are located
|
|
814
|
-
*/
|
|
815
|
-
resourcePathRoot?: string;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
export interface SolidComponent<TProps> {
|
|
819
|
-
/**
|
|
820
|
-
* The component root.
|
|
821
|
-
*/
|
|
822
|
-
root: SolidJs.Component<TProps>;
|
|
823
|
-
/**
|
|
824
|
-
* The type of the Solid component.
|
|
825
|
-
*/
|
|
826
|
-
type: "solid";
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
export type TileComponentProps = BaseComponentProps & BareTileComponentProps;
|
|
830
|
-
|
|
831
|
-
export interface TilePreferences extends PiralCustomTilePreferences {
|
|
832
|
-
/**
|
|
833
|
-
* Sets the desired initial number of columns.
|
|
834
|
-
* This may be overridden either by the user (if resizable true), or by the dashboard.
|
|
835
|
-
*/
|
|
836
|
-
initialColumns?: number;
|
|
837
|
-
/**
|
|
838
|
-
* Sets the desired initial number of rows.
|
|
839
|
-
* This may be overridden either by the user (if resizable true), or by the dashboard.
|
|
840
|
-
*/
|
|
841
|
-
initialRows?: number;
|
|
842
|
-
/**
|
|
843
|
-
* Determines if the tile can be resized by the user.
|
|
844
|
-
* By default the size of the tile is fixed.
|
|
845
|
-
*/
|
|
846
|
-
resizable?: boolean;
|
|
847
|
-
/**
|
|
848
|
-
* Declares a set of custom properties to be used with user-specified values.
|
|
849
|
-
*/
|
|
850
|
-
customProperties?: Array<string>;
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Defines the potential targets when storing data.
|
|
855
|
-
*/
|
|
856
|
-
export type DataStoreTarget = "memory" | "local" | "remote";
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* Defines the custom options for storing data.
|
|
860
|
-
*/
|
|
861
|
-
export interface CustomDataStoreOptions {
|
|
862
|
-
/**
|
|
863
|
-
* The target data store. By default the data is only stored in memory.
|
|
864
|
-
*/
|
|
865
|
-
target?: DataStoreTarget;
|
|
866
|
-
/**
|
|
867
|
-
* Optionally determines when the data expires.
|
|
868
|
-
*/
|
|
869
|
-
expires?: "never" | Date | number;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
export type FirstParametersOf<T> = {
|
|
873
|
-
[K in keyof T]: T[K] extends (arg: any) => any ? FirstParameter<T[K]> : never;
|
|
874
|
-
}[keyof T];
|
|
875
|
-
|
|
876
|
-
/**
|
|
877
|
-
* Mapping of available component converters.
|
|
878
|
-
*/
|
|
879
|
-
export interface ComponentConverters<TProps> extends PiralCustomComponentConverters<TProps> {
|
|
880
|
-
/**
|
|
881
|
-
* Converts the HTML component to a framework-independent component.
|
|
882
|
-
* @param component The vanilla JavaScript component to be converted.
|
|
883
|
-
*/
|
|
884
|
-
html(component: HtmlComponent<TProps>): ForeignComponent<TProps>;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
/**
|
|
888
|
-
* The props that every registered page component obtains.
|
|
889
|
-
*/
|
|
890
|
-
export interface RouteBaseProps<UrlParams = any, UrlState = any> extends ReactRouter.RouteComponentProps<UrlParams, {}, UrlState>, BaseComponentProps {}
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* Custom meta data to include for pages.
|
|
894
|
-
*/
|
|
895
|
-
export interface PiralCustomPageMeta {}
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* The props of an extension component.
|
|
899
|
-
*/
|
|
900
|
-
export interface ExtensionComponentProps<T> extends BaseComponentProps {
|
|
901
|
-
/**
|
|
902
|
-
* The provided parameters for showing the extension.
|
|
903
|
-
*/
|
|
904
|
-
params: T extends keyof PiralExtensionSlotMap ? PiralExtensionSlotMap[T] : T extends string ? any : T;
|
|
905
|
-
/**
|
|
906
|
-
* The optional children to receive, if any.
|
|
907
|
-
*/
|
|
908
|
-
children?: React.ReactNode;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
/**
|
|
912
|
-
* The mapping of the existing (known) extension slots.
|
|
913
|
-
*/
|
|
914
|
-
export interface PiralExtensionSlotMap extends PiralCustomExtensionSlotMap {}
|
|
915
|
-
|
|
916
|
-
/**
|
|
917
|
-
* The basic props for defining an extension slot.
|
|
918
|
-
*/
|
|
919
|
-
export interface BaseExtensionSlotProps<TName, TParams> {
|
|
920
|
-
/**
|
|
921
|
-
* The children to transport, if any.
|
|
922
|
-
*/
|
|
923
|
-
children?: React.ReactNode;
|
|
924
|
-
/**
|
|
925
|
-
* Defines what should be rendered when no components are available
|
|
926
|
-
* for the specified extension.
|
|
927
|
-
*/
|
|
928
|
-
empty?(): React.ReactNode;
|
|
929
|
-
/**
|
|
930
|
-
* Determines if the `render` function should be called in case no
|
|
931
|
-
* components are available for the specified extension.
|
|
932
|
-
*
|
|
933
|
-
* If true, `empty` will be called and returned from the slot.
|
|
934
|
-
* If false, `render` will be called with the result of calling `empty`.
|
|
935
|
-
* The result of calling `render` will then be returned from the slot.
|
|
936
|
-
*/
|
|
937
|
-
emptySkipsRender?: boolean;
|
|
938
|
-
/**
|
|
939
|
-
* Defines the order of the components to render.
|
|
940
|
-
* May be more convient than using `render` w.r.t. ordering extensions
|
|
941
|
-
* by their supplied metadata.
|
|
942
|
-
* @param extensions The registered extensions.
|
|
943
|
-
* @returns The ordered extensions.
|
|
944
|
-
*/
|
|
945
|
-
order?(extensions: Array<ExtensionRegistration>): Array<ExtensionRegistration>;
|
|
946
|
-
/**
|
|
947
|
-
* Defines how the provided nodes should be rendered.
|
|
948
|
-
* @param nodes The rendered extension nodes.
|
|
949
|
-
* @returns The rendered nodes, i.e., an ReactElement.
|
|
950
|
-
*/
|
|
951
|
-
render?(nodes: Array<React.ReactNode>): React.ReactElement<any, any> | null;
|
|
952
|
-
/**
|
|
953
|
-
* The custom parameters for the given extension.
|
|
954
|
-
*/
|
|
955
|
-
params?: TParams;
|
|
956
|
-
/**
|
|
957
|
-
* The name of the extension to render.
|
|
958
|
-
*/
|
|
959
|
-
name: TName;
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
/**
|
|
963
|
-
* Options passed through to Angular `bootstrapModule`.
|
|
830
|
+
export interface TilePreferences extends PiralCustomTilePreferences {
|
|
831
|
+
/**
|
|
832
|
+
* Sets the desired initial number of columns.
|
|
833
|
+
* This may be overridden either by the user (if resizable true), or by the dashboard.
|
|
834
|
+
*/
|
|
835
|
+
initialColumns?: number;
|
|
836
|
+
/**
|
|
837
|
+
* Sets the desired initial number of rows.
|
|
838
|
+
* This may be overridden either by the user (if resizable true), or by the dashboard.
|
|
839
|
+
*/
|
|
840
|
+
initialRows?: number;
|
|
841
|
+
/**
|
|
842
|
+
* Determines if the tile can be resized by the user.
|
|
843
|
+
* By default the size of the tile is fixed.
|
|
844
|
+
*/
|
|
845
|
+
resizable?: boolean;
|
|
846
|
+
/**
|
|
847
|
+
* Declares a set of custom properties to be used with user-specified values.
|
|
848
|
+
*/
|
|
849
|
+
customProperties?: Array<string>;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Defines the potential targets when storing data.
|
|
854
|
+
*/
|
|
855
|
+
export type DataStoreTarget = "memory" | "local" | "remote";
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Defines the custom options for storing data.
|
|
859
|
+
*/
|
|
860
|
+
export interface CustomDataStoreOptions {
|
|
861
|
+
/**
|
|
862
|
+
* The target data store. By default the data is only stored in memory.
|
|
863
|
+
*/
|
|
864
|
+
target?: DataStoreTarget;
|
|
865
|
+
/**
|
|
866
|
+
* Optionally determines when the data expires.
|
|
867
|
+
*/
|
|
868
|
+
expires?: "never" | Date | number;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
export type FirstParametersOf<T> = {
|
|
872
|
+
[K in keyof T]: T[K] extends (arg: any) => any ? FirstParameter<T[K]> : never;
|
|
873
|
+
}[keyof T];
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Mapping of available component converters.
|
|
877
|
+
*/
|
|
878
|
+
export interface ComponentConverters<TProps> extends PiralCustomComponentConverters<TProps> {
|
|
879
|
+
/**
|
|
880
|
+
* Converts the HTML component to a framework-independent component.
|
|
881
|
+
* @param component The vanilla JavaScript component to be converted.
|
|
882
|
+
*/
|
|
883
|
+
html(component: HtmlComponent<TProps>): ForeignComponent<TProps>;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* The props that every registered page component obtains.
|
|
888
|
+
*/
|
|
889
|
+
export interface RouteBaseProps<UrlParams = any, UrlState = any> extends ReactRouter.RouteComponentProps<UrlParams, {}, UrlState>, BaseComponentProps {}
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Custom meta data to include for pages.
|
|
893
|
+
*/
|
|
894
|
+
export interface PiralCustomPageMeta {}
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* The props of an extension component.
|
|
898
|
+
*/
|
|
899
|
+
export interface ExtensionComponentProps<T> extends BaseComponentProps {
|
|
900
|
+
/**
|
|
901
|
+
* The provided parameters for showing the extension.
|
|
902
|
+
*/
|
|
903
|
+
params: T extends keyof PiralExtensionSlotMap ? PiralExtensionSlotMap[T] : T extends string ? any : T;
|
|
904
|
+
/**
|
|
905
|
+
* The optional children to receive, if any.
|
|
906
|
+
*/
|
|
907
|
+
children?: React.ReactNode;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* The mapping of the existing (known) extension slots.
|
|
912
|
+
*/
|
|
913
|
+
export interface PiralExtensionSlotMap extends PiralCustomExtensionSlotMap {}
|
|
914
|
+
|
|
915
|
+
/**
|
|
916
|
+
* The basic props for defining an extension slot.
|
|
917
|
+
*/
|
|
918
|
+
export interface BaseExtensionSlotProps<TName, TParams> {
|
|
919
|
+
/**
|
|
920
|
+
* The children to transport, if any.
|
|
921
|
+
*/
|
|
922
|
+
children?: React.ReactNode;
|
|
923
|
+
/**
|
|
924
|
+
* Defines what should be rendered when no components are available
|
|
925
|
+
* for the specified extension.
|
|
926
|
+
*/
|
|
927
|
+
empty?(): React.ReactNode;
|
|
928
|
+
/**
|
|
929
|
+
* Determines if the `render` function should be called in case no
|
|
930
|
+
* components are available for the specified extension.
|
|
964
931
|
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
/**
|
|
971
|
-
*
|
|
972
|
-
*
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
932
|
+
* If true, `empty` will be called and returned from the slot.
|
|
933
|
+
* If false, `render` will be called with the result of calling `empty`.
|
|
934
|
+
* The result of calling `render` will then be returned from the slot.
|
|
935
|
+
*/
|
|
936
|
+
emptySkipsRender?: boolean;
|
|
937
|
+
/**
|
|
938
|
+
* Defines the order of the components to render.
|
|
939
|
+
* May be more convient than using `render` w.r.t. ordering extensions
|
|
940
|
+
* by their supplied metadata.
|
|
941
|
+
* @param extensions The registered extensions.
|
|
942
|
+
* @returns The ordered extensions.
|
|
943
|
+
*/
|
|
944
|
+
order?(extensions: Array<ExtensionRegistration>): Array<ExtensionRegistration>;
|
|
945
|
+
/**
|
|
946
|
+
* Defines how the provided nodes should be rendered.
|
|
947
|
+
* @param nodes The rendered extension nodes.
|
|
948
|
+
* @returns The rendered nodes, i.e., an ReactElement.
|
|
949
|
+
*/
|
|
950
|
+
render?(nodes: Array<React.ReactNode>): React.ReactElement<any, any> | null;
|
|
951
|
+
/**
|
|
952
|
+
* The custom parameters for the given extension.
|
|
953
|
+
*/
|
|
954
|
+
params?: TParams;
|
|
955
|
+
/**
|
|
956
|
+
* The name of the extension to render.
|
|
957
|
+
*/
|
|
958
|
+
name: TName;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* Options passed through to Angular `bootstrapModule`.
|
|
963
|
+
*
|
|
964
|
+
* Mainly to specify Noop Zone, but also includes compiler specific settings.
|
|
965
|
+
* See https://angular.io/api/core/PlatformRef#bootstrapModule for possible values.
|
|
966
|
+
*/
|
|
967
|
+
export type NgOptions = Parameters<AngularCore.PlatformRef["bootstrapModule"]>[1];
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* The VDOM representation of an Element.
|
|
971
|
+
* @memberOf [VDOM]
|
|
972
|
+
*/
|
|
973
|
+
export interface VNode<Attributes = {}> {
|
|
974
|
+
nodeName: string;
|
|
975
|
+
attributes?: Attributes;
|
|
976
|
+
children: Array<VNode | string>;
|
|
977
|
+
key: string | number | null;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* The view function describes the application UI as a tree of VNodes.
|
|
982
|
+
* @returns A VNode tree.
|
|
983
|
+
* @memberOf [App]
|
|
984
|
+
*/
|
|
985
|
+
export interface View<State, Actions> {
|
|
986
|
+
(state: State, actions: Actions): VNode<object> | null;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export interface ComponentProps<TProps> {
|
|
990
|
+
attrs: TProps;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
export interface SvelteOptions<TProps> {
|
|
994
|
+
target: Element;
|
|
995
|
+
props: TProps;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
export type SvelteComponentInstance<TProps> = TProps & {
|
|
999
|
+
$destroy(): void;
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
export interface BareTileComponentProps {
|
|
1003
|
+
/**
|
|
1004
|
+
* The currently used number of columns.
|
|
1005
|
+
*/
|
|
1006
|
+
columns: number;
|
|
1007
|
+
/**
|
|
1008
|
+
* The currently used number of rows.
|
|
1009
|
+
*/
|
|
1010
|
+
rows: number;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
export interface PiralCustomTilePreferences {}
|
|
1014
|
+
|
|
1015
|
+
export type FirstParameter<T extends (arg: any) => any> = T extends (arg: infer P) => any ? P : never;
|
|
1016
|
+
|
|
1017
|
+
/**
|
|
1018
|
+
* Custom component converters defined outside of piral-core.
|
|
1019
|
+
*/
|
|
1020
|
+
export interface PiralCustomComponentConverters<TProps> {
|
|
1021
|
+
vue(component: VueComponent<TProps>): ForeignComponent<TProps>;
|
|
1022
|
+
ng(component: NgComponent): ForeignComponent<TProps>;
|
|
1023
|
+
ngjs(component: NgjsComponent): ForeignComponent<TProps>;
|
|
1024
|
+
hyperapp(component: HyperappComponent<TProps>): ForeignComponent<TProps>;
|
|
1025
|
+
inferno(component: InfernoComponent<TProps>): ForeignComponent<TProps>;
|
|
1026
|
+
preact(component: PreactComponent<TProps>): ForeignComponent<TProps>;
|
|
1027
|
+
litel(component: LitElComponent): ForeignComponent<TProps>;
|
|
1028
|
+
mithril(component: MithrilComponent<TProps>): ForeignComponent<TProps>;
|
|
1029
|
+
aurelia(component: AureliaComponent<TProps>): ForeignComponent<TProps>;
|
|
1030
|
+
riot(component: RiotComponent<TProps>): ForeignComponent<TProps>;
|
|
1031
|
+
elm(component: ElmComponent<TProps>): ForeignComponent<TProps>;
|
|
1032
|
+
svelte(component: SvelteComponent<TProps>): ForeignComponent<TProps>;
|
|
1033
|
+
blazor(component: BlazorComponent): ForeignComponent<TProps>;
|
|
1034
|
+
solid(component: SolidComponent<TProps>): ForeignComponent<TProps>;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* Definition of a vanilla JavaScript component.
|
|
1039
|
+
*/
|
|
1040
|
+
export interface HtmlComponent<TProps> {
|
|
1041
|
+
/**
|
|
1042
|
+
* Renders a component into the provided element using the given props and context.
|
|
1043
|
+
*/
|
|
1044
|
+
component: ForeignComponent<TProps>;
|
|
1045
|
+
/**
|
|
1046
|
+
* The type of the HTML component.
|
|
1047
|
+
*/
|
|
1048
|
+
type: "html";
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
/**
|
|
1052
|
+
* Generic definition of a framework-independent component.
|
|
1053
|
+
*/
|
|
1054
|
+
export interface ForeignComponent<TProps> {
|
|
1055
|
+
/**
|
|
1056
|
+
* Called when the component is mounted.
|
|
1057
|
+
* @param element The container hosting the element.
|
|
1058
|
+
* @param props The props to transport.
|
|
1059
|
+
* @param ctx The associated context.
|
|
1060
|
+
* @param locals The local state of this component instance.
|
|
1061
|
+
*/
|
|
1062
|
+
mount(element: HTMLElement, props: TProps, ctx: ComponentContext, locals: Record<string, any>): void;
|
|
1063
|
+
/**
|
|
1064
|
+
* Called when the component should be updated.
|
|
1065
|
+
* @param element The container hosting the element.
|
|
1066
|
+
* @param props The props to transport.
|
|
1067
|
+
* @param ctx The associated context.
|
|
1068
|
+
* @param locals The local state of this component instance.
|
|
1069
|
+
*/
|
|
1070
|
+
update?(element: HTMLElement, props: TProps, ctx: ComponentContext, locals: Record<string, any>): void;
|
|
1071
|
+
/**
|
|
1072
|
+
* Called when a component is unmounted.
|
|
1073
|
+
* @param element The container that was hosting the element.
|
|
1074
|
+
* @param locals The local state of this component instance.
|
|
1075
|
+
*/
|
|
1076
|
+
unmount?(element: HTMLElement, locals: Record<string, any>): void;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
/**
|
|
1080
|
+
* Custom extension slots outside of piral-core.
|
|
1081
|
+
*/
|
|
1082
|
+
export interface PiralCustomExtensionSlotMap {}
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* The interface modeling the registration of a pilet extension component.
|
|
1086
|
+
*/
|
|
1087
|
+
export interface ExtensionRegistration extends BaseRegistration {
|
|
1088
|
+
/**
|
|
1089
|
+
* The wrapped registered extension component.
|
|
1090
|
+
*/
|
|
1091
|
+
component: WrappedComponent<ExtensionComponentProps<string>>;
|
|
1092
|
+
/**
|
|
1093
|
+
* The original extension component that has been registered.
|
|
1094
|
+
*/
|
|
1095
|
+
reference: any;
|
|
1096
|
+
/**
|
|
1097
|
+
* The default params (i.e., meta) of the extension.
|
|
1098
|
+
*/
|
|
1099
|
+
defaults: any;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
/**
|
|
1103
|
+
* The context to be transported into the generic components.
|
|
1104
|
+
*/
|
|
1105
|
+
export interface ComponentContext {
|
|
1106
|
+
navigation: NavigationApi;
|
|
1107
|
+
publicPath: string;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* The base type for pilet component registration in the global state context.
|
|
1112
|
+
*/
|
|
1113
|
+
export interface BaseRegistration {
|
|
1114
|
+
/**
|
|
1115
|
+
* The pilet registering the component.
|
|
1116
|
+
*/
|
|
1117
|
+
pilet: string;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
export type WrappedComponent<TProps> = React.ComponentType<React.PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
|
|
1121
|
+
|
|
1122
|
+
export interface NavigationApi {
|
|
1123
|
+
/**
|
|
1124
|
+
* Pushes a new location onto the history stack.
|
|
1125
|
+
*/
|
|
1126
|
+
push(target: string, state?: any): void;
|
|
1127
|
+
/**
|
|
1128
|
+
* Replaces the current location with another.
|
|
1129
|
+
*/
|
|
1130
|
+
replace(target: string, state?: any): void;
|
|
1131
|
+
/**
|
|
1132
|
+
* Changes the current index in the history stack by a given delta.
|
|
1133
|
+
*/
|
|
1134
|
+
go(n: number): void;
|
|
1135
|
+
/**
|
|
1136
|
+
* Prevents changes to the history stack from happening.
|
|
1137
|
+
* This is useful when you want to prevent the user navigating
|
|
1138
|
+
* away from the current page, for example when they have some
|
|
1139
|
+
* unsaved data on the current page.
|
|
1140
|
+
* @param blocker The function being called with a transition request.
|
|
1141
|
+
* @returns The disposable for stopping the block.
|
|
1142
|
+
*/
|
|
1143
|
+
block(blocker: NavigationBlocker): Disposable;
|
|
1144
|
+
/**
|
|
1145
|
+
* Starts listening for location changes and calls the given
|
|
1146
|
+
* callback with an Update when it does.
|
|
1147
|
+
* @param listener The function being called when the route changes.
|
|
1148
|
+
* @returns The disposable for stopping the block.
|
|
1149
|
+
*/
|
|
1150
|
+
listen(listener: NavigationListener): Disposable;
|
|
1151
|
+
/**
|
|
1152
|
+
* Gets the current path.
|
|
1153
|
+
*/
|
|
1154
|
+
path: string;
|
|
1155
|
+
/**
|
|
1156
|
+
* The original router behind the navigation.
|
|
1157
|
+
*/
|
|
1158
|
+
router: any;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
export type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
1162
|
+
|
|
1163
|
+
export interface NavigationBlocker {
|
|
1164
|
+
(tx: NavigationTransition): void;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
export interface NavigationListener {
|
|
1168
|
+
(update: NavigationUpdate): void;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
export interface NavigationTransition extends NavigationUpdate {
|
|
1172
|
+
retry(): void;
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
export interface NavigationUpdate {
|
|
1176
|
+
action: NavigationAction;
|
|
1177
|
+
location: NavigationLocation;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
export type NavigationAction = "POP" | "PUSH" | "REPLACE";
|
|
1181
|
+
|
|
1182
|
+
export interface NavigationLocation {
|
|
1183
|
+
/**
|
|
1184
|
+
* The fully qualified URL incl. the origin and base path.
|
|
1185
|
+
*/
|
|
1186
|
+
href: string;
|
|
1187
|
+
/**
|
|
1188
|
+
* The location.pathname property is a string that contains an initial "/"
|
|
1189
|
+
* followed by the remainder of the URL up to the ?.
|
|
1190
|
+
*/
|
|
1191
|
+
pathname: string;
|
|
1192
|
+
/**
|
|
1193
|
+
* The location.search property is a string that contains an initial "?"
|
|
1194
|
+
* followed by the key=value pairs in the query string. If there are no
|
|
1195
|
+
* parameters, this value may be the empty string (i.e. '').
|
|
1196
|
+
*/
|
|
1197
|
+
search: string;
|
|
1198
|
+
/**
|
|
1199
|
+
* The location.hash property is a string that contains an initial "#"
|
|
1200
|
+
* followed by fragment identifier of the URL. If there is no fragment
|
|
1201
|
+
* identifier, this value may be the empty string (i.e. '').
|
|
1202
|
+
*/
|
|
1203
|
+
hash: string;
|
|
1204
|
+
/**
|
|
1205
|
+
* The location.state property is a user-supplied State object that is
|
|
1206
|
+
* associated with this location. This can be a useful place to store
|
|
1207
|
+
* any information you do not want to put in the URL, e.g. session-specific
|
|
1208
|
+
* data.
|
|
1209
|
+
*/
|
|
1210
|
+
state: unknown;
|
|
1211
|
+
/**
|
|
1212
|
+
* The location.key property is a unique string associated with this location.
|
|
1213
|
+
* On the initial location, this will be the string default. On all subsequent
|
|
1214
|
+
* locations, this string will be a unique identifier.
|
|
1215
|
+
*/
|
|
1216
|
+
key: string;
|
|
1215
1217
|
}
|