sample-cross-fx 0.15.0-beta.4411 → 0.15.0-beta.4472
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.eb2907.js → index.240a55.js} +131 -83
- package/app/{index.eb2907.js.map → index.240a55.js.map} +1 -1
- package/app/index.d.ts +54 -1038
- 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 +1 -3
package/app/index.d.ts
CHANGED
|
@@ -1104,8 +1104,8 @@ declare module "sample-cross-fx" {
|
|
|
1104
1104
|
* The context to be transported into the generic components.
|
|
1105
1105
|
*/
|
|
1106
1106
|
export interface ComponentContext {
|
|
1107
|
-
|
|
1108
|
-
|
|
1107
|
+
navigation: NavigationApi;
|
|
1108
|
+
publicPath: string;
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
1111
|
/**
|
|
@@ -1120,1076 +1120,92 @@ declare module "sample-cross-fx" {
|
|
|
1120
1120
|
|
|
1121
1121
|
export type WrappedComponent<TProps> = React.ComponentType<React.PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
|
|
1122
1122
|
|
|
1123
|
-
|
|
1124
|
-
* The globally defined actions.
|
|
1125
|
-
*/
|
|
1126
|
-
export interface PiralActions extends PiralCustomActions {
|
|
1127
|
-
/**
|
|
1128
|
-
* Initializes the application shell.
|
|
1129
|
-
* @param loading The current loading state.
|
|
1130
|
-
* @param error The application error, if any.
|
|
1131
|
-
* @param modules The loaded pilets.
|
|
1132
|
-
*/
|
|
1133
|
-
initialize(loading: boolean, error: Error | undefined, modules: Array<Pilet>): void;
|
|
1134
|
-
/**
|
|
1135
|
-
* Injects an evaluated pilet at runtime - removes the pilet from registry first if available.
|
|
1136
|
-
* @param pilet The pilet to be injected.
|
|
1137
|
-
* @returns The injected pilet.
|
|
1138
|
-
*/
|
|
1139
|
-
injectPilet(pilet: Pilet): Pilet;
|
|
1140
|
-
/**
|
|
1141
|
-
* Adds a pilet at runtime by loading it, evaluating it, and then injecting it.
|
|
1142
|
-
* @param pilet The pilet to be added.
|
|
1143
|
-
* @returns The promise indicating when the pilet was fully added.
|
|
1144
|
-
*/
|
|
1145
|
-
addPilet(pilet: PiletEntry): Promise<void>;
|
|
1146
|
-
/**
|
|
1147
|
-
* Removes a pilet by unloading it and deleting all component registrations.
|
|
1148
|
-
* @param name The name of the pilet to remove.
|
|
1149
|
-
*/
|
|
1150
|
-
removePilet(name: string): Promise<void>;
|
|
1151
|
-
/**
|
|
1152
|
-
* Defines a single action for Piral.
|
|
1153
|
-
* @param actionName The name of the action to define.
|
|
1154
|
-
* @param action The action to include.
|
|
1155
|
-
*/
|
|
1156
|
-
defineAction<T extends keyof PiralActions>(actionName: T, action: PiralAction<PiralActions[T]>): void;
|
|
1157
|
-
/**
|
|
1158
|
-
* Defines a set of actions for Piral.
|
|
1159
|
-
* @param actions The actions to define.
|
|
1160
|
-
*/
|
|
1161
|
-
defineActions(actions: PiralDefineActions): void;
|
|
1162
|
-
/**
|
|
1163
|
-
* Reads the value of a shared data item.
|
|
1164
|
-
* @param name The name of the shared item.
|
|
1165
|
-
*/
|
|
1166
|
-
readDataValue(name: string): any;
|
|
1167
|
-
/**
|
|
1168
|
-
* Tries to write a shared data item. The write access is only
|
|
1169
|
-
* possible if the name belongs to the provided owner or has not
|
|
1170
|
-
* been taken yet.
|
|
1171
|
-
* Setting the value to null will release it.
|
|
1172
|
-
* @param name The name of the shared data item.
|
|
1173
|
-
* @param value The value of the shared data item.
|
|
1174
|
-
* @param owner The owner of the shared data item.
|
|
1175
|
-
* @param target The target storage locatation.
|
|
1176
|
-
* @param expiration The time for when to dispose the shared item.
|
|
1177
|
-
*/
|
|
1178
|
-
tryWriteDataItem(name: string, value: any, owner: string, target: DataStoreTarget, expiration: number): boolean;
|
|
1179
|
-
/**
|
|
1180
|
-
* Registers a new route to be resolved.
|
|
1181
|
-
* @param route The route to register.
|
|
1182
|
-
* @param value The page to be rendered on the route.
|
|
1183
|
-
*/
|
|
1184
|
-
registerPage(route: string, value: PageRegistration): void;
|
|
1185
|
-
/**
|
|
1186
|
-
* Unregisters an existing route.
|
|
1187
|
-
* @param route The route to be removed.
|
|
1188
|
-
*/
|
|
1189
|
-
unregisterPage(route: string): void;
|
|
1190
|
-
/**
|
|
1191
|
-
* Registers a new extension.
|
|
1192
|
-
* @param name The name of the extension category.
|
|
1193
|
-
* @param value The extension registration.
|
|
1194
|
-
*/
|
|
1195
|
-
registerExtension(name: string, value: ExtensionRegistration): void;
|
|
1196
|
-
/**
|
|
1197
|
-
* Unregisters an existing extension.
|
|
1198
|
-
* @param name The name of the extension category.
|
|
1199
|
-
* @param value The extension that will be removed.
|
|
1200
|
-
*/
|
|
1201
|
-
unregisterExtension(name: string, reference: any): void;
|
|
1202
|
-
/**
|
|
1203
|
-
* Sets the common component to render.
|
|
1204
|
-
* @param name The name of the component.
|
|
1205
|
-
* @param component The component to use for rendering.
|
|
1206
|
-
*/
|
|
1207
|
-
setComponent<TKey extends keyof ComponentsState>(name: TKey, component: ComponentsState[TKey]): void;
|
|
1123
|
+
export interface NavigationApi {
|
|
1208
1124
|
/**
|
|
1209
|
-
*
|
|
1210
|
-
* @param type The type of the error.
|
|
1211
|
-
* @param component The component to use for rendering.
|
|
1125
|
+
* Pushes a new location onto the history stack.
|
|
1212
1126
|
*/
|
|
1213
|
-
|
|
1127
|
+
push(target: string, state?: any): void;
|
|
1214
1128
|
/**
|
|
1215
|
-
*
|
|
1216
|
-
* @param path The name of the component.
|
|
1217
|
-
* @param component The component to use for rendering.
|
|
1129
|
+
* Replaces the current location with another.
|
|
1218
1130
|
*/
|
|
1219
|
-
|
|
1131
|
+
replace(target: string, state?: any): void;
|
|
1220
1132
|
/**
|
|
1221
|
-
*
|
|
1222
|
-
* @param provider The provider to include.
|
|
1133
|
+
* Changes the current index in the history stack by a given delta.
|
|
1223
1134
|
*/
|
|
1224
|
-
|
|
1135
|
+
go(n: number): void;
|
|
1225
1136
|
/**
|
|
1226
|
-
*
|
|
1227
|
-
*
|
|
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.
|
|
1228
1143
|
*/
|
|
1229
|
-
|
|
1144
|
+
block(blocker: NavigationBlocker): Disposable;
|
|
1230
1145
|
/**
|
|
1231
|
-
*
|
|
1232
|
-
*
|
|
1233
|
-
* @param
|
|
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.
|
|
1234
1150
|
*/
|
|
1235
|
-
|
|
1236
|
-
/**
|
|
1237
|
-
* Hides the provided portal in the rendering pipeline.
|
|
1238
|
-
* @param id The id of the portal to use.
|
|
1239
|
-
* @param entry The child to remove.
|
|
1240
|
-
*/
|
|
1241
|
-
hidePortal(id: string, entry: React.ReactPortal): void;
|
|
1242
|
-
/**
|
|
1243
|
-
* Updates the provided portal in the rendering pipeline.
|
|
1244
|
-
* @param id The id of the portal to use.
|
|
1245
|
-
* @param current The currently displayed child.
|
|
1246
|
-
* @param next The updated child that should be displayed.
|
|
1247
|
-
*/
|
|
1248
|
-
updatePortal(id: string, current: React.ReactPortal, next: React.ReactPortal): void;
|
|
1249
|
-
/**
|
|
1250
|
-
* Dispatches a state change.
|
|
1251
|
-
* @param update The update function creating a new state.
|
|
1252
|
-
*/
|
|
1253
|
-
dispatch(update: (state: GlobalState) => GlobalState): void;
|
|
1254
|
-
/**
|
|
1255
|
-
* Reads the selected part of the global state.
|
|
1256
|
-
* @param select The selector for getting the desired part.
|
|
1257
|
-
* @returns The desired part.
|
|
1258
|
-
*/
|
|
1259
|
-
readState<S>(select: (state: GlobalState) => S): S;
|
|
1260
|
-
/**
|
|
1261
|
-
* Performs a navigation.
|
|
1262
|
-
* @param path The path to navigate to.
|
|
1263
|
-
* @param state The optional state for the navigation.
|
|
1264
|
-
*/
|
|
1265
|
-
navigate(path: string, state?: any): void;
|
|
1151
|
+
listen(listener: NavigationListener): Disposable;
|
|
1266
1152
|
}
|
|
1267
1153
|
|
|
1268
1154
|
export type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
1269
1155
|
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
*/
|
|
1273
|
-
export interface PiralCustomActions {
|
|
1274
|
-
/**
|
|
1275
|
-
* Registers a new tile.
|
|
1276
|
-
* @param name The name of the tile.
|
|
1277
|
-
* @param value The tile registration.
|
|
1278
|
-
*/
|
|
1279
|
-
registerTile(name: string, value: TileRegistration): void;
|
|
1280
|
-
/**
|
|
1281
|
-
* Unregisters an existing tile.
|
|
1282
|
-
* @param name The name of the tile to be removed.
|
|
1283
|
-
*/
|
|
1284
|
-
unregisterTile(name: string): void;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
/**
|
|
1288
|
-
* An evaluated pilet, i.e., a full pilet: functionality and metadata.
|
|
1289
|
-
*/
|
|
1290
|
-
export type Pilet = SinglePilet | MultiPilet;
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* Pilet entry representing part of a response from the feed service.
|
|
1294
|
-
*/
|
|
1295
|
-
export type PiletEntry = MultiPiletEntry | SinglePiletEntry;
|
|
1296
|
-
|
|
1297
|
-
/**
|
|
1298
|
-
* The shape of an app action in Piral.
|
|
1299
|
-
*/
|
|
1300
|
-
export interface PiralAction<T extends (...args: any) => any> {
|
|
1301
|
-
(ctx: GlobalStateContext, ...args: Parameters<T>): ReturnType<T>;
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
/**
|
|
1305
|
-
* A subset of the available app actions in Piral.
|
|
1306
|
-
*/
|
|
1307
|
-
export type PiralDefineActions = Partial<{
|
|
1308
|
-
[P in keyof PiralActions]: PiralAction<PiralActions[P]>;
|
|
1309
|
-
}>;
|
|
1310
|
-
|
|
1311
|
-
/**
|
|
1312
|
-
* The interface modeling the registration of a pilet page component.
|
|
1313
|
-
*/
|
|
1314
|
-
export interface PageRegistration extends BaseRegistration {
|
|
1315
|
-
/**
|
|
1316
|
-
* The registered page component.
|
|
1317
|
-
*/
|
|
1318
|
-
component: WrappedComponent<PageComponentProps>;
|
|
1319
|
-
/**
|
|
1320
|
-
* The page's associated metadata.
|
|
1321
|
-
*/
|
|
1322
|
-
meta: PiralPageMeta;
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
/**
|
|
1326
|
-
* The Piral global app sub-state container for shared components.
|
|
1327
|
-
*/
|
|
1328
|
-
export interface ComponentsState extends PiralCustomComponentsState {
|
|
1329
|
-
/**
|
|
1330
|
-
* The loading indicator renderer.
|
|
1331
|
-
*/
|
|
1332
|
-
LoadingIndicator: React.ComponentType<LoadingIndicatorProps>;
|
|
1333
|
-
/**
|
|
1334
|
-
* The error renderer.
|
|
1335
|
-
*/
|
|
1336
|
-
ErrorInfo: React.ComponentType<ErrorInfoProps>;
|
|
1337
|
-
/**
|
|
1338
|
-
* The router context.
|
|
1339
|
-
*/
|
|
1340
|
-
Router: React.ComponentType<RouterProps>;
|
|
1341
|
-
/**
|
|
1342
|
-
* The layout used for pages.
|
|
1343
|
-
*/
|
|
1344
|
-
Layout: React.ComponentType<LayoutProps>;
|
|
1345
|
-
/**
|
|
1346
|
-
* The route switch used for determining the route registration.
|
|
1347
|
-
*/
|
|
1348
|
-
RouteSwitch: React.ComponentType<RouteSwitchProps>;
|
|
1349
|
-
/**
|
|
1350
|
-
* A component that can be used for debugging purposes.
|
|
1351
|
-
*/
|
|
1352
|
-
Debug?: React.ComponentType;
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
export type ErrorComponentsState = {
|
|
1356
|
-
[P in keyof Errors]?: React.ComponentType<Errors[P]>;
|
|
1357
|
-
};
|
|
1358
|
-
|
|
1359
|
-
/**
|
|
1360
|
-
* The Piral global app state container.
|
|
1361
|
-
*/
|
|
1362
|
-
export interface GlobalState extends PiralCustomState {
|
|
1363
|
-
/**
|
|
1364
|
-
* The relevant state for the app itself.
|
|
1365
|
-
*/
|
|
1366
|
-
app: AppState;
|
|
1367
|
-
/**
|
|
1368
|
-
* The relevant state for rendering errors of the app.
|
|
1369
|
-
*/
|
|
1370
|
-
errorComponents: ErrorComponentsState;
|
|
1371
|
-
/**
|
|
1372
|
-
* The relevant state for rendering parts of the app.
|
|
1373
|
-
*/
|
|
1374
|
-
components: ComponentsState;
|
|
1375
|
-
/**
|
|
1376
|
-
* The relevant state for the registered components.
|
|
1377
|
-
*/
|
|
1378
|
-
registry: RegistryState;
|
|
1379
|
-
/**
|
|
1380
|
-
* Gets the loaded modules.
|
|
1381
|
-
*/
|
|
1382
|
-
modules: Array<Pilet>;
|
|
1383
|
-
/**
|
|
1384
|
-
* The foreign component portals to render.
|
|
1385
|
-
*/
|
|
1386
|
-
portals: Record<string, Array<React.ReactPortal>>;
|
|
1387
|
-
/**
|
|
1388
|
-
* The application's shared data.
|
|
1389
|
-
*/
|
|
1390
|
-
data: Dict<SharedDataItem>;
|
|
1391
|
-
/**
|
|
1392
|
-
* The used (exact) application routes.
|
|
1393
|
-
*/
|
|
1394
|
-
routes: Dict<React.ComponentType<ReactRouter.RouteComponentProps<any>>>;
|
|
1395
|
-
/**
|
|
1396
|
-
* The current provider.
|
|
1397
|
-
*/
|
|
1398
|
-
provider?: React.ComponentType;
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
export interface TileRegistration extends BaseRegistration {
|
|
1402
|
-
component: WrappedComponent<TileComponentProps>;
|
|
1403
|
-
preferences: TilePreferences;
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
/**
|
|
1407
|
-
* An evaluated single pilet.
|
|
1408
|
-
*/
|
|
1409
|
-
export type SinglePilet = SinglePiletApp & PiletMetadata;
|
|
1410
|
-
|
|
1411
|
-
/**
|
|
1412
|
-
* An evaluated multi pilet.
|
|
1413
|
-
*/
|
|
1414
|
-
export type MultiPilet = MultiPiletApp & PiletMetadata;
|
|
1415
|
-
|
|
1416
|
-
/**
|
|
1417
|
-
* The metadata response for a multi pilet.
|
|
1418
|
-
*/
|
|
1419
|
-
export type MultiPiletEntry = PiletBundleEntry;
|
|
1420
|
-
|
|
1421
|
-
/**
|
|
1422
|
-
* The metadata response for a single pilet.
|
|
1423
|
-
*/
|
|
1424
|
-
export type SinglePiletEntry = PiletV0Entry | PiletV1Entry | PiletV2Entry | PiletVxEntry;
|
|
1425
|
-
|
|
1426
|
-
/**
|
|
1427
|
-
* The Piral app instance context.
|
|
1428
|
-
*/
|
|
1429
|
-
export interface GlobalStateContext extends PiralActions, EventEmitter {
|
|
1430
|
-
/**
|
|
1431
|
-
* The global state context atom.
|
|
1432
|
-
* Changes to the state should always be dispatched via the `dispatch` action.
|
|
1433
|
-
*/
|
|
1434
|
-
state: UseBoundStore<GlobalState>;
|
|
1435
|
-
/**
|
|
1436
|
-
* The API objects created for the loaded pilets.
|
|
1437
|
-
*/
|
|
1438
|
-
apis: PiletsBag;
|
|
1439
|
-
/**
|
|
1440
|
-
* The available component converters.
|
|
1441
|
-
*/
|
|
1442
|
-
converters: ComponentConverters<any>;
|
|
1443
|
-
/**
|
|
1444
|
-
* The initial options.
|
|
1445
|
-
*/
|
|
1446
|
-
options: LoadPiletsOptions;
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
/**
|
|
1450
|
-
* Custom parts of the global custom component state defined outside of piral-core.
|
|
1451
|
-
*/
|
|
1452
|
-
export interface PiralCustomComponentsState {
|
|
1453
|
-
/**
|
|
1454
|
-
* The dashboard container component.
|
|
1455
|
-
*/
|
|
1456
|
-
DashboardContainer: React.ComponentType<DashboardContainerProps>;
|
|
1457
|
-
/**
|
|
1458
|
-
* The dashboard tile component.
|
|
1459
|
-
*/
|
|
1460
|
-
DashboardTile: React.ComponentType<DashboardTileProps>;
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
/**
|
|
1464
|
-
* The props of a Loading indicator component.
|
|
1465
|
-
*/
|
|
1466
|
-
export interface LoadingIndicatorProps {}
|
|
1467
|
-
|
|
1468
|
-
/**
|
|
1469
|
-
* The props for the ErrorInfo component.
|
|
1470
|
-
*/
|
|
1471
|
-
export type ErrorInfoProps = UnionOf<Errors>;
|
|
1472
|
-
|
|
1473
|
-
/**
|
|
1474
|
-
* The props of a Router component.
|
|
1475
|
-
*/
|
|
1476
|
-
export interface RouterProps {
|
|
1477
|
-
/**
|
|
1478
|
-
* The content to be rendered inside the router.
|
|
1479
|
-
*/
|
|
1480
|
-
children?: React.ReactNode;
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
|
-
/**
|
|
1484
|
-
* The props of a Layout component.
|
|
1485
|
-
*/
|
|
1486
|
-
export interface LayoutProps {
|
|
1487
|
-
/**
|
|
1488
|
-
* The currently selected layout type.
|
|
1489
|
-
*/
|
|
1490
|
-
currentLayout: LayoutType;
|
|
1491
|
-
/**
|
|
1492
|
-
* The page's content.
|
|
1493
|
-
*/
|
|
1494
|
-
children: React.ReactNode;
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
/**
|
|
1498
|
-
* The props of the RouteSwitch component.
|
|
1499
|
-
*/
|
|
1500
|
-
export interface RouteSwitchProps extends ReactRouter.SwitchProps {
|
|
1501
|
-
/**
|
|
1502
|
-
* The component that should be used in case nothing was found.
|
|
1503
|
-
*/
|
|
1504
|
-
NotFound: React.ComponentType<ReactRouter.RouteComponentProps>;
|
|
1505
|
-
/**
|
|
1506
|
-
* The component to register for the different paths.
|
|
1507
|
-
*/
|
|
1508
|
-
paths: Array<AppPath>;
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
/**
|
|
1512
|
-
* Map of all error types to their respective props.
|
|
1513
|
-
*/
|
|
1514
|
-
export interface Errors extends PiralCustomErrors {
|
|
1515
|
-
/**
|
|
1516
|
-
* The props type for an extension error.
|
|
1517
|
-
*/
|
|
1518
|
-
extension: ExtensionErrorInfoProps;
|
|
1519
|
-
/**
|
|
1520
|
-
* The props type for a loading error.
|
|
1521
|
-
*/
|
|
1522
|
-
loading: LoadingErrorInfoProps;
|
|
1523
|
-
/**
|
|
1524
|
-
* The props type for a page error.
|
|
1525
|
-
*/
|
|
1526
|
-
page: PageErrorInfoProps;
|
|
1527
|
-
/**
|
|
1528
|
-
* The props type for a not found error.
|
|
1529
|
-
*/
|
|
1530
|
-
not_found: NotFoundErrorInfoProps;
|
|
1531
|
-
/**
|
|
1532
|
-
* The props type for an unknown error.
|
|
1533
|
-
*/
|
|
1534
|
-
unknown: UnknownErrorInfoProps;
|
|
1535
|
-
}
|
|
1536
|
-
|
|
1537
|
-
/**
|
|
1538
|
-
* Custom state extensions defined outside of piral-core.
|
|
1539
|
-
*/
|
|
1540
|
-
export interface PiralCustomState {}
|
|
1541
|
-
|
|
1542
|
-
/**
|
|
1543
|
-
* The Piral global app sub-state container for app information.
|
|
1544
|
-
*/
|
|
1545
|
-
export interface AppState {
|
|
1546
|
-
/**
|
|
1547
|
-
* Gets if the application is currently performing a background loading
|
|
1548
|
-
* activity, e.g., for loading modules asynchronously or fetching
|
|
1549
|
-
* translations.
|
|
1550
|
-
*/
|
|
1551
|
-
loading: boolean;
|
|
1552
|
-
/**
|
|
1553
|
-
* Gets an unrecoverable application error, if any.
|
|
1554
|
-
*/
|
|
1555
|
-
error: Error | undefined;
|
|
1556
|
-
/**
|
|
1557
|
-
* Gets the public path of the application.
|
|
1558
|
-
*/
|
|
1559
|
-
publicPath: string;
|
|
1156
|
+
export interface NavigationBlocker {
|
|
1157
|
+
(tx: NavigationTransition): void;
|
|
1560
1158
|
}
|
|
1561
1159
|
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
*/
|
|
1565
|
-
export interface RegistryState extends PiralCustomRegistryState {
|
|
1566
|
-
/**
|
|
1567
|
-
* The registered page components for the router.
|
|
1568
|
-
*/
|
|
1569
|
-
pages: Dict<PageRegistration>;
|
|
1570
|
-
/**
|
|
1571
|
-
* The registered extension components for extension slots.
|
|
1572
|
-
*/
|
|
1573
|
-
extensions: Dict<Array<ExtensionRegistration>>;
|
|
1574
|
-
/**
|
|
1575
|
-
* The registered wrappers for any component.
|
|
1576
|
-
*/
|
|
1577
|
-
wrappers: Dict<React.ComponentType<any>>;
|
|
1160
|
+
export interface NavigationListener {
|
|
1161
|
+
(update: NavigationUpdate): void;
|
|
1578
1162
|
}
|
|
1579
1163
|
|
|
1580
|
-
export
|
|
1581
|
-
|
|
1582
|
-
/**
|
|
1583
|
-
* Defines the shape of a shared data item.
|
|
1584
|
-
*/
|
|
1585
|
-
export interface SharedDataItem<TValue = any> {
|
|
1586
|
-
/**
|
|
1587
|
-
* Gets the associated value.
|
|
1588
|
-
*/
|
|
1589
|
-
value: TValue;
|
|
1590
|
-
/**
|
|
1591
|
-
* Gets the owner of the item.
|
|
1592
|
-
*/
|
|
1593
|
-
owner: string;
|
|
1594
|
-
/**
|
|
1595
|
-
* Gets the storage location.
|
|
1596
|
-
*/
|
|
1597
|
-
target: DataStoreTarget;
|
|
1598
|
-
/**
|
|
1599
|
-
* Gets the expiration of the item.
|
|
1600
|
-
*/
|
|
1601
|
-
expires: number;
|
|
1164
|
+
export interface NavigationTransition extends NavigationUpdate {
|
|
1165
|
+
retry(): void;
|
|
1602
1166
|
}
|
|
1603
1167
|
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
export interface SinglePiletApp {
|
|
1608
|
-
/**
|
|
1609
|
-
* Integrates the evaluated pilet into the application.
|
|
1610
|
-
* @param api The API to access the application.
|
|
1611
|
-
*/
|
|
1612
|
-
setup(api: PiletApi): void | Promise<void>;
|
|
1613
|
-
/**
|
|
1614
|
-
* Optional function for cleanup.
|
|
1615
|
-
* @param api The API to access the application.
|
|
1616
|
-
*/
|
|
1617
|
-
teardown?(api: PiletApi): void;
|
|
1168
|
+
export interface NavigationUpdate {
|
|
1169
|
+
action: NavigationAction;
|
|
1170
|
+
location: NavigationLocation;
|
|
1618
1171
|
}
|
|
1619
1172
|
|
|
1620
|
-
|
|
1621
|
-
* The pilet app, i.e., the functional exports.
|
|
1622
|
-
*/
|
|
1623
|
-
export interface MultiPiletApp {
|
|
1624
|
-
/**
|
|
1625
|
-
* Integrates the evaluated pilet into the application.
|
|
1626
|
-
* @param api The API to access the application.
|
|
1627
|
-
*/
|
|
1628
|
-
setup(apiFactory: PiletApiCreator): void | Promise<void>;
|
|
1629
|
-
}
|
|
1173
|
+
export type NavigationAction = "POP" | "PUSH" | "REPLACE";
|
|
1630
1174
|
|
|
1631
|
-
|
|
1632
|
-
* Metadata for pilets using the bundle schema.
|
|
1633
|
-
*/
|
|
1634
|
-
export interface PiletBundleEntry {
|
|
1635
|
-
/**
|
|
1636
|
-
* The name of the bundle pilet, i.e., the package id.
|
|
1637
|
-
*/
|
|
1638
|
-
name?: string;
|
|
1175
|
+
export interface NavigationLocation {
|
|
1639
1176
|
/**
|
|
1640
|
-
*
|
|
1177
|
+
* The fully qualified URL incl. the origin and base path.
|
|
1641
1178
|
*/
|
|
1642
|
-
|
|
1179
|
+
href: string;
|
|
1643
1180
|
/**
|
|
1644
|
-
* The
|
|
1181
|
+
* The location.pathname property is a string that contains an initial "/"
|
|
1182
|
+
* followed by the remainder of the URL up to the ?.
|
|
1645
1183
|
*/
|
|
1646
|
-
|
|
1184
|
+
pathname: string;
|
|
1647
1185
|
/**
|
|
1648
|
-
* 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. '').
|
|
1649
1189
|
*/
|
|
1650
|
-
|
|
1190
|
+
search: string;
|
|
1651
1191
|
/**
|
|
1652
|
-
* The
|
|
1653
|
-
*
|
|
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. '').
|
|
1654
1195
|
*/
|
|
1655
|
-
|
|
1196
|
+
hash: string;
|
|
1656
1197
|
/**
|
|
1657
|
-
*
|
|
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.
|
|
1658
1202
|
*/
|
|
1659
|
-
|
|
1203
|
+
state: unknown;
|
|
1660
1204
|
/**
|
|
1661
|
-
*
|
|
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.
|
|
1662
1208
|
*/
|
|
1663
|
-
|
|
1209
|
+
key: string;
|
|
1664
1210
|
}
|
|
1665
|
-
|
|
1666
|
-
/**
|
|
1667
|
-
* Metadata for pilets using the v0 schema.
|
|
1668
|
-
*/
|
|
1669
|
-
export type PiletV0Entry = PiletV0ContentEntry | PiletV0LinkEntry;
|
|
1670
|
-
|
|
1671
|
-
/**
|
|
1672
|
-
* Metadata for pilets using the v1 schema.
|
|
1673
|
-
*/
|
|
1674
|
-
export interface PiletV1Entry {
|
|
1675
|
-
/**
|
|
1676
|
-
* The name of the pilet, i.e., the package id.
|
|
1677
|
-
*/
|
|
1678
|
-
name: string;
|
|
1679
|
-
/**
|
|
1680
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1681
|
-
*/
|
|
1682
|
-
version: string;
|
|
1683
|
-
/**
|
|
1684
|
-
* Optionally provides the version of the specification for this pilet.
|
|
1685
|
-
*/
|
|
1686
|
-
spec?: "v1";
|
|
1687
|
-
/**
|
|
1688
|
-
* The link for retrieving the content of the pilet.
|
|
1689
|
-
*/
|
|
1690
|
-
link: string;
|
|
1691
|
-
/**
|
|
1692
|
-
* The reference name for the global require.
|
|
1693
|
-
*/
|
|
1694
|
-
requireRef: string;
|
|
1695
|
-
/**
|
|
1696
|
-
* The computed integrity of the pilet. Will be used to set the
|
|
1697
|
-
* integrity value of the script.
|
|
1698
|
-
*/
|
|
1699
|
-
integrity?: string;
|
|
1700
|
-
/**
|
|
1701
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1702
|
-
*/
|
|
1703
|
-
custom?: any;
|
|
1704
|
-
/**
|
|
1705
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
1706
|
-
*/
|
|
1707
|
-
config?: Record<string, any>;
|
|
1708
|
-
/**
|
|
1709
|
-
* Additional shared dependency script files.
|
|
1710
|
-
*/
|
|
1711
|
-
dependencies?: Record<string, string>;
|
|
1712
|
-
}
|
|
1713
|
-
|
|
1714
|
-
/**
|
|
1715
|
-
* Metadata for pilets using the v2 schema.
|
|
1716
|
-
*/
|
|
1717
|
-
export interface PiletV2Entry {
|
|
1718
|
-
/**
|
|
1719
|
-
* The name of the pilet, i.e., the package id.
|
|
1720
|
-
*/
|
|
1721
|
-
name: string;
|
|
1722
|
-
/**
|
|
1723
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1724
|
-
*/
|
|
1725
|
-
version: string;
|
|
1726
|
-
/**
|
|
1727
|
-
* Provides the version of the specification for this pilet.
|
|
1728
|
-
*/
|
|
1729
|
-
spec: "v2";
|
|
1730
|
-
/**
|
|
1731
|
-
* The reference name for the global require.
|
|
1732
|
-
*/
|
|
1733
|
-
requireRef: string;
|
|
1734
|
-
/**
|
|
1735
|
-
* The computed integrity of the pilet.
|
|
1736
|
-
*/
|
|
1737
|
-
integrity?: string;
|
|
1738
|
-
/**
|
|
1739
|
-
* The link for retrieving the content of the pilet.
|
|
1740
|
-
*/
|
|
1741
|
-
link: string;
|
|
1742
|
-
/**
|
|
1743
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1744
|
-
*/
|
|
1745
|
-
custom?: any;
|
|
1746
|
-
/**
|
|
1747
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
1748
|
-
*/
|
|
1749
|
-
config?: Record<string, any>;
|
|
1750
|
-
/**
|
|
1751
|
-
* Additional shared dependency script files.
|
|
1752
|
-
*/
|
|
1753
|
-
dependencies?: Record<string, string>;
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
export interface PiletVxEntry {
|
|
1757
|
-
/**
|
|
1758
|
-
* The name of the pilet, i.e., the package id.
|
|
1759
|
-
*/
|
|
1760
|
-
name: string;
|
|
1761
|
-
/**
|
|
1762
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1763
|
-
*/
|
|
1764
|
-
version: string;
|
|
1765
|
-
/**
|
|
1766
|
-
* Provides an identifier for the custom specification.
|
|
1767
|
-
*/
|
|
1768
|
-
spec: string;
|
|
1769
|
-
/**
|
|
1770
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1771
|
-
*/
|
|
1772
|
-
custom?: any;
|
|
1773
|
-
/**
|
|
1774
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
1775
|
-
*/
|
|
1776
|
-
config?: Record<string, any>;
|
|
1777
|
-
/**
|
|
1778
|
-
* Additional shared dependency script files.
|
|
1779
|
-
*/
|
|
1780
|
-
dependencies?: Record<string, string>;
|
|
1781
|
-
}
|
|
1782
|
-
|
|
1783
|
-
export type UseBoundStore<T extends State, CustomStoreApi extends StoreApi<T> = StoreApi<T>> = {
|
|
1784
|
-
(): T;
|
|
1785
|
-
<U>(selector: StateSelector<T, U>, equalityFn?: EqualityChecker<U>): U;
|
|
1786
|
-
} & CustomStoreApi;
|
|
1787
|
-
|
|
1788
|
-
/**
|
|
1789
|
-
* Represents the dictionary of the loaded pilets and their APIs.
|
|
1790
|
-
*/
|
|
1791
|
-
export interface PiletsBag {
|
|
1792
|
-
[name: string]: PiletApi;
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
/**
|
|
1796
|
-
* The options for loading pilets.
|
|
1797
|
-
*/
|
|
1798
|
-
export interface LoadPiletsOptions {
|
|
1799
|
-
/**
|
|
1800
|
-
* The callback function for creating an API object.
|
|
1801
|
-
* The API object is passed on to a specific pilet.
|
|
1802
|
-
*/
|
|
1803
|
-
createApi: PiletApiCreator;
|
|
1804
|
-
/**
|
|
1805
|
-
* The callback for fetching the dynamic pilets.
|
|
1806
|
-
*/
|
|
1807
|
-
fetchPilets: PiletRequester;
|
|
1808
|
-
/**
|
|
1809
|
-
* Optionally, some already existing evaluated pilets, e.g.,
|
|
1810
|
-
* helpful when debugging or in SSR scenarios.
|
|
1811
|
-
*/
|
|
1812
|
-
pilets?: Array<Pilet>;
|
|
1813
|
-
/**
|
|
1814
|
-
* Optionally, configures the default loader.
|
|
1815
|
-
*/
|
|
1816
|
-
config?: DefaultLoaderConfig;
|
|
1817
|
-
/**
|
|
1818
|
-
* Optionally, defines the default way how to load a pilet.
|
|
1819
|
-
*/
|
|
1820
|
-
loadPilet?: PiletLoader;
|
|
1821
|
-
/**
|
|
1822
|
-
* Optionally, defines loaders for custom specifications.
|
|
1823
|
-
*/
|
|
1824
|
-
loaders?: CustomSpecLoaders;
|
|
1825
|
-
/**
|
|
1826
|
-
* Optionally, defines a set of loading hooks to be used.
|
|
1827
|
-
*/
|
|
1828
|
-
hooks?: PiletLifecycleHooks;
|
|
1829
|
-
/**
|
|
1830
|
-
* Gets the map of globally available dependencies with their names
|
|
1831
|
-
* as keys and their evaluated pilet content as value.
|
|
1832
|
-
*/
|
|
1833
|
-
dependencies?: AvailableDependencies;
|
|
1834
|
-
/**
|
|
1835
|
-
* Optionally, defines the loading strategy to use.
|
|
1836
|
-
*/
|
|
1837
|
-
strategy?: PiletLoadingStrategy;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
export interface DashboardContainerProps extends ReactRouter.RouteComponentProps {
|
|
1841
|
-
/**
|
|
1842
|
-
* The tiles to display.
|
|
1843
|
-
*/
|
|
1844
|
-
children?: React.ReactNode;
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
export interface DashboardTileProps {
|
|
1848
|
-
/**
|
|
1849
|
-
* The currently used number of columns.
|
|
1850
|
-
*/
|
|
1851
|
-
columns: number;
|
|
1852
|
-
/**
|
|
1853
|
-
* The currently used number of rows.
|
|
1854
|
-
*/
|
|
1855
|
-
rows: number;
|
|
1856
|
-
/**
|
|
1857
|
-
* The resizable status.
|
|
1858
|
-
*/
|
|
1859
|
-
resizable: boolean;
|
|
1860
|
-
/**
|
|
1861
|
-
* The provided tile preferences.
|
|
1862
|
-
*/
|
|
1863
|
-
meta: TilePreferences;
|
|
1864
|
-
/**
|
|
1865
|
-
* The content of the tile to display.
|
|
1866
|
-
*/
|
|
1867
|
-
children?: React.ReactNode;
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
export type UnionOf<T> = {
|
|
1871
|
-
[K in keyof T]: T[K];
|
|
1872
|
-
}[keyof T];
|
|
1873
|
-
|
|
1874
|
-
/**
|
|
1875
|
-
* The different known layout types.
|
|
1876
|
-
*/
|
|
1877
|
-
export type LayoutType = "mobile" | "tablet" | "desktop";
|
|
1878
|
-
|
|
1879
|
-
/**
|
|
1880
|
-
* Represents a path in the app registration.
|
|
1881
|
-
*/
|
|
1882
|
-
export interface AppPath {
|
|
1883
|
-
/**
|
|
1884
|
-
* The exact path to use.
|
|
1885
|
-
*/
|
|
1886
|
-
path: string;
|
|
1887
|
-
/**
|
|
1888
|
-
* The component to register for this path.
|
|
1889
|
-
*/
|
|
1890
|
-
Component: React.ComponentType<ReactRouter.RouteComponentProps>;
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
/**
|
|
1894
|
-
* Custom errors defined outside of piral-core.
|
|
1895
|
-
*/
|
|
1896
|
-
export interface PiralCustomErrors {
|
|
1897
|
-
tile: TileErrorInfoProps;
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
/**
|
|
1901
|
-
* The error used when a registered extension component crashed.
|
|
1902
|
-
*/
|
|
1903
|
-
export interface ExtensionErrorInfoProps {
|
|
1904
|
-
/**
|
|
1905
|
-
* The type of the error.
|
|
1906
|
-
*/
|
|
1907
|
-
type: "extension";
|
|
1908
|
-
/**
|
|
1909
|
-
* The provided error details.
|
|
1910
|
-
*/
|
|
1911
|
-
error: any;
|
|
1912
|
-
/**
|
|
1913
|
-
* The name of the pilet emitting the error.
|
|
1914
|
-
*/
|
|
1915
|
-
pilet?: string;
|
|
1916
|
-
}
|
|
1917
|
-
|
|
1918
|
-
/**
|
|
1919
|
-
* The error used when the app could not be loaded.
|
|
1920
|
-
*/
|
|
1921
|
-
export interface LoadingErrorInfoProps {
|
|
1922
|
-
/**
|
|
1923
|
-
* The type of the error.
|
|
1924
|
-
*/
|
|
1925
|
-
type: "loading";
|
|
1926
|
-
/**
|
|
1927
|
-
* The provided error details.
|
|
1928
|
-
*/
|
|
1929
|
-
error: any;
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
/**
|
|
1933
|
-
* The error used when a registered page component crashes.
|
|
1934
|
-
*/
|
|
1935
|
-
export interface PageErrorInfoProps extends ReactRouter.RouteComponentProps {
|
|
1936
|
-
/**
|
|
1937
|
-
* The type of the error.
|
|
1938
|
-
*/
|
|
1939
|
-
type: "page";
|
|
1940
|
-
/**
|
|
1941
|
-
* The provided error details.
|
|
1942
|
-
*/
|
|
1943
|
-
error: any;
|
|
1944
|
-
/**
|
|
1945
|
-
* The name of the pilet emitting the error.
|
|
1946
|
-
*/
|
|
1947
|
-
pilet?: string;
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
/**
|
|
1951
|
-
* The error used when a route cannot be resolved.
|
|
1952
|
-
*/
|
|
1953
|
-
export interface NotFoundErrorInfoProps extends ReactRouter.RouteComponentProps {
|
|
1954
|
-
/**
|
|
1955
|
-
* The type of the error.
|
|
1956
|
-
*/
|
|
1957
|
-
type: "not_found";
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
/**
|
|
1961
|
-
* The error used when the exact type is unknown.
|
|
1962
|
-
*/
|
|
1963
|
-
export interface UnknownErrorInfoProps {
|
|
1964
|
-
/**
|
|
1965
|
-
* The type of the error.
|
|
1966
|
-
*/
|
|
1967
|
-
type: "unknown";
|
|
1968
|
-
/**
|
|
1969
|
-
* The provided error details.
|
|
1970
|
-
*/
|
|
1971
|
-
error: any;
|
|
1972
|
-
/**
|
|
1973
|
-
* The name of the pilet emitting the error.
|
|
1974
|
-
*/
|
|
1975
|
-
pilet?: string;
|
|
1976
|
-
}
|
|
1977
|
-
|
|
1978
|
-
/**
|
|
1979
|
-
* Custom parts of the global registry state defined outside of piral-core.
|
|
1980
|
-
*/
|
|
1981
|
-
export interface PiralCustomRegistryState {
|
|
1982
|
-
/**
|
|
1983
|
-
* The registered tile components for a dashboard.
|
|
1984
|
-
*/
|
|
1985
|
-
tiles: Dict<TileRegistration>;
|
|
1986
|
-
}
|
|
1987
|
-
|
|
1988
|
-
/**
|
|
1989
|
-
* The creator function for the pilet API.
|
|
1990
|
-
*/
|
|
1991
|
-
export interface PiletApiCreator {
|
|
1992
|
-
(target: PiletMetadata): PiletApi;
|
|
1993
|
-
}
|
|
1994
|
-
|
|
1995
|
-
/**
|
|
1996
|
-
* Metadata for pilets using the v0 schema with a content.
|
|
1997
|
-
*/
|
|
1998
|
-
export interface PiletV0ContentEntry extends PiletV0BaseEntry {
|
|
1999
|
-
/**
|
|
2000
|
-
* The content of the pilet. If the content is not available
|
|
2001
|
-
* the link will be used (unless caching has been activated).
|
|
2002
|
-
*/
|
|
2003
|
-
content: string;
|
|
2004
|
-
/**
|
|
2005
|
-
* If available indicates that the pilet should not be cached.
|
|
2006
|
-
* In case of a string this is interpreted as the expiration time
|
|
2007
|
-
* of the cache. In case of an accurate hash this should not be
|
|
2008
|
-
* required or set.
|
|
2009
|
-
*/
|
|
2010
|
-
noCache?: boolean | string;
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
/**
|
|
2014
|
-
* Metadata for pilets using the v0 schema with a link.
|
|
2015
|
-
*/
|
|
2016
|
-
export interface PiletV0LinkEntry extends PiletV0BaseEntry {
|
|
2017
|
-
/**
|
|
2018
|
-
* The link for retrieving the content of the pilet.
|
|
2019
|
-
*/
|
|
2020
|
-
link: string;
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
export type StateSelector<T extends State, U> = (state: T) => U;
|
|
2024
|
-
|
|
2025
|
-
export type EqualityChecker<T> = (state: T, newState: T) => boolean;
|
|
2026
|
-
|
|
2027
|
-
export type State = object;
|
|
2028
|
-
|
|
2029
|
-
export type StoreApi<T extends State> = {
|
|
2030
|
-
setState: SetState<T>;
|
|
2031
|
-
getState: GetState<T>;
|
|
2032
|
-
subscribe: Subscribe<T>;
|
|
2033
|
-
destroy: Destroy;
|
|
2034
|
-
};
|
|
2035
|
-
|
|
2036
|
-
/**
|
|
2037
|
-
* The interface describing a function capable of fetching pilets.
|
|
2038
|
-
*/
|
|
2039
|
-
export interface PiletRequester {
|
|
2040
|
-
(): Promise<PiletEntries>;
|
|
2041
|
-
}
|
|
2042
|
-
|
|
2043
|
-
/**
|
|
2044
|
-
* Additional configuration options for the default loader.
|
|
2045
|
-
*/
|
|
2046
|
-
export interface DefaultLoaderConfig {
|
|
2047
|
-
/**
|
|
2048
|
-
* Sets the cross-origin attribute of potential script tags.
|
|
2049
|
-
* For pilets v1 this may be useful. Otherwise, only pilets that
|
|
2050
|
-
* have an integrity defined will be set to "anonymous".
|
|
2051
|
-
*/
|
|
2052
|
-
crossOrigin?: string;
|
|
2053
|
-
}
|
|
2054
|
-
|
|
2055
|
-
/**
|
|
2056
|
-
* The callback to be used to load a single pilet.
|
|
2057
|
-
*/
|
|
2058
|
-
export interface PiletLoader {
|
|
2059
|
-
(entry: PiletEntry): Promise<Pilet>;
|
|
2060
|
-
}
|
|
2061
|
-
|
|
2062
|
-
/**
|
|
2063
|
-
* Defines the spec identifiers for custom loading.
|
|
2064
|
-
*/
|
|
2065
|
-
export type CustomSpecLoaders = Record<string, PiletLoader>;
|
|
2066
|
-
|
|
2067
|
-
/**
|
|
2068
|
-
* A set of pipeline hooks used by the Piral loading orchestrator.
|
|
2069
|
-
*/
|
|
2070
|
-
export interface PiletLifecycleHooks {
|
|
2071
|
-
/**
|
|
2072
|
-
* Hook fired before a pilet is loaded.
|
|
2073
|
-
*/
|
|
2074
|
-
loadPilet?(pilet: PiletMetadata): void;
|
|
2075
|
-
/**
|
|
2076
|
-
* Hook fired before a pilet is being set up.
|
|
2077
|
-
*/
|
|
2078
|
-
setupPilet?(pilet: Pilet): void;
|
|
2079
|
-
/**
|
|
2080
|
-
* Hook fired before a pilet is being cleaned up.
|
|
2081
|
-
*/
|
|
2082
|
-
cleanupPilet?(pilet: Pilet): void;
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
/**
|
|
2086
|
-
* The record containing all available dependencies.
|
|
2087
|
-
*/
|
|
2088
|
-
export interface AvailableDependencies {
|
|
2089
|
-
[name: string]: any;
|
|
2090
|
-
}
|
|
2091
|
-
|
|
2092
|
-
/**
|
|
2093
|
-
* The strategy for how pilets are loaded at runtime.
|
|
2094
|
-
*/
|
|
2095
|
-
export interface PiletLoadingStrategy {
|
|
2096
|
-
(options: LoadPiletsOptions, pilets: PiletsLoaded): PromiseLike<void>;
|
|
2097
|
-
}
|
|
2098
|
-
|
|
2099
|
-
export interface TileErrorInfoProps {
|
|
2100
|
-
/**
|
|
2101
|
-
* The type of the error.
|
|
2102
|
-
*/
|
|
2103
|
-
type: "tile";
|
|
2104
|
-
/**
|
|
2105
|
-
* The provided error details.
|
|
2106
|
-
*/
|
|
2107
|
-
error: any;
|
|
2108
|
-
/**
|
|
2109
|
-
* The currently used number of columns.
|
|
2110
|
-
*/
|
|
2111
|
-
columns: number;
|
|
2112
|
-
/**
|
|
2113
|
-
* The currently used number of rows.
|
|
2114
|
-
*/
|
|
2115
|
-
rows: number;
|
|
2116
|
-
/**
|
|
2117
|
-
* The name of the pilet emitting the error.
|
|
2118
|
-
*/
|
|
2119
|
-
pilet?: string;
|
|
2120
|
-
}
|
|
2121
|
-
|
|
2122
|
-
/**
|
|
2123
|
-
* Basic metadata for pilets using the v0 schema.
|
|
2124
|
-
*/
|
|
2125
|
-
export interface PiletV0BaseEntry {
|
|
2126
|
-
/**
|
|
2127
|
-
* The name of the pilet, i.e., the package id.
|
|
2128
|
-
*/
|
|
2129
|
-
name: string;
|
|
2130
|
-
/**
|
|
2131
|
-
* The version of the pilet. Should be semantically versioned.
|
|
2132
|
-
*/
|
|
2133
|
-
version: string;
|
|
2134
|
-
/**
|
|
2135
|
-
* Optionally provides the version of the specification for this pilet.
|
|
2136
|
-
*/
|
|
2137
|
-
spec?: "v0";
|
|
2138
|
-
/**
|
|
2139
|
-
* The computed hash value of the pilet's content. Should be
|
|
2140
|
-
* accurate to allow caching.
|
|
2141
|
-
*/
|
|
2142
|
-
hash: string;
|
|
2143
|
-
/**
|
|
2144
|
-
* Optionally provides some custom metadata for the pilet.
|
|
2145
|
-
*/
|
|
2146
|
-
custom?: any;
|
|
2147
|
-
/**
|
|
2148
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
2149
|
-
*/
|
|
2150
|
-
config?: Record<string, any>;
|
|
2151
|
-
/**
|
|
2152
|
-
* Additional shared dependency script files.
|
|
2153
|
-
*/
|
|
2154
|
-
dependencies?: Record<string, string>;
|
|
2155
|
-
}
|
|
2156
|
-
|
|
2157
|
-
export type SetState<T extends State> = {
|
|
2158
|
-
<K1 extends keyof T, K2 extends keyof T = K1, K3 extends keyof T = K2, K4 extends keyof T = K3>(partial: PartialState<T, K1, K2, K3, K4>, replace?: boolean): void;
|
|
2159
|
-
};
|
|
2160
|
-
|
|
2161
|
-
export type GetState<T extends State> = () => T;
|
|
2162
|
-
|
|
2163
|
-
export type Subscribe<T extends State> = {
|
|
2164
|
-
(listener: StateListener<T>): () => void;
|
|
2165
|
-
<StateSlice>(listener: StateSliceListener<StateSlice>, selector?: StateSelector<T, StateSlice>, equalityFn?: EqualityChecker<StateSlice>): () => void;
|
|
2166
|
-
};
|
|
2167
|
-
|
|
2168
|
-
export type Destroy = () => void;
|
|
2169
|
-
|
|
2170
|
-
/**
|
|
2171
|
-
* The entries representing pilets from a feed service response.
|
|
2172
|
-
*/
|
|
2173
|
-
export type PiletEntries = Array<PiletEntry>;
|
|
2174
|
-
|
|
2175
|
-
/**
|
|
2176
|
-
* The callback to be used when pilets have been loaded.
|
|
2177
|
-
*/
|
|
2178
|
-
export interface PiletsLoaded {
|
|
2179
|
-
(error: Error | undefined, pilets: Array<Pilet>): void;
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
/**
|
|
2183
|
-
* @deprecated Use the builtin `Partial<T>` instead of `PartialState<T>`.
|
|
2184
|
-
* Additionally turn on `--exactOptionalPropertyTypes` tsc flag.
|
|
2185
|
-
* `PartialState` will be removed in next major
|
|
2186
|
-
*/
|
|
2187
|
-
export type PartialState<T extends State, K1 extends keyof T = keyof T, K2 extends keyof T = K1, K3 extends keyof T = K2, K4 extends keyof T = K3> = (Pick<T, K1> | Pick<T, K2> | Pick<T, K3> | Pick<T, K4> | T) | ((state: T) => Pick<T, K1> | Pick<T, K2> | Pick<T, K3> | Pick<T, K4> | T);
|
|
2188
|
-
|
|
2189
|
-
export type StateListener<T> = (state: T, previousState: T) => void;
|
|
2190
|
-
|
|
2191
|
-
/**
|
|
2192
|
-
* @deprecated Use `StateListener<T>` instead of `StateSliceListener<T>`.
|
|
2193
|
-
*/
|
|
2194
|
-
export type StateSliceListener<T> = (slice: T, previousSlice: T) => void;
|
|
2195
1211
|
}
|