sample-cross-fx 0.14.29 → 0.15.0-beta.4466
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.d.ts +99 -945
- package/app/{index.4ccada.js → index.d12956.js} +108436 -103056
- package/app/{index.4ccada.js.map → index.d12956.js.map} +1 -1
- 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 +35 -97
package/app/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import * as Riot from 'riot';
|
|
|
7
7
|
import * as SolidJs from 'solid-js';
|
|
8
8
|
import * as ReactRouter from 'react-router';
|
|
9
9
|
import * as AngularCore from '@angular/core';
|
|
10
|
-
import * as LibreAtom from '@libre/atom';
|
|
11
10
|
|
|
12
11
|
declare module "sample-cross-fx" {
|
|
13
12
|
/**
|
|
@@ -113,9 +112,47 @@ declare module "sample-cross-fx" {
|
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
|
-
* Describes the metadata
|
|
115
|
+
* Describes the metadata of a pilet available in its API.
|
|
117
116
|
*/
|
|
118
|
-
export
|
|
117
|
+
export interface PiletMetadata {
|
|
118
|
+
/**
|
|
119
|
+
* The name of the pilet, i.e., the package id.
|
|
120
|
+
*/
|
|
121
|
+
name: string;
|
|
122
|
+
/**
|
|
123
|
+
* The version of the pilet. Should be semantically versioned.
|
|
124
|
+
*/
|
|
125
|
+
version: string;
|
|
126
|
+
/**
|
|
127
|
+
* Provides the version of the specification for this pilet.
|
|
128
|
+
*/
|
|
129
|
+
spec: string;
|
|
130
|
+
/**
|
|
131
|
+
* Provides some custom metadata for the pilet.
|
|
132
|
+
*/
|
|
133
|
+
custom?: any;
|
|
134
|
+
/**
|
|
135
|
+
* Optionally indicates the global require reference, if any.
|
|
136
|
+
*/
|
|
137
|
+
requireRef?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Additional shared dependencies from the pilet.
|
|
140
|
+
*/
|
|
141
|
+
dependencies: Record<string, string>;
|
|
142
|
+
/**
|
|
143
|
+
* Provides some configuration to be used in the pilet.
|
|
144
|
+
*/
|
|
145
|
+
config: Record<string, any>;
|
|
146
|
+
/**
|
|
147
|
+
* The URL of the main script of the pilet.
|
|
148
|
+
*/
|
|
149
|
+
link: string;
|
|
150
|
+
/**
|
|
151
|
+
* The base path to the pilet. Can be used to make resource requests
|
|
152
|
+
* and override the public path.
|
|
153
|
+
*/
|
|
154
|
+
basePath: string;
|
|
155
|
+
}
|
|
119
156
|
|
|
120
157
|
/**
|
|
121
158
|
* Listener for Piral app shell events.
|
|
@@ -458,7 +495,7 @@ declare module "sample-cross-fx" {
|
|
|
458
495
|
/**
|
|
459
496
|
* The meta data registered for a page.
|
|
460
497
|
*/
|
|
461
|
-
export interface PiralPageMeta extends PiralCustomPageMeta {}
|
|
498
|
+
export interface PiralPageMeta extends PiralCustomPageMeta, PiralCustomPageMeta {}
|
|
462
499
|
|
|
463
500
|
/**
|
|
464
501
|
* The shape of an implicit unregister function.
|
|
@@ -489,23 +526,6 @@ declare module "sample-cross-fx" {
|
|
|
489
526
|
(): void;
|
|
490
527
|
}
|
|
491
528
|
|
|
492
|
-
/**
|
|
493
|
-
* The metadata response for a single pilet.
|
|
494
|
-
*/
|
|
495
|
-
export type SinglePiletMetadata = PiletMetadataV0 | PiletMetadataV1 | PiletMetadataV2 | PiletMetadataVx;
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* The metadata response for a multi pilet.
|
|
499
|
-
*/
|
|
500
|
-
export type MultiPiletMetadata = PiletMetadataBundle;
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Additional metadata that may be added to the runtime information.
|
|
504
|
-
*/
|
|
505
|
-
export interface PiletRuntimeMetadata {
|
|
506
|
-
basePath?: string;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
529
|
/**
|
|
510
530
|
* Custom events defined outside of piral-core.
|
|
511
531
|
*/
|
|
@@ -939,158 +959,6 @@ declare module "sample-cross-fx" {
|
|
|
939
959
|
name: TName;
|
|
940
960
|
}
|
|
941
961
|
|
|
942
|
-
/**
|
|
943
|
-
* Metadata for pilets using the v0 schema.
|
|
944
|
-
*/
|
|
945
|
-
export type PiletMetadataV0 = PiletMetadataV0Content | PiletMetadataV0Link;
|
|
946
|
-
|
|
947
|
-
/**
|
|
948
|
-
* Metadata for pilets using the v1 schema.
|
|
949
|
-
*/
|
|
950
|
-
export interface PiletMetadataV1 {
|
|
951
|
-
/**
|
|
952
|
-
* The name of the pilet, i.e., the package id.
|
|
953
|
-
*/
|
|
954
|
-
name: string;
|
|
955
|
-
/**
|
|
956
|
-
* The version of the pilet. Should be semantically versioned.
|
|
957
|
-
*/
|
|
958
|
-
version: string;
|
|
959
|
-
/**
|
|
960
|
-
* Optionally provides the version of the specification for this pilet.
|
|
961
|
-
*/
|
|
962
|
-
spec?: "v1";
|
|
963
|
-
/**
|
|
964
|
-
* The link for retrieving the content of the pilet.
|
|
965
|
-
*/
|
|
966
|
-
link: string;
|
|
967
|
-
/**
|
|
968
|
-
* The reference name for the global require.
|
|
969
|
-
*/
|
|
970
|
-
requireRef: string;
|
|
971
|
-
/**
|
|
972
|
-
* The computed integrity of the pilet. Will be used to set the
|
|
973
|
-
* integrity value of the script.
|
|
974
|
-
*/
|
|
975
|
-
integrity?: string;
|
|
976
|
-
/**
|
|
977
|
-
* Optionally provides some custom metadata for the pilet.
|
|
978
|
-
*/
|
|
979
|
-
custom?: any;
|
|
980
|
-
/**
|
|
981
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
982
|
-
*/
|
|
983
|
-
config?: Record<string, any>;
|
|
984
|
-
/**
|
|
985
|
-
* Additional shared dependency script files.
|
|
986
|
-
*/
|
|
987
|
-
dependencies?: Record<string, string>;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
/**
|
|
991
|
-
* Metadata for pilets using the v2 schema.
|
|
992
|
-
*/
|
|
993
|
-
export interface PiletMetadataV2 {
|
|
994
|
-
/**
|
|
995
|
-
* The name of the pilet, i.e., the package id.
|
|
996
|
-
*/
|
|
997
|
-
name: string;
|
|
998
|
-
/**
|
|
999
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1000
|
-
*/
|
|
1001
|
-
version: string;
|
|
1002
|
-
/**
|
|
1003
|
-
* Provides the version of the specification for this pilet.
|
|
1004
|
-
*/
|
|
1005
|
-
spec: "v2";
|
|
1006
|
-
/**
|
|
1007
|
-
* The reference name for the global require.
|
|
1008
|
-
*/
|
|
1009
|
-
requireRef: string;
|
|
1010
|
-
/**
|
|
1011
|
-
* The computed integrity of the pilet.
|
|
1012
|
-
*/
|
|
1013
|
-
integrity?: string;
|
|
1014
|
-
/**
|
|
1015
|
-
* The link for retrieving the content of the pilet.
|
|
1016
|
-
*/
|
|
1017
|
-
link: string;
|
|
1018
|
-
/**
|
|
1019
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1020
|
-
*/
|
|
1021
|
-
custom?: any;
|
|
1022
|
-
/**
|
|
1023
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
1024
|
-
*/
|
|
1025
|
-
config?: Record<string, any>;
|
|
1026
|
-
/**
|
|
1027
|
-
* Additional shared dependency script files.
|
|
1028
|
-
*/
|
|
1029
|
-
dependencies?: Record<string, string>;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
export interface PiletMetadataVx {
|
|
1033
|
-
/**
|
|
1034
|
-
* The name of the pilet, i.e., the package id.
|
|
1035
|
-
*/
|
|
1036
|
-
name: string;
|
|
1037
|
-
/**
|
|
1038
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1039
|
-
*/
|
|
1040
|
-
version: string;
|
|
1041
|
-
/**
|
|
1042
|
-
* Provides an identifier for the custom specification.
|
|
1043
|
-
*/
|
|
1044
|
-
spec: string;
|
|
1045
|
-
/**
|
|
1046
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1047
|
-
*/
|
|
1048
|
-
custom?: any;
|
|
1049
|
-
/**
|
|
1050
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
1051
|
-
*/
|
|
1052
|
-
config?: Record<string, any>;
|
|
1053
|
-
/**
|
|
1054
|
-
* Additional shared dependency script files.
|
|
1055
|
-
*/
|
|
1056
|
-
dependencies?: Record<string, string>;
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
/**
|
|
1060
|
-
* Metadata for pilets using the bundle schema.
|
|
1061
|
-
*/
|
|
1062
|
-
export interface PiletMetadataBundle {
|
|
1063
|
-
/**
|
|
1064
|
-
* The name of the bundle pilet, i.e., the package id.
|
|
1065
|
-
*/
|
|
1066
|
-
name?: string;
|
|
1067
|
-
/**
|
|
1068
|
-
* Optionally provides the version of the specification for this pilet.
|
|
1069
|
-
*/
|
|
1070
|
-
spec?: "v1";
|
|
1071
|
-
/**
|
|
1072
|
-
* The link for retrieving the bundle content of the pilet.
|
|
1073
|
-
*/
|
|
1074
|
-
link: string;
|
|
1075
|
-
/**
|
|
1076
|
-
* The reference name for the global bundle-shared require.
|
|
1077
|
-
*/
|
|
1078
|
-
bundle: string;
|
|
1079
|
-
/**
|
|
1080
|
-
* The computed integrity of the pilet. Will be used to set the
|
|
1081
|
-
* integrity value of the script.
|
|
1082
|
-
*/
|
|
1083
|
-
integrity?: string;
|
|
1084
|
-
/**
|
|
1085
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1086
|
-
*/
|
|
1087
|
-
custom?: any;
|
|
1088
|
-
/**
|
|
1089
|
-
* Additional shared dependency script files.
|
|
1090
|
-
*/
|
|
1091
|
-
dependencies?: Record<string, string>;
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
962
|
/**
|
|
1095
963
|
* Options passed through to Angular `bootstrapModule`.
|
|
1096
964
|
*
|
|
@@ -1232,41 +1100,12 @@ declare module "sample-cross-fx" {
|
|
|
1232
1100
|
defaults: any;
|
|
1233
1101
|
}
|
|
1234
1102
|
|
|
1235
|
-
/**
|
|
1236
|
-
* Metadata for pilets using the v0 schema with a content.
|
|
1237
|
-
*/
|
|
1238
|
-
export interface PiletMetadataV0Content extends PiletMetadataV0Base {
|
|
1239
|
-
/**
|
|
1240
|
-
* The content of the pilet. If the content is not available
|
|
1241
|
-
* the link will be used (unless caching has been activated).
|
|
1242
|
-
*/
|
|
1243
|
-
content: string;
|
|
1244
|
-
/**
|
|
1245
|
-
* If available indicates that the pilet should not be cached.
|
|
1246
|
-
* In case of a string this is interpreted as the expiration time
|
|
1247
|
-
* of the cache. In case of an accurate hash this should not be
|
|
1248
|
-
* required or set.
|
|
1249
|
-
*/
|
|
1250
|
-
noCache?: boolean | string;
|
|
1251
|
-
}
|
|
1252
|
-
|
|
1253
|
-
/**
|
|
1254
|
-
* Metadata for pilets using the v0 schema with a link.
|
|
1255
|
-
*/
|
|
1256
|
-
export interface PiletMetadataV0Link extends PiletMetadataV0Base {
|
|
1257
|
-
/**
|
|
1258
|
-
* The link for retrieving the content of the pilet.
|
|
1259
|
-
*/
|
|
1260
|
-
link: string;
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
1103
|
/**
|
|
1264
1104
|
* The context to be transported into the generic components.
|
|
1265
1105
|
*/
|
|
1266
1106
|
export interface ComponentContext {
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
readState: PiralActions["readState"];
|
|
1107
|
+
navigation: NavigationApi;
|
|
1108
|
+
publicPath: string;
|
|
1270
1109
|
}
|
|
1271
1110
|
|
|
1272
1111
|
/**
|
|
@@ -1279,779 +1118,94 @@ declare module "sample-cross-fx" {
|
|
|
1279
1118
|
pilet: string;
|
|
1280
1119
|
}
|
|
1281
1120
|
|
|
1282
|
-
export type WrappedComponent<TProps> = React.ComponentType<Without<TProps, keyof BaseComponentProps
|
|
1121
|
+
export type WrappedComponent<TProps> = React.ComponentType<React.PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
|
|
1283
1122
|
|
|
1284
|
-
|
|
1285
|
-
* Basic metadata for pilets using the v0 schema.
|
|
1286
|
-
*/
|
|
1287
|
-
export interface PiletMetadataV0Base {
|
|
1288
|
-
/**
|
|
1289
|
-
* The name of the pilet, i.e., the package id.
|
|
1290
|
-
*/
|
|
1291
|
-
name: string;
|
|
1292
|
-
/**
|
|
1293
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1294
|
-
*/
|
|
1295
|
-
version: string;
|
|
1123
|
+
export interface NavigationApi {
|
|
1296
1124
|
/**
|
|
1297
|
-
*
|
|
1125
|
+
* Pushes a new location onto the history stack.
|
|
1298
1126
|
*/
|
|
1299
|
-
|
|
1127
|
+
push(target: string, state?: any): void;
|
|
1300
1128
|
/**
|
|
1301
|
-
*
|
|
1302
|
-
* accurate to allow caching.
|
|
1129
|
+
* Replaces the current location with another.
|
|
1303
1130
|
*/
|
|
1304
|
-
|
|
1131
|
+
replace(target: string, state?: any): void;
|
|
1305
1132
|
/**
|
|
1306
|
-
*
|
|
1133
|
+
* Changes the current index in the history stack by a given delta.
|
|
1307
1134
|
*/
|
|
1308
|
-
|
|
1135
|
+
go(n: number): void;
|
|
1309
1136
|
/**
|
|
1310
|
-
*
|
|
1137
|
+
* Prevents changes to the history stack from happening.
|
|
1138
|
+
* This is useful when you want to prevent the user navigating
|
|
1139
|
+
* away from the current page, for example when they have some
|
|
1140
|
+
* unsaved data on the current page.
|
|
1141
|
+
* @param blocker The function being called with a transition request.
|
|
1142
|
+
* @returns The disposable for stopping the block.
|
|
1311
1143
|
*/
|
|
1312
|
-
|
|
1144
|
+
block(blocker: NavigationBlocker): Disposable;
|
|
1313
1145
|
/**
|
|
1314
|
-
*
|
|
1146
|
+
* Starts listening for location changes and calls the given
|
|
1147
|
+
* callback with an Update when it does.
|
|
1148
|
+
* @param listener The function being called when the route changes.
|
|
1149
|
+
* @returns The disposable for stopping the block.
|
|
1315
1150
|
*/
|
|
1316
|
-
|
|
1151
|
+
listen(listener: NavigationListener): Disposable;
|
|
1317
1152
|
}
|
|
1318
1153
|
|
|
1319
|
-
|
|
1320
|
-
* The Piral global app state container.
|
|
1321
|
-
*/
|
|
1322
|
-
export interface GlobalState extends PiralCustomState {
|
|
1323
|
-
/**
|
|
1324
|
-
* The relevant state for the app itself.
|
|
1325
|
-
*/
|
|
1326
|
-
app: AppState;
|
|
1327
|
-
/**
|
|
1328
|
-
* The relevant state for rendering errors of the app.
|
|
1329
|
-
*/
|
|
1330
|
-
errorComponents: ErrorComponentsState;
|
|
1331
|
-
/**
|
|
1332
|
-
* The relevant state for rendering parts of the app.
|
|
1333
|
-
*/
|
|
1334
|
-
components: ComponentsState;
|
|
1335
|
-
/**
|
|
1336
|
-
* The relevant state for the registered components.
|
|
1337
|
-
*/
|
|
1338
|
-
registry: RegistryState;
|
|
1339
|
-
/**
|
|
1340
|
-
* Gets the loaded modules.
|
|
1341
|
-
*/
|
|
1342
|
-
modules: Array<PiletMetadata>;
|
|
1343
|
-
/**
|
|
1344
|
-
* The foreign component portals to render.
|
|
1345
|
-
*/
|
|
1346
|
-
portals: Record<string, Array<React.ReactPortal>>;
|
|
1347
|
-
/**
|
|
1348
|
-
* The application's shared data.
|
|
1349
|
-
*/
|
|
1350
|
-
data: Dict<SharedDataItem>;
|
|
1351
|
-
/**
|
|
1352
|
-
* The used (exact) application routes.
|
|
1353
|
-
*/
|
|
1354
|
-
routes: Dict<React.ComponentType<ReactRouter.RouteComponentProps<any>>>;
|
|
1355
|
-
/**
|
|
1356
|
-
* The current provider.
|
|
1357
|
-
*/
|
|
1358
|
-
provider?: React.ComponentType;
|
|
1359
|
-
}
|
|
1154
|
+
export type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
1360
1155
|
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
*/
|
|
1364
|
-
export interface PiralActions extends PiralCustomActions {
|
|
1365
|
-
/**
|
|
1366
|
-
* Initializes the application shell.
|
|
1367
|
-
* @param loading The current loading state.
|
|
1368
|
-
* @param error The application error, if any.
|
|
1369
|
-
* @param modules The loaded pilets.
|
|
1370
|
-
*/
|
|
1371
|
-
initialize(loading: boolean, error: Error | undefined, modules: Array<Pilet>): void;
|
|
1372
|
-
/**
|
|
1373
|
-
* Injects a pilet at runtime - removes the pilet from registry first if available.
|
|
1374
|
-
* @param pilet The pilet to be injected.
|
|
1375
|
-
*/
|
|
1376
|
-
injectPilet(pilet: Pilet): void;
|
|
1377
|
-
/**
|
|
1378
|
-
* Defines a single action for Piral.
|
|
1379
|
-
* @param actionName The name of the action to define.
|
|
1380
|
-
* @param action The action to include.
|
|
1381
|
-
*/
|
|
1382
|
-
defineAction<T extends keyof PiralActions>(actionName: T, action: PiralAction<PiralActions[T]>): void;
|
|
1383
|
-
/**
|
|
1384
|
-
* Defines a set of actions for Piral.
|
|
1385
|
-
* @param actions The actions to define.
|
|
1386
|
-
*/
|
|
1387
|
-
defineActions(actions: PiralDefineActions): void;
|
|
1388
|
-
/**
|
|
1389
|
-
* Reads the value of a shared data item.
|
|
1390
|
-
* @param name The name of the shared item.
|
|
1391
|
-
*/
|
|
1392
|
-
readDataValue(name: string): any;
|
|
1393
|
-
/**
|
|
1394
|
-
* Tries to write a shared data item. The write access is only
|
|
1395
|
-
* possible if the name belongs to the provided owner or has not
|
|
1396
|
-
* been taken yet.
|
|
1397
|
-
* Setting the value to null will release it.
|
|
1398
|
-
* @param name The name of the shared data item.
|
|
1399
|
-
* @param value The value of the shared data item.
|
|
1400
|
-
* @param owner The owner of the shared data item.
|
|
1401
|
-
* @param target The target storage locatation.
|
|
1402
|
-
* @param expiration The time for when to dispose the shared item.
|
|
1403
|
-
*/
|
|
1404
|
-
tryWriteDataItem(name: string, value: any, owner: string, target: DataStoreTarget, expiration: number): boolean;
|
|
1405
|
-
/**
|
|
1406
|
-
* Performs a layout change.
|
|
1407
|
-
* @param current The layout to take.
|
|
1408
|
-
*/
|
|
1409
|
-
changeLayout(current: LayoutType): void;
|
|
1410
|
-
/**
|
|
1411
|
-
* Registers a new route to be resolved.
|
|
1412
|
-
* @param route The route to register.
|
|
1413
|
-
* @param value The page to be rendered on the route.
|
|
1414
|
-
*/
|
|
1415
|
-
registerPage(route: string, value: PageRegistration): void;
|
|
1416
|
-
/**
|
|
1417
|
-
* Unregisters an existing route.
|
|
1418
|
-
* @param route The route to be removed.
|
|
1419
|
-
*/
|
|
1420
|
-
unregisterPage(route: string): void;
|
|
1421
|
-
/**
|
|
1422
|
-
* Registers a new extension.
|
|
1423
|
-
* @param name The name of the extension category.
|
|
1424
|
-
* @param value The extension registration.
|
|
1425
|
-
*/
|
|
1426
|
-
registerExtension(name: string, value: ExtensionRegistration): void;
|
|
1427
|
-
/**
|
|
1428
|
-
* Unregisters an existing extension.
|
|
1429
|
-
* @param name The name of the extension category.
|
|
1430
|
-
* @param value The extension that will be removed.
|
|
1431
|
-
*/
|
|
1432
|
-
unregisterExtension(name: string, reference: any): void;
|
|
1433
|
-
/**
|
|
1434
|
-
* Sets the common component to render.
|
|
1435
|
-
* @param name The name of the component.
|
|
1436
|
-
* @param component The component to use for rendering.
|
|
1437
|
-
*/
|
|
1438
|
-
setComponent<TKey extends keyof ComponentsState>(name: TKey, component: ComponentsState[TKey]): void;
|
|
1439
|
-
/**
|
|
1440
|
-
* Sets the error component to render.
|
|
1441
|
-
* @param type The type of the error.
|
|
1442
|
-
* @param component The component to use for rendering.
|
|
1443
|
-
*/
|
|
1444
|
-
setErrorComponent<TKey extends keyof ErrorComponentsState>(type: TKey, component: ErrorComponentsState[TKey]): void;
|
|
1445
|
-
/**
|
|
1446
|
-
* Sets the common routes to render.
|
|
1447
|
-
* @param path The name of the component.
|
|
1448
|
-
* @param component The component to use for rendering.
|
|
1449
|
-
*/
|
|
1450
|
-
setRoute<T = {}>(path: string, component: React.ComponentType<ReactRouter.RouteComponentProps<T>>): void;
|
|
1451
|
-
/**
|
|
1452
|
-
* Includes a new provider as a sub-provider to the current provider.
|
|
1453
|
-
* @param provider The provider to include.
|
|
1454
|
-
*/
|
|
1455
|
-
includeProvider(provider: JSX.Element): void;
|
|
1456
|
-
/**
|
|
1457
|
-
* Destroys (i.e., resets) the given portal instance.
|
|
1458
|
-
* @param id The id of the portal to destroy.
|
|
1459
|
-
*/
|
|
1460
|
-
destroyPortal(id: string): void;
|
|
1461
|
-
/**
|
|
1462
|
-
* Includes the provided portal in the rendering pipeline.
|
|
1463
|
-
* @param id The id of the portal to use.
|
|
1464
|
-
* @param entry The child to render.
|
|
1465
|
-
*/
|
|
1466
|
-
showPortal(id: string, entry: React.ReactPortal): void;
|
|
1467
|
-
/**
|
|
1468
|
-
* Hides the provided portal in the rendering pipeline.
|
|
1469
|
-
* @param id The id of the portal to use.
|
|
1470
|
-
* @param entry The child to remove.
|
|
1471
|
-
*/
|
|
1472
|
-
hidePortal(id: string, entry: React.ReactPortal): void;
|
|
1473
|
-
/**
|
|
1474
|
-
* Updates the provided portal in the rendering pipeline.
|
|
1475
|
-
* @param id The id of the portal to use.
|
|
1476
|
-
* @param current The currently displayed child.
|
|
1477
|
-
* @param next The updated child that should be displayed.
|
|
1478
|
-
*/
|
|
1479
|
-
updatePortal(id: string, current: React.ReactPortal, next: React.ReactPortal): void;
|
|
1480
|
-
/**
|
|
1481
|
-
* Dispatches a state change.
|
|
1482
|
-
* @param update The update function creating a new state.
|
|
1483
|
-
*/
|
|
1484
|
-
dispatch(update: (state: GlobalState) => GlobalState): void;
|
|
1485
|
-
/**
|
|
1486
|
-
* Reads the selected part of the global state.
|
|
1487
|
-
* @param select The selector for getting the desired part.
|
|
1488
|
-
* @returns The desired part.
|
|
1489
|
-
*/
|
|
1490
|
-
readState<S>(select: (state: GlobalState) => S): S;
|
|
1156
|
+
export interface NavigationBlocker {
|
|
1157
|
+
(tx: NavigationTransition): void;
|
|
1491
1158
|
}
|
|
1492
1159
|
|
|
1493
|
-
export
|
|
1160
|
+
export interface NavigationListener {
|
|
1161
|
+
(update: NavigationUpdate): void;
|
|
1162
|
+
}
|
|
1494
1163
|
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
export interface PiralCustomState {}
|
|
1164
|
+
export interface NavigationTransition extends NavigationUpdate {
|
|
1165
|
+
retry(): void;
|
|
1166
|
+
}
|
|
1499
1167
|
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
export interface AppState {
|
|
1504
|
-
/**
|
|
1505
|
-
* Information for the layout computation.
|
|
1506
|
-
*/
|
|
1507
|
-
layout: LayoutType;
|
|
1508
|
-
/**
|
|
1509
|
-
* Gets if the application is currently performing a background loading
|
|
1510
|
-
* activity, e.g., for loading modules asynchronously or fetching
|
|
1511
|
-
* translations.
|
|
1512
|
-
*/
|
|
1513
|
-
loading: boolean;
|
|
1514
|
-
/**
|
|
1515
|
-
* Gets an unrecoverable application error, if any.
|
|
1516
|
-
*/
|
|
1517
|
-
error: Error | undefined;
|
|
1518
|
-
/**
|
|
1519
|
-
* Gets the public path of the application.
|
|
1520
|
-
*/
|
|
1521
|
-
publicPath: string;
|
|
1168
|
+
export interface NavigationUpdate {
|
|
1169
|
+
action: NavigationAction;
|
|
1170
|
+
location: NavigationLocation;
|
|
1522
1171
|
}
|
|
1523
1172
|
|
|
1524
|
-
export type
|
|
1525
|
-
[P in keyof Errors]?: React.ComponentType<Errors[P]>;
|
|
1526
|
-
};
|
|
1173
|
+
export type NavigationAction = "POP" | "PUSH" | "REPLACE";
|
|
1527
1174
|
|
|
1528
|
-
|
|
1529
|
-
* The Piral global app sub-state container for shared components.
|
|
1530
|
-
*/
|
|
1531
|
-
export interface ComponentsState extends PiralCustomComponentsState {
|
|
1175
|
+
export interface NavigationLocation {
|
|
1532
1176
|
/**
|
|
1533
|
-
* The
|
|
1177
|
+
* The fully qualified URL incl. the origin and base path.
|
|
1534
1178
|
*/
|
|
1535
|
-
|
|
1179
|
+
href: string;
|
|
1536
1180
|
/**
|
|
1537
|
-
* The
|
|
1181
|
+
* The location.pathname property is a string that contains an initial "/"
|
|
1182
|
+
* followed by the remainder of the URL up to the ?.
|
|
1538
1183
|
*/
|
|
1539
|
-
|
|
1184
|
+
pathname: string;
|
|
1540
1185
|
/**
|
|
1541
|
-
* The
|
|
1186
|
+
* The location.search property is a string that contains an initial "?"
|
|
1187
|
+
* followed by the key=value pairs in the query string. If there are no
|
|
1188
|
+
* parameters, this value may be the empty string (i.e. '').
|
|
1542
1189
|
*/
|
|
1543
|
-
|
|
1190
|
+
search: string;
|
|
1544
1191
|
/**
|
|
1545
|
-
* The
|
|
1192
|
+
* The location.hash property is a string that contains an initial "#"
|
|
1193
|
+
* followed by fragment identifier of the URL. If there is no fragment
|
|
1194
|
+
* identifier, this value may be the empty string (i.e. '').
|
|
1546
1195
|
*/
|
|
1547
|
-
|
|
1196
|
+
hash: string;
|
|
1548
1197
|
/**
|
|
1549
|
-
* The
|
|
1198
|
+
* The location.state property is a user-supplied State object that is
|
|
1199
|
+
* associated with this location. This can be a useful place to store
|
|
1200
|
+
* any information you do not want to put in the URL, e.g. session-specific
|
|
1201
|
+
* data.
|
|
1550
1202
|
*/
|
|
1551
|
-
|
|
1203
|
+
state: unknown;
|
|
1552
1204
|
/**
|
|
1553
|
-
*
|
|
1205
|
+
* The location.key property is a unique string associated with this location.
|
|
1206
|
+
* On the initial location, this will be the string default. On all subsequent
|
|
1207
|
+
* locations, this string will be a unique identifier.
|
|
1554
1208
|
*/
|
|
1555
|
-
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
/**
|
|
1559
|
-
* The Piral global app sub-state container for component registrations.
|
|
1560
|
-
*/
|
|
1561
|
-
export interface RegistryState extends PiralCustomRegistryState {
|
|
1562
|
-
/**
|
|
1563
|
-
* The registered page components for the router.
|
|
1564
|
-
*/
|
|
1565
|
-
pages: Dict<PageRegistration>;
|
|
1566
|
-
/**
|
|
1567
|
-
* The registered extension components for extension slots.
|
|
1568
|
-
*/
|
|
1569
|
-
extensions: Dict<Array<ExtensionRegistration>>;
|
|
1570
|
-
/**
|
|
1571
|
-
* The registered wrappers for any component.
|
|
1572
|
-
*/
|
|
1573
|
-
wrappers: Dict<React.ComponentType<any>>;
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
export type Dict<T> = Record<string, T>;
|
|
1577
|
-
|
|
1578
|
-
/**
|
|
1579
|
-
* Defines the shape of a shared data item.
|
|
1580
|
-
*/
|
|
1581
|
-
export interface SharedDataItem<TValue = any> {
|
|
1582
|
-
/**
|
|
1583
|
-
* Gets the associated value.
|
|
1584
|
-
*/
|
|
1585
|
-
value: TValue;
|
|
1586
|
-
/**
|
|
1587
|
-
* Gets the owner of the item.
|
|
1588
|
-
*/
|
|
1589
|
-
owner: string;
|
|
1590
|
-
/**
|
|
1591
|
-
* Gets the storage location.
|
|
1592
|
-
*/
|
|
1593
|
-
target: DataStoreTarget;
|
|
1594
|
-
/**
|
|
1595
|
-
* Gets the expiration of the item.
|
|
1596
|
-
*/
|
|
1597
|
-
expires: number;
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
/**
|
|
1601
|
-
* Custom actions defined outside of piral-core.
|
|
1602
|
-
*/
|
|
1603
|
-
export interface PiralCustomActions {
|
|
1604
|
-
/**
|
|
1605
|
-
* Registers a new tile.
|
|
1606
|
-
* @param name The name of the tile.
|
|
1607
|
-
* @param value The tile registration.
|
|
1608
|
-
*/
|
|
1609
|
-
registerTile(name: string, value: TileRegistration): void;
|
|
1610
|
-
/**
|
|
1611
|
-
* Unregisters an existing tile.
|
|
1612
|
-
* @param name The name of the tile to be removed.
|
|
1613
|
-
*/
|
|
1614
|
-
unregisterTile(name: string): void;
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
|
-
/**
|
|
1618
|
-
* An evaluated pilet, i.e., a full pilet: functionality and metadata.
|
|
1619
|
-
*/
|
|
1620
|
-
export type Pilet = SinglePilet | MultiPilet;
|
|
1621
|
-
|
|
1622
|
-
/**
|
|
1623
|
-
* The shape of an app action in Piral.
|
|
1624
|
-
*/
|
|
1625
|
-
export interface PiralAction<T extends (...args: any) => any> {
|
|
1626
|
-
(ctx: GlobalStateContext, ...args: Parameters<T>): ReturnType<T>;
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
|
-
/**
|
|
1630
|
-
* A subset of the available app actions in Piral.
|
|
1631
|
-
*/
|
|
1632
|
-
export type PiralDefineActions = Partial<{
|
|
1633
|
-
[P in keyof PiralActions]: PiralAction<PiralActions[P]>;
|
|
1634
|
-
}>;
|
|
1635
|
-
|
|
1636
|
-
/**
|
|
1637
|
-
* The different known layout types.
|
|
1638
|
-
*/
|
|
1639
|
-
export type LayoutType = "mobile" | "tablet" | "desktop";
|
|
1640
|
-
|
|
1641
|
-
/**
|
|
1642
|
-
* The interface modeling the registration of a pilet page component.
|
|
1643
|
-
*/
|
|
1644
|
-
export interface PageRegistration extends BaseRegistration {
|
|
1645
|
-
/**
|
|
1646
|
-
* The registered page component.
|
|
1647
|
-
*/
|
|
1648
|
-
component: WrappedComponent<PageComponentProps>;
|
|
1649
|
-
/**
|
|
1650
|
-
* The page's associated metadata.
|
|
1651
|
-
*/
|
|
1652
|
-
meta: PiralPageMeta;
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
/**
|
|
1656
|
-
* Map of all error types to their respective props.
|
|
1657
|
-
*/
|
|
1658
|
-
export interface Errors extends PiralCustomErrors {
|
|
1659
|
-
/**
|
|
1660
|
-
* The props type for an extension error.
|
|
1661
|
-
*/
|
|
1662
|
-
extension: ExtensionErrorInfoProps;
|
|
1663
|
-
/**
|
|
1664
|
-
* The props type for a loading error.
|
|
1665
|
-
*/
|
|
1666
|
-
loading: LoadingErrorInfoProps;
|
|
1667
|
-
/**
|
|
1668
|
-
* The props type for a page error.
|
|
1669
|
-
*/
|
|
1670
|
-
page: PageErrorInfoProps;
|
|
1671
|
-
/**
|
|
1672
|
-
* The props type for a not found error.
|
|
1673
|
-
*/
|
|
1674
|
-
not_found: NotFoundErrorInfoProps;
|
|
1675
|
-
/**
|
|
1676
|
-
* The props type for an unknown error.
|
|
1677
|
-
*/
|
|
1678
|
-
unknown: UnknownErrorInfoProps;
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
/**
|
|
1682
|
-
* Custom parts of the global custom component state defined outside of piral-core.
|
|
1683
|
-
*/
|
|
1684
|
-
export interface PiralCustomComponentsState {
|
|
1685
|
-
/**
|
|
1686
|
-
* The dashboard container component.
|
|
1687
|
-
*/
|
|
1688
|
-
DashboardContainer: React.ComponentType<DashboardContainerProps>;
|
|
1689
|
-
/**
|
|
1690
|
-
* The dashboard tile component.
|
|
1691
|
-
*/
|
|
1692
|
-
DashboardTile: React.ComponentType<DashboardTileProps>;
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
/**
|
|
1696
|
-
* The props of a Loading indicator component.
|
|
1697
|
-
*/
|
|
1698
|
-
export interface LoadingIndicatorProps {}
|
|
1699
|
-
|
|
1700
|
-
/**
|
|
1701
|
-
* The props for the ErrorInfo component.
|
|
1702
|
-
*/
|
|
1703
|
-
export type ErrorInfoProps = UnionOf<Errors>;
|
|
1704
|
-
|
|
1705
|
-
/**
|
|
1706
|
-
* The props of a Router component.
|
|
1707
|
-
*/
|
|
1708
|
-
export interface RouterProps {}
|
|
1709
|
-
|
|
1710
|
-
/**
|
|
1711
|
-
* The props of a Layout component.
|
|
1712
|
-
*/
|
|
1713
|
-
export interface LayoutProps {
|
|
1714
|
-
/**
|
|
1715
|
-
* The currently selected layout type.
|
|
1716
|
-
*/
|
|
1717
|
-
currentLayout: LayoutType;
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
/**
|
|
1721
|
-
* The props of the RouteSwitch component.
|
|
1722
|
-
*/
|
|
1723
|
-
export interface RouteSwitchProps extends ReactRouter.SwitchProps {
|
|
1724
|
-
/**
|
|
1725
|
-
* The component that should be used in case nothing was found.
|
|
1726
|
-
*/
|
|
1727
|
-
NotFound: React.ComponentType<ReactRouter.RouteComponentProps>;
|
|
1728
|
-
/**
|
|
1729
|
-
* The component to register for the different paths.
|
|
1730
|
-
*/
|
|
1731
|
-
paths: Array<{
|
|
1732
|
-
/**
|
|
1733
|
-
* The exact path to use.
|
|
1734
|
-
*/
|
|
1735
|
-
path: string;
|
|
1736
|
-
/**
|
|
1737
|
-
* The component to register for this path.
|
|
1738
|
-
*/
|
|
1739
|
-
Component: React.ComponentType<ReactRouter.RouteComponentProps>;
|
|
1740
|
-
}>;
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
/**
|
|
1744
|
-
* Custom parts of the global registry state defined outside of piral-core.
|
|
1745
|
-
*/
|
|
1746
|
-
export interface PiralCustomRegistryState {
|
|
1747
|
-
/**
|
|
1748
|
-
* The registered tile components for a dashboard.
|
|
1749
|
-
*/
|
|
1750
|
-
tiles: Dict<TileRegistration>;
|
|
1751
|
-
}
|
|
1752
|
-
|
|
1753
|
-
export interface TileRegistration extends BaseRegistration {
|
|
1754
|
-
component: WrappedComponent<TileComponentProps>;
|
|
1755
|
-
preferences: TilePreferences;
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
/**
|
|
1759
|
-
* An evaluated single pilet.
|
|
1760
|
-
*/
|
|
1761
|
-
export type SinglePilet = SinglePiletApp & SinglePiletMetadata;
|
|
1762
|
-
|
|
1763
|
-
/**
|
|
1764
|
-
* An evaluated multi pilet.
|
|
1765
|
-
*/
|
|
1766
|
-
export type MultiPilet = MultiPiletApp & MultiPiletMetadata;
|
|
1767
|
-
|
|
1768
|
-
/**
|
|
1769
|
-
* The Piral app instance context.
|
|
1770
|
-
*/
|
|
1771
|
-
export interface GlobalStateContext extends PiralActions, EventEmitter {
|
|
1772
|
-
/**
|
|
1773
|
-
* The global state context atom.
|
|
1774
|
-
* Changes to the state should always be dispatched via the `dispatch` action.
|
|
1775
|
-
*/
|
|
1776
|
-
state: LibreAtom.Atom<GlobalState>;
|
|
1777
|
-
/**
|
|
1778
|
-
* The API objects created for the loaded pilets.
|
|
1779
|
-
*/
|
|
1780
|
-
apis: PiletsBag;
|
|
1781
|
-
/**
|
|
1782
|
-
* The available component converters.
|
|
1783
|
-
*/
|
|
1784
|
-
converters: ComponentConverters<any>;
|
|
1785
|
-
/**
|
|
1786
|
-
* The initial options.
|
|
1787
|
-
*/
|
|
1788
|
-
options: LoadPiletsOptions;
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
|
-
/**
|
|
1792
|
-
* Custom errors defined outside of piral-core.
|
|
1793
|
-
*/
|
|
1794
|
-
export interface PiralCustomErrors {
|
|
1795
|
-
tile: TileErrorInfoProps;
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
/**
|
|
1799
|
-
* The error used when a registered extension component crashed.
|
|
1800
|
-
*/
|
|
1801
|
-
export interface ExtensionErrorInfoProps {
|
|
1802
|
-
/**
|
|
1803
|
-
* The type of the error.
|
|
1804
|
-
*/
|
|
1805
|
-
type: "extension";
|
|
1806
|
-
/**
|
|
1807
|
-
* The provided error details.
|
|
1808
|
-
*/
|
|
1809
|
-
error: any;
|
|
1810
|
-
/**
|
|
1811
|
-
* The name of the pilet emitting the error.
|
|
1812
|
-
*/
|
|
1813
|
-
pilet?: string;
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
/**
|
|
1817
|
-
* The error used when the app could not be loaded.
|
|
1818
|
-
*/
|
|
1819
|
-
export interface LoadingErrorInfoProps {
|
|
1820
|
-
/**
|
|
1821
|
-
* The type of the error.
|
|
1822
|
-
*/
|
|
1823
|
-
type: "loading";
|
|
1824
|
-
/**
|
|
1825
|
-
* The provided error details.
|
|
1826
|
-
*/
|
|
1827
|
-
error: any;
|
|
1828
|
-
}
|
|
1829
|
-
|
|
1830
|
-
/**
|
|
1831
|
-
* The error used when a registered page component crashes.
|
|
1832
|
-
*/
|
|
1833
|
-
export interface PageErrorInfoProps extends ReactRouter.RouteComponentProps {
|
|
1834
|
-
/**
|
|
1835
|
-
* The type of the error.
|
|
1836
|
-
*/
|
|
1837
|
-
type: "page";
|
|
1838
|
-
/**
|
|
1839
|
-
* The provided error details.
|
|
1840
|
-
*/
|
|
1841
|
-
error: any;
|
|
1842
|
-
/**
|
|
1843
|
-
* The name of the pilet emitting the error.
|
|
1844
|
-
*/
|
|
1845
|
-
pilet?: string;
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
/**
|
|
1849
|
-
* The error used when a route cannot be resolved.
|
|
1850
|
-
*/
|
|
1851
|
-
export interface NotFoundErrorInfoProps extends ReactRouter.RouteComponentProps {
|
|
1852
|
-
/**
|
|
1853
|
-
* The type of the error.
|
|
1854
|
-
*/
|
|
1855
|
-
type: "not_found";
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
/**
|
|
1859
|
-
* The error used when the exact type is unknown.
|
|
1860
|
-
*/
|
|
1861
|
-
export interface UnknownErrorInfoProps {
|
|
1862
|
-
/**
|
|
1863
|
-
* The type of the error.
|
|
1864
|
-
*/
|
|
1865
|
-
type: "unknown";
|
|
1866
|
-
/**
|
|
1867
|
-
* The provided error details.
|
|
1868
|
-
*/
|
|
1869
|
-
error: any;
|
|
1870
|
-
/**
|
|
1871
|
-
* The name of the pilet emitting the error.
|
|
1872
|
-
*/
|
|
1873
|
-
pilet?: string;
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
export interface DashboardContainerProps extends ReactRouter.RouteComponentProps {}
|
|
1877
|
-
|
|
1878
|
-
export interface DashboardTileProps {
|
|
1879
|
-
/**
|
|
1880
|
-
* The currently used number of columns.
|
|
1881
|
-
*/
|
|
1882
|
-
columns: number;
|
|
1883
|
-
/**
|
|
1884
|
-
* The currently used number of rows.
|
|
1885
|
-
*/
|
|
1886
|
-
rows: number;
|
|
1887
|
-
/**
|
|
1888
|
-
* The resizable status.
|
|
1889
|
-
*/
|
|
1890
|
-
resizable: boolean;
|
|
1891
|
-
/**
|
|
1892
|
-
* The provided tile preferences.
|
|
1893
|
-
*/
|
|
1894
|
-
meta: TilePreferences;
|
|
1895
|
-
}
|
|
1896
|
-
|
|
1897
|
-
export type UnionOf<T> = {
|
|
1898
|
-
[K in keyof T]: T[K];
|
|
1899
|
-
}[keyof T];
|
|
1900
|
-
|
|
1901
|
-
/**
|
|
1902
|
-
* The pilet app, i.e., the functional exports.
|
|
1903
|
-
*/
|
|
1904
|
-
export interface SinglePiletApp {
|
|
1905
|
-
/**
|
|
1906
|
-
* Integrates the evaluated pilet into the application.
|
|
1907
|
-
* @param api The API to access the application.
|
|
1908
|
-
*/
|
|
1909
|
-
setup(api: PiletApi): void | Promise<void>;
|
|
1910
|
-
/**
|
|
1911
|
-
* Optional function for cleanup.
|
|
1912
|
-
* @param api The API to access the application.
|
|
1913
|
-
*/
|
|
1914
|
-
teardown?(api: PiletApi): void;
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
/**
|
|
1918
|
-
* The pilet app, i.e., the functional exports.
|
|
1919
|
-
*/
|
|
1920
|
-
export interface MultiPiletApp {
|
|
1921
|
-
/**
|
|
1922
|
-
* Integrates the evaluated pilet into the application.
|
|
1923
|
-
* @param api The API to access the application.
|
|
1924
|
-
*/
|
|
1925
|
-
setup(apiFactory: PiletApiCreator): void | Promise<void>;
|
|
1926
|
-
}
|
|
1927
|
-
|
|
1928
|
-
/**
|
|
1929
|
-
* Represents the dictionary of the loaded pilets and their APIs.
|
|
1930
|
-
*/
|
|
1931
|
-
export interface PiletsBag {
|
|
1932
|
-
[name: string]: PiletApi;
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
/**
|
|
1936
|
-
* The options for loading pilets.
|
|
1937
|
-
*/
|
|
1938
|
-
export interface LoadPiletsOptions {
|
|
1939
|
-
/**
|
|
1940
|
-
* The callback function for creating an API object.
|
|
1941
|
-
* The API object is passed on to a specific pilet.
|
|
1942
|
-
*/
|
|
1943
|
-
createApi: PiletApiCreator;
|
|
1944
|
-
/**
|
|
1945
|
-
* The callback for fetching the dynamic pilets.
|
|
1946
|
-
*/
|
|
1947
|
-
fetchPilets: PiletRequester;
|
|
1948
|
-
/**
|
|
1949
|
-
* Optionally, some already existing evaluated pilets, e.g.,
|
|
1950
|
-
* helpful when debugging or in SSR scenarios.
|
|
1951
|
-
*/
|
|
1952
|
-
pilets?: Array<Pilet>;
|
|
1953
|
-
/**
|
|
1954
|
-
* Optionally, configures the default loader.
|
|
1955
|
-
*/
|
|
1956
|
-
config?: DefaultLoaderConfig;
|
|
1957
|
-
/**
|
|
1958
|
-
* Optionally, defines the default way how to load a pilet.
|
|
1959
|
-
*/
|
|
1960
|
-
loadPilet?: PiletLoader;
|
|
1961
|
-
/**
|
|
1962
|
-
* Optionally, defines loaders for custom specifications.
|
|
1963
|
-
*/
|
|
1964
|
-
loaders?: CustomSpecLoaders;
|
|
1965
|
-
/**
|
|
1966
|
-
* Gets the map of globally available dependencies with their names
|
|
1967
|
-
* as keys and their evaluated pilet content as value.
|
|
1968
|
-
*/
|
|
1969
|
-
dependencies?: AvailableDependencies;
|
|
1970
|
-
/**
|
|
1971
|
-
* Optionally, defines the loading strategy to use.
|
|
1972
|
-
*/
|
|
1973
|
-
strategy?: PiletLoadingStrategy;
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
export interface TileErrorInfoProps {
|
|
1977
|
-
/**
|
|
1978
|
-
* The type of the error.
|
|
1979
|
-
*/
|
|
1980
|
-
type: "tile";
|
|
1981
|
-
/**
|
|
1982
|
-
* The provided error details.
|
|
1983
|
-
*/
|
|
1984
|
-
error: any;
|
|
1985
|
-
/**
|
|
1986
|
-
* The currently used number of columns.
|
|
1987
|
-
*/
|
|
1988
|
-
columns: number;
|
|
1989
|
-
/**
|
|
1990
|
-
* The currently used number of rows.
|
|
1991
|
-
*/
|
|
1992
|
-
rows: number;
|
|
1993
|
-
/**
|
|
1994
|
-
* The name of the pilet emitting the error.
|
|
1995
|
-
*/
|
|
1996
|
-
pilet?: string;
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
/**
|
|
2000
|
-
* The creator function for the pilet API.
|
|
2001
|
-
*/
|
|
2002
|
-
export interface PiletApiCreator {
|
|
2003
|
-
(target: PiletMetadata): PiletApi;
|
|
2004
|
-
}
|
|
2005
|
-
|
|
2006
|
-
/**
|
|
2007
|
-
* The interface describing a function capable of fetching pilets.
|
|
2008
|
-
*/
|
|
2009
|
-
export interface PiletRequester {
|
|
2010
|
-
(): Promise<Array<PiletMetadata>>;
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
/**
|
|
2014
|
-
* Additional configuration options for the default loader.
|
|
2015
|
-
*/
|
|
2016
|
-
export interface DefaultLoaderConfig {
|
|
2017
|
-
/**
|
|
2018
|
-
* Sets the cross-origin attribute of potential script tags.
|
|
2019
|
-
* For pilets v1 this may be useful. Otherwise, only pilets that
|
|
2020
|
-
* have an integrity defined will be set to "anonymous".
|
|
2021
|
-
*/
|
|
2022
|
-
crossOrigin?: string;
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
/**
|
|
2026
|
-
* The callback to be used to load a single pilet.
|
|
2027
|
-
*/
|
|
2028
|
-
export interface PiletLoader {
|
|
2029
|
-
(meta: PiletMetadata): Promise<Pilet>;
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
/**
|
|
2033
|
-
* Defines the spec identifiers for custom loading.
|
|
2034
|
-
*/
|
|
2035
|
-
export type CustomSpecLoaders = Record<string, PiletLoader>;
|
|
2036
|
-
|
|
2037
|
-
/**
|
|
2038
|
-
* The record containing all available dependencies.
|
|
2039
|
-
*/
|
|
2040
|
-
export interface AvailableDependencies {
|
|
2041
|
-
[name: string]: any;
|
|
2042
|
-
}
|
|
2043
|
-
|
|
2044
|
-
/**
|
|
2045
|
-
* The strategy for how pilets are loaded at runtime.
|
|
2046
|
-
*/
|
|
2047
|
-
export interface PiletLoadingStrategy {
|
|
2048
|
-
(options: LoadPiletsOptions, pilets: PiletsLoaded): PromiseLike<void>;
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
/**
|
|
2052
|
-
* The callback to be used when pilets have been loaded.
|
|
2053
|
-
*/
|
|
2054
|
-
export interface PiletsLoaded {
|
|
2055
|
-
(error: Error | undefined, pilets: Array<Pilet>): void;
|
|
1209
|
+
key: string;
|
|
2056
1210
|
}
|
|
2057
1211
|
}
|