sample-piral 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.d.ts +54 -1547
- package/app/{index.84f68c.js → index.f58779.js} +120 -863
- package/app/index.f58779.js.map +1 -0
- 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.84f68c.js.map +0 -1
package/app/index.d.ts
CHANGED
|
@@ -870,8 +870,8 @@ declare module "sample-piral" {
|
|
|
870
870
|
* The context to be transported into the generic components.
|
|
871
871
|
*/
|
|
872
872
|
export interface ComponentContext {
|
|
873
|
-
|
|
874
|
-
|
|
873
|
+
navigation: NavigationApi;
|
|
874
|
+
publicPath: string;
|
|
875
875
|
}
|
|
876
876
|
|
|
877
877
|
/**
|
|
@@ -886,1585 +886,92 @@ declare module "sample-piral" {
|
|
|
886
886
|
|
|
887
887
|
export type WrappedComponent<TProps> = React.ComponentType<React.PropsWithChildren<Without<TProps, keyof BaseComponentProps>>>;
|
|
888
888
|
|
|
889
|
-
|
|
890
|
-
* The globally defined actions.
|
|
891
|
-
*/
|
|
892
|
-
export interface PiralActions extends PiralCustomActions {
|
|
893
|
-
/**
|
|
894
|
-
* Initializes the application shell.
|
|
895
|
-
* @param loading The current loading state.
|
|
896
|
-
* @param error The application error, if any.
|
|
897
|
-
* @param modules The loaded pilets.
|
|
898
|
-
*/
|
|
899
|
-
initialize(loading: boolean, error: Error | undefined, modules: Array<Pilet>): void;
|
|
900
|
-
/**
|
|
901
|
-
* Injects an evaluated pilet at runtime - removes the pilet from registry first if available.
|
|
902
|
-
* @param pilet The pilet to be injected.
|
|
903
|
-
* @returns The injected pilet.
|
|
904
|
-
*/
|
|
905
|
-
injectPilet(pilet: Pilet): Pilet;
|
|
906
|
-
/**
|
|
907
|
-
* Adds a pilet at runtime by loading it, evaluating it, and then injecting it.
|
|
908
|
-
* @param pilet The pilet to be added.
|
|
909
|
-
* @returns The promise indicating when the pilet was fully added.
|
|
910
|
-
*/
|
|
911
|
-
addPilet(pilet: PiletEntry): Promise<void>;
|
|
912
|
-
/**
|
|
913
|
-
* Removes a pilet by unloading it and deleting all component registrations.
|
|
914
|
-
* @param name The name of the pilet to remove.
|
|
915
|
-
*/
|
|
916
|
-
removePilet(name: string): Promise<void>;
|
|
917
|
-
/**
|
|
918
|
-
* Defines a single action for Piral.
|
|
919
|
-
* @param actionName The name of the action to define.
|
|
920
|
-
* @param action The action to include.
|
|
921
|
-
*/
|
|
922
|
-
defineAction<T extends keyof PiralActions>(actionName: T, action: PiralAction<PiralActions[T]>): void;
|
|
923
|
-
/**
|
|
924
|
-
* Defines a set of actions for Piral.
|
|
925
|
-
* @param actions The actions to define.
|
|
926
|
-
*/
|
|
927
|
-
defineActions(actions: PiralDefineActions): void;
|
|
928
|
-
/**
|
|
929
|
-
* Reads the value of a shared data item.
|
|
930
|
-
* @param name The name of the shared item.
|
|
931
|
-
*/
|
|
932
|
-
readDataValue(name: string): any;
|
|
933
|
-
/**
|
|
934
|
-
* Tries to write a shared data item. The write access is only
|
|
935
|
-
* possible if the name belongs to the provided owner or has not
|
|
936
|
-
* been taken yet.
|
|
937
|
-
* Setting the value to null will release it.
|
|
938
|
-
* @param name The name of the shared data item.
|
|
939
|
-
* @param value The value of the shared data item.
|
|
940
|
-
* @param owner The owner of the shared data item.
|
|
941
|
-
* @param target The target storage locatation.
|
|
942
|
-
* @param expiration The time for when to dispose the shared item.
|
|
943
|
-
*/
|
|
944
|
-
tryWriteDataItem(name: string, value: any, owner: string, target: DataStoreTarget, expiration: number): boolean;
|
|
945
|
-
/**
|
|
946
|
-
* Registers a new route to be resolved.
|
|
947
|
-
* @param route The route to register.
|
|
948
|
-
* @param value The page to be rendered on the route.
|
|
949
|
-
*/
|
|
950
|
-
registerPage(route: string, value: PageRegistration): void;
|
|
951
|
-
/**
|
|
952
|
-
* Unregisters an existing route.
|
|
953
|
-
* @param route The route to be removed.
|
|
954
|
-
*/
|
|
955
|
-
unregisterPage(route: string): void;
|
|
956
|
-
/**
|
|
957
|
-
* Registers a new extension.
|
|
958
|
-
* @param name The name of the extension category.
|
|
959
|
-
* @param value The extension registration.
|
|
960
|
-
*/
|
|
961
|
-
registerExtension(name: string, value: ExtensionRegistration): void;
|
|
962
|
-
/**
|
|
963
|
-
* Unregisters an existing extension.
|
|
964
|
-
* @param name The name of the extension category.
|
|
965
|
-
* @param value The extension that will be removed.
|
|
966
|
-
*/
|
|
967
|
-
unregisterExtension(name: string, reference: any): void;
|
|
968
|
-
/**
|
|
969
|
-
* Sets the common component to render.
|
|
970
|
-
* @param name The name of the component.
|
|
971
|
-
* @param component The component to use for rendering.
|
|
972
|
-
*/
|
|
973
|
-
setComponent<TKey extends keyof ComponentsState>(name: TKey, component: ComponentsState[TKey]): void;
|
|
974
|
-
/**
|
|
975
|
-
* Sets the error component to render.
|
|
976
|
-
* @param type The type of the error.
|
|
977
|
-
* @param component The component to use for rendering.
|
|
978
|
-
*/
|
|
979
|
-
setErrorComponent<TKey extends keyof ErrorComponentsState>(type: TKey, component: ErrorComponentsState[TKey]): void;
|
|
980
|
-
/**
|
|
981
|
-
* Sets the common routes to render.
|
|
982
|
-
* @param path The name of the component.
|
|
983
|
-
* @param component The component to use for rendering.
|
|
984
|
-
*/
|
|
985
|
-
setRoute<T = {}>(path: string, component: React.ComponentType<ReactRouter.RouteComponentProps<T>>): void;
|
|
986
|
-
/**
|
|
987
|
-
* Includes a new provider as a sub-provider to the current provider.
|
|
988
|
-
* @param provider The provider to include.
|
|
989
|
-
*/
|
|
990
|
-
includeProvider(provider: JSX.Element): void;
|
|
991
|
-
/**
|
|
992
|
-
* Destroys (i.e., resets) the given portal instance.
|
|
993
|
-
* @param id The id of the portal to destroy.
|
|
994
|
-
*/
|
|
995
|
-
destroyPortal(id: string): void;
|
|
996
|
-
/**
|
|
997
|
-
* Includes the provided portal in the rendering pipeline.
|
|
998
|
-
* @param id The id of the portal to use.
|
|
999
|
-
* @param entry The child to render.
|
|
1000
|
-
*/
|
|
1001
|
-
showPortal(id: string, entry: React.ReactPortal): void;
|
|
889
|
+
export interface NavigationApi {
|
|
1002
890
|
/**
|
|
1003
|
-
*
|
|
1004
|
-
* @param id The id of the portal to use.
|
|
1005
|
-
* @param entry The child to remove.
|
|
891
|
+
* Pushes a new location onto the history stack.
|
|
1006
892
|
*/
|
|
1007
|
-
|
|
893
|
+
push(target: string, state?: any): void;
|
|
1008
894
|
/**
|
|
1009
|
-
*
|
|
1010
|
-
* @param id The id of the portal to use.
|
|
1011
|
-
* @param current The currently displayed child.
|
|
1012
|
-
* @param next The updated child that should be displayed.
|
|
895
|
+
* Replaces the current location with another.
|
|
1013
896
|
*/
|
|
1014
|
-
|
|
897
|
+
replace(target: string, state?: any): void;
|
|
1015
898
|
/**
|
|
1016
|
-
*
|
|
1017
|
-
* @param update The update function creating a new state.
|
|
899
|
+
* Changes the current index in the history stack by a given delta.
|
|
1018
900
|
*/
|
|
1019
|
-
|
|
901
|
+
go(n: number): void;
|
|
1020
902
|
/**
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1023
|
-
*
|
|
903
|
+
* Prevents changes to the history stack from happening.
|
|
904
|
+
* This is useful when you want to prevent the user navigating
|
|
905
|
+
* away from the current page, for example when they have some
|
|
906
|
+
* unsaved data on the current page.
|
|
907
|
+
* @param blocker The function being called with a transition request.
|
|
908
|
+
* @returns The disposable for stopping the block.
|
|
1024
909
|
*/
|
|
1025
|
-
|
|
910
|
+
block(blocker: NavigationBlocker): Disposable;
|
|
1026
911
|
/**
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
* @param
|
|
912
|
+
* Starts listening for location changes and calls the given
|
|
913
|
+
* callback with an Update when it does.
|
|
914
|
+
* @param listener The function being called when the route changes.
|
|
915
|
+
* @returns The disposable for stopping the block.
|
|
1030
916
|
*/
|
|
1031
|
-
|
|
917
|
+
listen(listener: NavigationListener): Disposable;
|
|
1032
918
|
}
|
|
1033
919
|
|
|
1034
920
|
export type Without<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
1035
921
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
*/
|
|
1039
|
-
export interface PiralCustomActions {
|
|
1040
|
-
/**
|
|
1041
|
-
* Changes the selected language.
|
|
1042
|
-
* @param selected The selected language.
|
|
1043
|
-
*/
|
|
1044
|
-
selectLanguage(selected: string): void;
|
|
1045
|
-
/**
|
|
1046
|
-
* Gets the translation for the given key at the current
|
|
1047
|
-
* language.
|
|
1048
|
-
*/
|
|
1049
|
-
translate(tag: string, variables?: Record<string, string>): string;
|
|
1050
|
-
/**
|
|
1051
|
-
* Sets the translations (both global and local) for
|
|
1052
|
-
* the given language.
|
|
1053
|
-
* @param language The language to set the translations for.
|
|
1054
|
-
* @param data The global and local translations.
|
|
1055
|
-
*/
|
|
1056
|
-
setTranslations(language: string, data: LanguageData): void;
|
|
1057
|
-
/**
|
|
1058
|
-
* Gets the translations (both global and local) for
|
|
1059
|
-
* the given language.
|
|
1060
|
-
* @param language The language to get the translations for.
|
|
1061
|
-
* @result The global and local translations.
|
|
1062
|
-
*/
|
|
1063
|
-
getTranslations(language: string): LanguageData;
|
|
1064
|
-
/**
|
|
1065
|
-
* Registers a new tile.
|
|
1066
|
-
* @param name The name of the tile.
|
|
1067
|
-
* @param value The tile registration.
|
|
1068
|
-
*/
|
|
1069
|
-
registerTile(name: string, value: TileRegistration): void;
|
|
1070
|
-
/**
|
|
1071
|
-
* Unregisters an existing tile.
|
|
1072
|
-
* @param name The name of the tile to be removed.
|
|
1073
|
-
*/
|
|
1074
|
-
unregisterTile(name: string): void;
|
|
1075
|
-
/**
|
|
1076
|
-
* Registers a new menu item.
|
|
1077
|
-
* @param name The name of the menu item.
|
|
1078
|
-
* @param value The menu registration.
|
|
1079
|
-
*/
|
|
1080
|
-
registerMenuItem(name: string, value: MenuItemRegistration): void;
|
|
1081
|
-
/**
|
|
1082
|
-
* Unregisters an existing menu item.
|
|
1083
|
-
* @param name The name of the menu item to be removed.
|
|
1084
|
-
*/
|
|
1085
|
-
unregisterMenuItem(name: string): void;
|
|
1086
|
-
/**
|
|
1087
|
-
* Opens the given notification.
|
|
1088
|
-
* @param notification The notification to show.
|
|
1089
|
-
*/
|
|
1090
|
-
openNotification(notification: OpenNotification): void;
|
|
1091
|
-
/**
|
|
1092
|
-
* Closes the given notification.
|
|
1093
|
-
* @param notification The notification to hide.
|
|
1094
|
-
*/
|
|
1095
|
-
closeNotification(notification: OpenNotification): void;
|
|
1096
|
-
/**
|
|
1097
|
-
* Opens the provided dialog.
|
|
1098
|
-
* @param dialog The dialog to show.
|
|
1099
|
-
*/
|
|
1100
|
-
openModal(dialog: OpenModalDialog): void;
|
|
1101
|
-
/**
|
|
1102
|
-
* Closes the provided dialog.
|
|
1103
|
-
* @param dialog The dialog to hide.
|
|
1104
|
-
*/
|
|
1105
|
-
closeModal(dialog: OpenModalDialog): void;
|
|
1106
|
-
/**
|
|
1107
|
-
* Registers a new modal dialog.
|
|
1108
|
-
* @param name The name of the modal.
|
|
1109
|
-
* @param value The modal registration.
|
|
1110
|
-
*/
|
|
1111
|
-
registerModal(name: string, value: ModalRegistration): void;
|
|
1112
|
-
/**
|
|
1113
|
-
* Unregisters an existing modal dialog.
|
|
1114
|
-
* @param name The name of the modal to be removed.
|
|
1115
|
-
*/
|
|
1116
|
-
unregisterModal(name: string): void;
|
|
1117
|
-
/**
|
|
1118
|
-
* Creates a new (empty) feed.
|
|
1119
|
-
* @param id The id of the feed.
|
|
1120
|
-
*/
|
|
1121
|
-
createFeed(id: string): void;
|
|
1122
|
-
/**
|
|
1123
|
-
* Destroys an existing feed.
|
|
1124
|
-
* @param id The id of the feed.
|
|
1125
|
-
*/
|
|
1126
|
-
destroyFeed(id: string): void;
|
|
1127
|
-
/**
|
|
1128
|
-
* Loads the feed via the provided details.
|
|
1129
|
-
* @param feed The feed details to use for loading.
|
|
1130
|
-
*/
|
|
1131
|
-
loadFeed<TData, TItem>(feed: ConnectorDetails<TData, TItem>): void;
|
|
1132
|
-
/**
|
|
1133
|
-
* Updates an existing feed.
|
|
1134
|
-
* @param id The id of the feed.
|
|
1135
|
-
* @param item The item to pass on to the reducer.
|
|
1136
|
-
* @param reducer The reducer to use.
|
|
1137
|
-
*/
|
|
1138
|
-
updateFeed<TData, TItem>(id: string, item: TItem, reducer: FeedReducer<TData, TItem>): void;
|
|
1139
|
-
/**
|
|
1140
|
-
* Registers a new search provider.
|
|
1141
|
-
* @param name The name of the search provider.
|
|
1142
|
-
* @param value The value representing the provider.
|
|
1143
|
-
*/
|
|
1144
|
-
registerSearchProvider(name: string, value: SearchProviderRegistration): void;
|
|
1145
|
-
/**
|
|
1146
|
-
* Unregisters an existing search provider.
|
|
1147
|
-
* @param name The name of the search provider.
|
|
1148
|
-
*/
|
|
1149
|
-
unregisterSearchProvider(name: string): void;
|
|
1150
|
-
/**
|
|
1151
|
-
* Sets the current search input.
|
|
1152
|
-
* @param input The input to set.
|
|
1153
|
-
*/
|
|
1154
|
-
setSearchInput(input: string): void;
|
|
1155
|
-
/**
|
|
1156
|
-
* Resets the search results.
|
|
1157
|
-
* @param input The input to set.
|
|
1158
|
-
* @param loading Determines if further results are currently loading.
|
|
1159
|
-
*/
|
|
1160
|
-
resetSearchResults(input: string, loading: boolean): void;
|
|
1161
|
-
/**
|
|
1162
|
-
* Appends more results to the existing results.
|
|
1163
|
-
* @param items The items to append.
|
|
1164
|
-
* @param done Determines if more results are pending.
|
|
1165
|
-
*/
|
|
1166
|
-
appendSearchResults(items: Array<React.ReactChild>, done: boolean): void;
|
|
1167
|
-
/**
|
|
1168
|
-
* Prepends more results to the existing results.
|
|
1169
|
-
* @param items The items to prepend.
|
|
1170
|
-
* @param done Determines if more results are pending.
|
|
1171
|
-
*/
|
|
1172
|
-
prependSearchResults(items: Array<React.ReactChild>, done: boolean): void;
|
|
1173
|
-
/**
|
|
1174
|
-
* Triggers the search explicitly.
|
|
1175
|
-
* @param input Optionally sets the query to look for. Otherwise the current input is taken.
|
|
1176
|
-
* @param immediate Optionally, determins if the search was invoked immediately.
|
|
1177
|
-
*/
|
|
1178
|
-
triggerSearch(input?: string, immediate?: boolean): Disposable;
|
|
1179
|
-
/**
|
|
1180
|
-
* Sets the currently logged in user.
|
|
1181
|
-
* @param user The current user or undefined is anonymous.
|
|
1182
|
-
* @param features The features for the current user, if any.
|
|
1183
|
-
* @param permissions The permissions of the current user, if any.
|
|
1184
|
-
*/
|
|
1185
|
-
setUser(user: UserInfo, features: UserFeatures, permissions: UserPermissions): void;
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
/**
|
|
1189
|
-
* An evaluated pilet, i.e., a full pilet: functionality and metadata.
|
|
1190
|
-
*/
|
|
1191
|
-
export type Pilet = SinglePilet | MultiPilet;
|
|
1192
|
-
|
|
1193
|
-
/**
|
|
1194
|
-
* Pilet entry representing part of a response from the feed service.
|
|
1195
|
-
*/
|
|
1196
|
-
export type PiletEntry = MultiPiletEntry | SinglePiletEntry;
|
|
1197
|
-
|
|
1198
|
-
/**
|
|
1199
|
-
* The shape of an app action in Piral.
|
|
1200
|
-
*/
|
|
1201
|
-
export interface PiralAction<T extends (...args: any) => any> {
|
|
1202
|
-
(ctx: GlobalStateContext, ...args: Parameters<T>): ReturnType<T>;
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* A subset of the available app actions in Piral.
|
|
1207
|
-
*/
|
|
1208
|
-
export type PiralDefineActions = Partial<{
|
|
1209
|
-
[P in keyof PiralActions]: PiralAction<PiralActions[P]>;
|
|
1210
|
-
}>;
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* The interface modeling the registration of a pilet page component.
|
|
1214
|
-
*/
|
|
1215
|
-
export interface PageRegistration extends BaseRegistration {
|
|
1216
|
-
/**
|
|
1217
|
-
* The registered page component.
|
|
1218
|
-
*/
|
|
1219
|
-
component: WrappedComponent<PageComponentProps>;
|
|
1220
|
-
/**
|
|
1221
|
-
* The page's associated metadata.
|
|
1222
|
-
*/
|
|
1223
|
-
meta: PiralPageMeta;
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
/**
|
|
1227
|
-
* The Piral global app sub-state container for shared components.
|
|
1228
|
-
*/
|
|
1229
|
-
export interface ComponentsState extends PiralCustomComponentsState {
|
|
1230
|
-
/**
|
|
1231
|
-
* The loading indicator renderer.
|
|
1232
|
-
*/
|
|
1233
|
-
LoadingIndicator: React.ComponentType<LoadingIndicatorProps>;
|
|
1234
|
-
/**
|
|
1235
|
-
* The error renderer.
|
|
1236
|
-
*/
|
|
1237
|
-
ErrorInfo: React.ComponentType<ErrorInfoProps>;
|
|
1238
|
-
/**
|
|
1239
|
-
* The router context.
|
|
1240
|
-
*/
|
|
1241
|
-
Router: React.ComponentType<RouterProps>;
|
|
1242
|
-
/**
|
|
1243
|
-
* The layout used for pages.
|
|
1244
|
-
*/
|
|
1245
|
-
Layout: React.ComponentType<LayoutProps>;
|
|
1246
|
-
/**
|
|
1247
|
-
* The route switch used for determining the route registration.
|
|
1248
|
-
*/
|
|
1249
|
-
RouteSwitch: React.ComponentType<RouteSwitchProps>;
|
|
1250
|
-
/**
|
|
1251
|
-
* A component that can be used for debugging purposes.
|
|
1252
|
-
*/
|
|
1253
|
-
Debug?: React.ComponentType;
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
export type ErrorComponentsState = {
|
|
1257
|
-
[P in keyof Errors]?: React.ComponentType<Errors[P]>;
|
|
1258
|
-
};
|
|
1259
|
-
|
|
1260
|
-
/**
|
|
1261
|
-
* The Piral global app state container.
|
|
1262
|
-
*/
|
|
1263
|
-
export interface GlobalState extends PiralCustomState {
|
|
1264
|
-
/**
|
|
1265
|
-
* The relevant state for the app itself.
|
|
1266
|
-
*/
|
|
1267
|
-
app: AppState;
|
|
1268
|
-
/**
|
|
1269
|
-
* The relevant state for rendering errors of the app.
|
|
1270
|
-
*/
|
|
1271
|
-
errorComponents: ErrorComponentsState;
|
|
1272
|
-
/**
|
|
1273
|
-
* The relevant state for rendering parts of the app.
|
|
1274
|
-
*/
|
|
1275
|
-
components: ComponentsState;
|
|
1276
|
-
/**
|
|
1277
|
-
* The relevant state for the registered components.
|
|
1278
|
-
*/
|
|
1279
|
-
registry: RegistryState;
|
|
1280
|
-
/**
|
|
1281
|
-
* Gets the loaded modules.
|
|
1282
|
-
*/
|
|
1283
|
-
modules: Array<Pilet>;
|
|
1284
|
-
/**
|
|
1285
|
-
* The foreign component portals to render.
|
|
1286
|
-
*/
|
|
1287
|
-
portals: Record<string, Array<React.ReactPortal>>;
|
|
1288
|
-
/**
|
|
1289
|
-
* The application's shared data.
|
|
1290
|
-
*/
|
|
1291
|
-
data: Dict<SharedDataItem>;
|
|
1292
|
-
/**
|
|
1293
|
-
* The used (exact) application routes.
|
|
1294
|
-
*/
|
|
1295
|
-
routes: Dict<React.ComponentType<ReactRouter.RouteComponentProps<any>>>;
|
|
1296
|
-
/**
|
|
1297
|
-
* The current provider.
|
|
1298
|
-
*/
|
|
1299
|
-
provider?: React.ComponentType;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
export interface LanguageData {
|
|
1303
|
-
global: Translations;
|
|
1304
|
-
locals: Array<{
|
|
1305
|
-
name: string;
|
|
1306
|
-
value: Translations;
|
|
1307
|
-
}>;
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
export interface TileRegistration extends BaseRegistration {
|
|
1311
|
-
component: WrappedComponent<TileComponentProps>;
|
|
1312
|
-
preferences: TilePreferences;
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
export interface MenuItemRegistration extends BaseRegistration {
|
|
1316
|
-
component: WrappedComponent<MenuComponentProps>;
|
|
1317
|
-
settings: MenuSettings;
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
export interface OpenNotification {
|
|
1321
|
-
id: string;
|
|
1322
|
-
component: React.ComponentType<BareNotificationProps>;
|
|
1323
|
-
options: NotificationOptions;
|
|
1324
|
-
close(): void;
|
|
1325
|
-
}
|
|
1326
|
-
|
|
1327
|
-
export interface OpenModalDialog {
|
|
1328
|
-
/**
|
|
1329
|
-
* Gets the ID of the modal to open. For tracking its state.
|
|
1330
|
-
*/
|
|
1331
|
-
id: string;
|
|
1332
|
-
/**
|
|
1333
|
-
* Specifies the fully qualified name of the dialog to show.
|
|
1334
|
-
*/
|
|
1335
|
-
name: string;
|
|
1336
|
-
/**
|
|
1337
|
-
* Specifies the alternative (original) name of the dialog to show.
|
|
1338
|
-
*/
|
|
1339
|
-
alternative?: string;
|
|
1340
|
-
/**
|
|
1341
|
-
* Defines the transported options.
|
|
1342
|
-
*/
|
|
1343
|
-
options: BaseModalOptions;
|
|
1344
|
-
/**
|
|
1345
|
-
* Closes the modal dialog.
|
|
1346
|
-
*/
|
|
1347
|
-
close(): void;
|
|
922
|
+
export interface NavigationBlocker {
|
|
923
|
+
(tx: NavigationTransition): void;
|
|
1348
924
|
}
|
|
1349
925
|
|
|
1350
|
-
export interface
|
|
1351
|
-
|
|
1352
|
-
component: WrappedComponent<ModalComponentProps<any>>;
|
|
1353
|
-
defaults: any;
|
|
1354
|
-
layout: ModalLayoutOptions;
|
|
926
|
+
export interface NavigationListener {
|
|
927
|
+
(update: NavigationUpdate): void;
|
|
1355
928
|
}
|
|
1356
929
|
|
|
1357
|
-
export interface
|
|
1358
|
-
|
|
1359
|
-
* The ID of the connector.
|
|
1360
|
-
*/
|
|
1361
|
-
id: string;
|
|
1362
|
-
/**
|
|
1363
|
-
* The dispose function if active.
|
|
1364
|
-
*/
|
|
1365
|
-
dispose?(): void;
|
|
930
|
+
export interface NavigationTransition extends NavigationUpdate {
|
|
931
|
+
retry(): void;
|
|
1366
932
|
}
|
|
1367
933
|
|
|
1368
|
-
export interface
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
clear(): void;
|
|
1372
|
-
onlyImmediate: boolean;
|
|
934
|
+
export interface NavigationUpdate {
|
|
935
|
+
action: NavigationAction;
|
|
936
|
+
location: NavigationLocation;
|
|
1373
937
|
}
|
|
1374
938
|
|
|
1375
|
-
|
|
1376
|
-
* An evaluated single pilet.
|
|
1377
|
-
*/
|
|
1378
|
-
export type SinglePilet = SinglePiletApp & PiletMetadata;
|
|
1379
|
-
|
|
1380
|
-
/**
|
|
1381
|
-
* An evaluated multi pilet.
|
|
1382
|
-
*/
|
|
1383
|
-
export type MultiPilet = MultiPiletApp & PiletMetadata;
|
|
1384
|
-
|
|
1385
|
-
/**
|
|
1386
|
-
* The metadata response for a multi pilet.
|
|
1387
|
-
*/
|
|
1388
|
-
export type MultiPiletEntry = PiletBundleEntry;
|
|
1389
|
-
|
|
1390
|
-
/**
|
|
1391
|
-
* The metadata response for a single pilet.
|
|
1392
|
-
*/
|
|
1393
|
-
export type SinglePiletEntry = PiletV0Entry | PiletV1Entry | PiletV2Entry | PiletVxEntry;
|
|
1394
|
-
|
|
1395
|
-
/**
|
|
1396
|
-
* The Piral app instance context.
|
|
1397
|
-
*/
|
|
1398
|
-
export interface GlobalStateContext extends PiralActions, EventEmitter {
|
|
1399
|
-
/**
|
|
1400
|
-
* The global state context atom.
|
|
1401
|
-
* Changes to the state should always be dispatched via the `dispatch` action.
|
|
1402
|
-
*/
|
|
1403
|
-
state: UseBoundStore<GlobalState>;
|
|
1404
|
-
/**
|
|
1405
|
-
* The API objects created for the loaded pilets.
|
|
1406
|
-
*/
|
|
1407
|
-
apis: PiletsBag;
|
|
1408
|
-
/**
|
|
1409
|
-
* The available component converters.
|
|
1410
|
-
*/
|
|
1411
|
-
converters: ComponentConverters<any>;
|
|
1412
|
-
/**
|
|
1413
|
-
* The initial options.
|
|
1414
|
-
*/
|
|
1415
|
-
options: LoadPiletsOptions;
|
|
1416
|
-
}
|
|
939
|
+
export type NavigationAction = "POP" | "PUSH" | "REPLACE";
|
|
1417
940
|
|
|
1418
|
-
|
|
1419
|
-
* Custom parts of the global custom component state defined outside of piral-core.
|
|
1420
|
-
*/
|
|
1421
|
-
export interface PiralCustomComponentsState {
|
|
1422
|
-
/**
|
|
1423
|
-
* Represents the component for rendering a language selection.
|
|
1424
|
-
*/
|
|
1425
|
-
LanguagesPicker: React.ComponentType<LanguagesPickerProps>;
|
|
1426
|
-
/**
|
|
1427
|
-
* The dashboard container component.
|
|
1428
|
-
*/
|
|
1429
|
-
DashboardContainer: React.ComponentType<DashboardContainerProps>;
|
|
1430
|
-
/**
|
|
1431
|
-
* The dashboard tile component.
|
|
1432
|
-
*/
|
|
1433
|
-
DashboardTile: React.ComponentType<DashboardTileProps>;
|
|
1434
|
-
/**
|
|
1435
|
-
* The menu container component.
|
|
1436
|
-
*/
|
|
1437
|
-
MenuContainer: React.ComponentType<MenuContainerProps>;
|
|
1438
|
-
/**
|
|
1439
|
-
* The menu item component.
|
|
1440
|
-
*/
|
|
1441
|
-
MenuItem: React.ComponentType<MenuItemProps>;
|
|
1442
|
-
/**
|
|
1443
|
-
* The host component for notifications.
|
|
1444
|
-
*/
|
|
1445
|
-
NotificationsHost: React.ComponentType<NotificationsHostProps>;
|
|
1446
|
-
/**
|
|
1447
|
-
* The notification toast component.
|
|
1448
|
-
*/
|
|
1449
|
-
NotificationsToast: React.ComponentType<NotificationsToastProps>;
|
|
1450
|
-
/**
|
|
1451
|
-
* The host component for modal dialogs.
|
|
1452
|
-
*/
|
|
1453
|
-
ModalsHost: React.ComponentType<ModalsHostProps>;
|
|
1454
|
-
/**
|
|
1455
|
-
* The modal dialog component.
|
|
1456
|
-
*/
|
|
1457
|
-
ModalsDialog: React.ComponentType<ModalsDialogProps>;
|
|
941
|
+
export interface NavigationLocation {
|
|
1458
942
|
/**
|
|
1459
|
-
* The
|
|
943
|
+
* The fully qualified URL incl. the origin and base path.
|
|
1460
944
|
*/
|
|
1461
|
-
|
|
945
|
+
href: string;
|
|
1462
946
|
/**
|
|
1463
|
-
* The
|
|
947
|
+
* The location.pathname property is a string that contains an initial "/"
|
|
948
|
+
* followed by the remainder of the URL up to the ?.
|
|
1464
949
|
*/
|
|
1465
|
-
|
|
950
|
+
pathname: string;
|
|
1466
951
|
/**
|
|
1467
|
-
* The
|
|
952
|
+
* The location.search property is a string that contains an initial "?"
|
|
953
|
+
* followed by the key=value pairs in the query string. If there are no
|
|
954
|
+
* parameters, this value may be the empty string (i.e. '').
|
|
1468
955
|
*/
|
|
1469
|
-
|
|
1470
|
-
}
|
|
1471
|
-
|
|
1472
|
-
/**
|
|
1473
|
-
* The props of a Loading indicator component.
|
|
1474
|
-
*/
|
|
1475
|
-
export interface LoadingIndicatorProps {}
|
|
1476
|
-
|
|
1477
|
-
/**
|
|
1478
|
-
* The props for the ErrorInfo component.
|
|
1479
|
-
*/
|
|
1480
|
-
export type ErrorInfoProps = UnionOf<Errors>;
|
|
1481
|
-
|
|
1482
|
-
/**
|
|
1483
|
-
* The props of a Router component.
|
|
1484
|
-
*/
|
|
1485
|
-
export interface RouterProps {
|
|
956
|
+
search: string;
|
|
1486
957
|
/**
|
|
1487
|
-
* The
|
|
958
|
+
* The location.hash property is a string that contains an initial "#"
|
|
959
|
+
* followed by fragment identifier of the URL. If there is no fragment
|
|
960
|
+
* identifier, this value may be the empty string (i.e. '').
|
|
1488
961
|
*/
|
|
1489
|
-
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
/**
|
|
1493
|
-
* The props of a Layout component.
|
|
1494
|
-
*/
|
|
1495
|
-
export interface LayoutProps {
|
|
962
|
+
hash: string;
|
|
1496
963
|
/**
|
|
1497
|
-
* The
|
|
964
|
+
* The location.state property is a user-supplied State object that is
|
|
965
|
+
* associated with this location. This can be a useful place to store
|
|
966
|
+
* any information you do not want to put in the URL, e.g. session-specific
|
|
967
|
+
* data.
|
|
1498
968
|
*/
|
|
1499
|
-
|
|
969
|
+
state: unknown;
|
|
1500
970
|
/**
|
|
1501
|
-
* The
|
|
971
|
+
* The location.key property is a unique string associated with this location.
|
|
972
|
+
* On the initial location, this will be the string default. On all subsequent
|
|
973
|
+
* locations, this string will be a unique identifier.
|
|
1502
974
|
*/
|
|
1503
|
-
|
|
975
|
+
key: string;
|
|
1504
976
|
}
|
|
1505
|
-
|
|
1506
|
-
/**
|
|
1507
|
-
* The props of the RouteSwitch component.
|
|
1508
|
-
*/
|
|
1509
|
-
export interface RouteSwitchProps extends ReactRouter.SwitchProps {
|
|
1510
|
-
/**
|
|
1511
|
-
* The component that should be used in case nothing was found.
|
|
1512
|
-
*/
|
|
1513
|
-
NotFound: React.ComponentType<ReactRouter.RouteComponentProps>;
|
|
1514
|
-
/**
|
|
1515
|
-
* The component to register for the different paths.
|
|
1516
|
-
*/
|
|
1517
|
-
paths: Array<AppPath>;
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
/**
|
|
1521
|
-
* Map of all error types to their respective props.
|
|
1522
|
-
*/
|
|
1523
|
-
export interface Errors extends PiralCustomErrors {
|
|
1524
|
-
/**
|
|
1525
|
-
* The props type for an extension error.
|
|
1526
|
-
*/
|
|
1527
|
-
extension: ExtensionErrorInfoProps;
|
|
1528
|
-
/**
|
|
1529
|
-
* The props type for a loading error.
|
|
1530
|
-
*/
|
|
1531
|
-
loading: LoadingErrorInfoProps;
|
|
1532
|
-
/**
|
|
1533
|
-
* The props type for a page error.
|
|
1534
|
-
*/
|
|
1535
|
-
page: PageErrorInfoProps;
|
|
1536
|
-
/**
|
|
1537
|
-
* The props type for a not found error.
|
|
1538
|
-
*/
|
|
1539
|
-
not_found: NotFoundErrorInfoProps;
|
|
1540
|
-
/**
|
|
1541
|
-
* The props type for an unknown error.
|
|
1542
|
-
*/
|
|
1543
|
-
unknown: UnknownErrorInfoProps;
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
/**
|
|
1547
|
-
* Custom state extensions defined outside of piral-core.
|
|
1548
|
-
*/
|
|
1549
|
-
export interface PiralCustomState {
|
|
1550
|
-
/**
|
|
1551
|
-
* Information for the language display.
|
|
1552
|
-
*/
|
|
1553
|
-
language: {
|
|
1554
|
-
/**
|
|
1555
|
-
* Gets if languages are currently loading.
|
|
1556
|
-
*/
|
|
1557
|
-
loading: boolean;
|
|
1558
|
-
/**
|
|
1559
|
-
* The selected, i.e., active, language.
|
|
1560
|
-
*/
|
|
1561
|
-
selected: string;
|
|
1562
|
-
/**
|
|
1563
|
-
* The available languages.
|
|
1564
|
-
*/
|
|
1565
|
-
available: Array<string>;
|
|
1566
|
-
};
|
|
1567
|
-
/**
|
|
1568
|
-
* The currently open notifications.
|
|
1569
|
-
*/
|
|
1570
|
-
notifications: Array<OpenNotification>;
|
|
1571
|
-
/**
|
|
1572
|
-
* The currently open modal dialogs.
|
|
1573
|
-
*/
|
|
1574
|
-
modals: Array<OpenModalDialog>;
|
|
1575
|
-
/**
|
|
1576
|
-
* The relevant state for the registered feeds.
|
|
1577
|
-
*/
|
|
1578
|
-
feeds: FeedsState;
|
|
1579
|
-
/**
|
|
1580
|
-
* The relevant state for the in-site search.
|
|
1581
|
-
*/
|
|
1582
|
-
search: SearchState;
|
|
1583
|
-
/**
|
|
1584
|
-
* The currently authenticated user, if any.
|
|
1585
|
-
*/
|
|
1586
|
-
user: UserInfo | undefined;
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
/**
|
|
1590
|
-
* The Piral global app sub-state container for app information.
|
|
1591
|
-
*/
|
|
1592
|
-
export interface AppState {
|
|
1593
|
-
/**
|
|
1594
|
-
* Gets if the application is currently performing a background loading
|
|
1595
|
-
* activity, e.g., for loading modules asynchronously or fetching
|
|
1596
|
-
* translations.
|
|
1597
|
-
*/
|
|
1598
|
-
loading: boolean;
|
|
1599
|
-
/**
|
|
1600
|
-
* Gets an unrecoverable application error, if any.
|
|
1601
|
-
*/
|
|
1602
|
-
error: Error | undefined;
|
|
1603
|
-
/**
|
|
1604
|
-
* Gets the public path of the application.
|
|
1605
|
-
*/
|
|
1606
|
-
publicPath: string;
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
/**
|
|
1610
|
-
* The Piral global app sub-state container for component registrations.
|
|
1611
|
-
*/
|
|
1612
|
-
export interface RegistryState extends PiralCustomRegistryState {
|
|
1613
|
-
/**
|
|
1614
|
-
* The registered page components for the router.
|
|
1615
|
-
*/
|
|
1616
|
-
pages: Dict<PageRegistration>;
|
|
1617
|
-
/**
|
|
1618
|
-
* The registered extension components for extension slots.
|
|
1619
|
-
*/
|
|
1620
|
-
extensions: Dict<Array<ExtensionRegistration>>;
|
|
1621
|
-
/**
|
|
1622
|
-
* The registered wrappers for any component.
|
|
1623
|
-
*/
|
|
1624
|
-
wrappers: Dict<React.ComponentType<any>>;
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
export type Dict<T> = Record<string, T>;
|
|
1628
|
-
|
|
1629
|
-
/**
|
|
1630
|
-
* Defines the shape of a shared data item.
|
|
1631
|
-
*/
|
|
1632
|
-
export interface SharedDataItem<TValue = any> {
|
|
1633
|
-
/**
|
|
1634
|
-
* Gets the associated value.
|
|
1635
|
-
*/
|
|
1636
|
-
value: TValue;
|
|
1637
|
-
/**
|
|
1638
|
-
* Gets the owner of the item.
|
|
1639
|
-
*/
|
|
1640
|
-
owner: string;
|
|
1641
|
-
/**
|
|
1642
|
-
* Gets the storage location.
|
|
1643
|
-
*/
|
|
1644
|
-
target: DataStoreTarget;
|
|
1645
|
-
/**
|
|
1646
|
-
* Gets the expiration of the item.
|
|
1647
|
-
*/
|
|
1648
|
-
expires: number;
|
|
1649
|
-
}
|
|
1650
|
-
|
|
1651
|
-
export interface SearchHandler {
|
|
1652
|
-
(options: SearchOptions): Promise<Array<React.ReactChild>>;
|
|
1653
|
-
}
|
|
1654
|
-
|
|
1655
|
-
/**
|
|
1656
|
-
* The pilet app, i.e., the functional exports.
|
|
1657
|
-
*/
|
|
1658
|
-
export interface SinglePiletApp {
|
|
1659
|
-
/**
|
|
1660
|
-
* Integrates the evaluated pilet into the application.
|
|
1661
|
-
* @param api The API to access the application.
|
|
1662
|
-
*/
|
|
1663
|
-
setup(api: PiletApi): void | Promise<void>;
|
|
1664
|
-
/**
|
|
1665
|
-
* Optional function for cleanup.
|
|
1666
|
-
* @param api The API to access the application.
|
|
1667
|
-
*/
|
|
1668
|
-
teardown?(api: PiletApi): void;
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
/**
|
|
1672
|
-
* The pilet app, i.e., the functional exports.
|
|
1673
|
-
*/
|
|
1674
|
-
export interface MultiPiletApp {
|
|
1675
|
-
/**
|
|
1676
|
-
* Integrates the evaluated pilet into the application.
|
|
1677
|
-
* @param api The API to access the application.
|
|
1678
|
-
*/
|
|
1679
|
-
setup(apiFactory: PiletApiCreator): void | Promise<void>;
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
|
-
/**
|
|
1683
|
-
* Metadata for pilets using the bundle schema.
|
|
1684
|
-
*/
|
|
1685
|
-
export interface PiletBundleEntry {
|
|
1686
|
-
/**
|
|
1687
|
-
* The name of the bundle pilet, i.e., the package id.
|
|
1688
|
-
*/
|
|
1689
|
-
name?: string;
|
|
1690
|
-
/**
|
|
1691
|
-
* Optionally provides the version of the specification for this pilet.
|
|
1692
|
-
*/
|
|
1693
|
-
spec?: "v1";
|
|
1694
|
-
/**
|
|
1695
|
-
* The link for retrieving the bundle content of the pilet.
|
|
1696
|
-
*/
|
|
1697
|
-
link: string;
|
|
1698
|
-
/**
|
|
1699
|
-
* The reference name for the global bundle-shared require.
|
|
1700
|
-
*/
|
|
1701
|
-
bundle: string;
|
|
1702
|
-
/**
|
|
1703
|
-
* The computed integrity of the pilet. Will be used to set the
|
|
1704
|
-
* integrity value of the script.
|
|
1705
|
-
*/
|
|
1706
|
-
integrity?: string;
|
|
1707
|
-
/**
|
|
1708
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1709
|
-
*/
|
|
1710
|
-
custom?: any;
|
|
1711
|
-
/**
|
|
1712
|
-
* Additional shared dependency script files.
|
|
1713
|
-
*/
|
|
1714
|
-
dependencies?: Record<string, string>;
|
|
1715
|
-
}
|
|
1716
|
-
|
|
1717
|
-
/**
|
|
1718
|
-
* Metadata for pilets using the v0 schema.
|
|
1719
|
-
*/
|
|
1720
|
-
export type PiletV0Entry = PiletV0ContentEntry | PiletV0LinkEntry;
|
|
1721
|
-
|
|
1722
|
-
/**
|
|
1723
|
-
* Metadata for pilets using the v1 schema.
|
|
1724
|
-
*/
|
|
1725
|
-
export interface PiletV1Entry {
|
|
1726
|
-
/**
|
|
1727
|
-
* The name of the pilet, i.e., the package id.
|
|
1728
|
-
*/
|
|
1729
|
-
name: string;
|
|
1730
|
-
/**
|
|
1731
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1732
|
-
*/
|
|
1733
|
-
version: string;
|
|
1734
|
-
/**
|
|
1735
|
-
* Optionally provides the version of the specification for this pilet.
|
|
1736
|
-
*/
|
|
1737
|
-
spec?: "v1";
|
|
1738
|
-
/**
|
|
1739
|
-
* The link for retrieving the content of the pilet.
|
|
1740
|
-
*/
|
|
1741
|
-
link: string;
|
|
1742
|
-
/**
|
|
1743
|
-
* The reference name for the global require.
|
|
1744
|
-
*/
|
|
1745
|
-
requireRef: string;
|
|
1746
|
-
/**
|
|
1747
|
-
* The computed integrity of the pilet. Will be used to set the
|
|
1748
|
-
* integrity value of the script.
|
|
1749
|
-
*/
|
|
1750
|
-
integrity?: string;
|
|
1751
|
-
/**
|
|
1752
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1753
|
-
*/
|
|
1754
|
-
custom?: any;
|
|
1755
|
-
/**
|
|
1756
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
1757
|
-
*/
|
|
1758
|
-
config?: Record<string, any>;
|
|
1759
|
-
/**
|
|
1760
|
-
* Additional shared dependency script files.
|
|
1761
|
-
*/
|
|
1762
|
-
dependencies?: Record<string, string>;
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
/**
|
|
1766
|
-
* Metadata for pilets using the v2 schema.
|
|
1767
|
-
*/
|
|
1768
|
-
export interface PiletV2Entry {
|
|
1769
|
-
/**
|
|
1770
|
-
* The name of the pilet, i.e., the package id.
|
|
1771
|
-
*/
|
|
1772
|
-
name: string;
|
|
1773
|
-
/**
|
|
1774
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1775
|
-
*/
|
|
1776
|
-
version: string;
|
|
1777
|
-
/**
|
|
1778
|
-
* Provides the version of the specification for this pilet.
|
|
1779
|
-
*/
|
|
1780
|
-
spec: "v2";
|
|
1781
|
-
/**
|
|
1782
|
-
* The reference name for the global require.
|
|
1783
|
-
*/
|
|
1784
|
-
requireRef: string;
|
|
1785
|
-
/**
|
|
1786
|
-
* The computed integrity of the pilet.
|
|
1787
|
-
*/
|
|
1788
|
-
integrity?: string;
|
|
1789
|
-
/**
|
|
1790
|
-
* The link for retrieving the content of the pilet.
|
|
1791
|
-
*/
|
|
1792
|
-
link: string;
|
|
1793
|
-
/**
|
|
1794
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1795
|
-
*/
|
|
1796
|
-
custom?: any;
|
|
1797
|
-
/**
|
|
1798
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
1799
|
-
*/
|
|
1800
|
-
config?: Record<string, any>;
|
|
1801
|
-
/**
|
|
1802
|
-
* Additional shared dependency script files.
|
|
1803
|
-
*/
|
|
1804
|
-
dependencies?: Record<string, string>;
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
export interface PiletVxEntry {
|
|
1808
|
-
/**
|
|
1809
|
-
* The name of the pilet, i.e., the package id.
|
|
1810
|
-
*/
|
|
1811
|
-
name: string;
|
|
1812
|
-
/**
|
|
1813
|
-
* The version of the pilet. Should be semantically versioned.
|
|
1814
|
-
*/
|
|
1815
|
-
version: string;
|
|
1816
|
-
/**
|
|
1817
|
-
* Provides an identifier for the custom specification.
|
|
1818
|
-
*/
|
|
1819
|
-
spec: string;
|
|
1820
|
-
/**
|
|
1821
|
-
* Optionally provides some custom metadata for the pilet.
|
|
1822
|
-
*/
|
|
1823
|
-
custom?: any;
|
|
1824
|
-
/**
|
|
1825
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
1826
|
-
*/
|
|
1827
|
-
config?: Record<string, any>;
|
|
1828
|
-
/**
|
|
1829
|
-
* Additional shared dependency script files.
|
|
1830
|
-
*/
|
|
1831
|
-
dependencies?: Record<string, string>;
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
export type UseBoundStore<T extends State, CustomStoreApi extends StoreApi<T> = StoreApi<T>> = {
|
|
1835
|
-
(): T;
|
|
1836
|
-
<U>(selector: StateSelector<T, U>, equalityFn?: EqualityChecker<U>): U;
|
|
1837
|
-
} & CustomStoreApi;
|
|
1838
|
-
|
|
1839
|
-
/**
|
|
1840
|
-
* Represents the dictionary of the loaded pilets and their APIs.
|
|
1841
|
-
*/
|
|
1842
|
-
export interface PiletsBag {
|
|
1843
|
-
[name: string]: PiletApi;
|
|
1844
|
-
}
|
|
1845
|
-
|
|
1846
|
-
/**
|
|
1847
|
-
* The options for loading pilets.
|
|
1848
|
-
*/
|
|
1849
|
-
export interface LoadPiletsOptions {
|
|
1850
|
-
/**
|
|
1851
|
-
* The callback function for creating an API object.
|
|
1852
|
-
* The API object is passed on to a specific pilet.
|
|
1853
|
-
*/
|
|
1854
|
-
createApi: PiletApiCreator;
|
|
1855
|
-
/**
|
|
1856
|
-
* The callback for fetching the dynamic pilets.
|
|
1857
|
-
*/
|
|
1858
|
-
fetchPilets: PiletRequester;
|
|
1859
|
-
/**
|
|
1860
|
-
* Optionally, some already existing evaluated pilets, e.g.,
|
|
1861
|
-
* helpful when debugging or in SSR scenarios.
|
|
1862
|
-
*/
|
|
1863
|
-
pilets?: Array<Pilet>;
|
|
1864
|
-
/**
|
|
1865
|
-
* Optionally, configures the default loader.
|
|
1866
|
-
*/
|
|
1867
|
-
config?: DefaultLoaderConfig;
|
|
1868
|
-
/**
|
|
1869
|
-
* Optionally, defines the default way how to load a pilet.
|
|
1870
|
-
*/
|
|
1871
|
-
loadPilet?: PiletLoader;
|
|
1872
|
-
/**
|
|
1873
|
-
* Optionally, defines loaders for custom specifications.
|
|
1874
|
-
*/
|
|
1875
|
-
loaders?: CustomSpecLoaders;
|
|
1876
|
-
/**
|
|
1877
|
-
* Optionally, defines a set of loading hooks to be used.
|
|
1878
|
-
*/
|
|
1879
|
-
hooks?: PiletLifecycleHooks;
|
|
1880
|
-
/**
|
|
1881
|
-
* Gets the map of globally available dependencies with their names
|
|
1882
|
-
* as keys and their evaluated pilet content as value.
|
|
1883
|
-
*/
|
|
1884
|
-
dependencies?: AvailableDependencies;
|
|
1885
|
-
/**
|
|
1886
|
-
* Optionally, defines the loading strategy to use.
|
|
1887
|
-
*/
|
|
1888
|
-
strategy?: PiletLoadingStrategy;
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
export interface LanguagesPickerProps {
|
|
1892
|
-
/**
|
|
1893
|
-
* The currently selected language.
|
|
1894
|
-
*/
|
|
1895
|
-
selected: string;
|
|
1896
|
-
/**
|
|
1897
|
-
* The languages available for selection.
|
|
1898
|
-
*/
|
|
1899
|
-
available: Array<string>;
|
|
1900
|
-
}
|
|
1901
|
-
|
|
1902
|
-
export interface DashboardContainerProps extends ReactRouter.RouteComponentProps {
|
|
1903
|
-
/**
|
|
1904
|
-
* The tiles to display.
|
|
1905
|
-
*/
|
|
1906
|
-
children?: React.ReactNode;
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
export interface DashboardTileProps {
|
|
1910
|
-
/**
|
|
1911
|
-
* The currently used number of columns.
|
|
1912
|
-
*/
|
|
1913
|
-
columns: number;
|
|
1914
|
-
/**
|
|
1915
|
-
* The currently used number of rows.
|
|
1916
|
-
*/
|
|
1917
|
-
rows: number;
|
|
1918
|
-
/**
|
|
1919
|
-
* The resizable status.
|
|
1920
|
-
*/
|
|
1921
|
-
resizable: boolean;
|
|
1922
|
-
/**
|
|
1923
|
-
* The provided tile preferences.
|
|
1924
|
-
*/
|
|
1925
|
-
meta: TilePreferences;
|
|
1926
|
-
/**
|
|
1927
|
-
* The content of the tile to display.
|
|
1928
|
-
*/
|
|
1929
|
-
children?: React.ReactNode;
|
|
1930
|
-
}
|
|
1931
|
-
|
|
1932
|
-
export interface MenuContainerProps {
|
|
1933
|
-
/**
|
|
1934
|
-
* The type of the menu.
|
|
1935
|
-
*/
|
|
1936
|
-
type: MenuType;
|
|
1937
|
-
/**
|
|
1938
|
-
* The menu items to display.
|
|
1939
|
-
*/
|
|
1940
|
-
children?: React.ReactNode;
|
|
1941
|
-
}
|
|
1942
|
-
|
|
1943
|
-
export interface MenuItemProps {
|
|
1944
|
-
/**
|
|
1945
|
-
* The type of the menu.
|
|
1946
|
-
*/
|
|
1947
|
-
type: MenuType;
|
|
1948
|
-
/**
|
|
1949
|
-
* The provided menu settings.
|
|
1950
|
-
*/
|
|
1951
|
-
meta: MenuSettings;
|
|
1952
|
-
/**
|
|
1953
|
-
* The content of the menu item.
|
|
1954
|
-
*/
|
|
1955
|
-
children?: React.ReactNode;
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
export interface NotificationsHostProps {
|
|
1959
|
-
/**
|
|
1960
|
-
* The notifications to display.
|
|
1961
|
-
*/
|
|
1962
|
-
children?: React.ReactNode;
|
|
1963
|
-
}
|
|
1964
|
-
|
|
1965
|
-
export interface NotificationsToastProps extends BareNotificationProps {
|
|
1966
|
-
/**
|
|
1967
|
-
* The content of the toast to display.
|
|
1968
|
-
*/
|
|
1969
|
-
children?: React.ReactNode;
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
export interface ModalsHostProps {
|
|
1973
|
-
/**
|
|
1974
|
-
* Gets if the modal is currently open or closed.
|
|
1975
|
-
*/
|
|
1976
|
-
open: boolean;
|
|
1977
|
-
/**
|
|
1978
|
-
* Callback to invoke closing the modal dialog.
|
|
1979
|
-
*/
|
|
1980
|
-
close(): void;
|
|
1981
|
-
/**
|
|
1982
|
-
* The dialogs to display.
|
|
1983
|
-
*/
|
|
1984
|
-
children?: React.ReactNode;
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
export interface ModalsDialogProps extends OpenModalDialog {
|
|
1988
|
-
/**
|
|
1989
|
-
* The layout options given for the current dialog.
|
|
1990
|
-
*/
|
|
1991
|
-
layout: ModalLayoutOptions;
|
|
1992
|
-
/**
|
|
1993
|
-
* The provided default options.
|
|
1994
|
-
*/
|
|
1995
|
-
defaults: any;
|
|
1996
|
-
/**
|
|
1997
|
-
* The content of the dialog to display.
|
|
1998
|
-
*/
|
|
1999
|
-
children?: React.ReactNode;
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2002
|
-
export interface SearchResultProps {
|
|
2003
|
-
/**
|
|
2004
|
-
* The search results to display.
|
|
2005
|
-
*/
|
|
2006
|
-
children?: React.ReactNode;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
export interface SearchContainerProps {
|
|
2010
|
-
/**
|
|
2011
|
-
* Gets if the results are still gathered.
|
|
2012
|
-
*/
|
|
2013
|
-
loading: boolean;
|
|
2014
|
-
/**
|
|
2015
|
-
* The search to display.
|
|
2016
|
-
*/
|
|
2017
|
-
children?: React.ReactNode;
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
export interface SearchInputProps {
|
|
2021
|
-
setValue(value: string): void;
|
|
2022
|
-
value: string;
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
export type UnionOf<T> = {
|
|
2026
|
-
[K in keyof T]: T[K];
|
|
2027
|
-
}[keyof T];
|
|
2028
|
-
|
|
2029
|
-
/**
|
|
2030
|
-
* The different known layout types.
|
|
2031
|
-
*/
|
|
2032
|
-
export type LayoutType = "mobile" | "tablet" | "desktop";
|
|
2033
|
-
|
|
2034
|
-
/**
|
|
2035
|
-
* Represents a path in the app registration.
|
|
2036
|
-
*/
|
|
2037
|
-
export interface AppPath {
|
|
2038
|
-
/**
|
|
2039
|
-
* The exact path to use.
|
|
2040
|
-
*/
|
|
2041
|
-
path: string;
|
|
2042
|
-
/**
|
|
2043
|
-
* The component to register for this path.
|
|
2044
|
-
*/
|
|
2045
|
-
Component: React.ComponentType<ReactRouter.RouteComponentProps>;
|
|
2046
|
-
}
|
|
2047
|
-
|
|
2048
|
-
/**
|
|
2049
|
-
* Custom errors defined outside of piral-core.
|
|
2050
|
-
*/
|
|
2051
|
-
export interface PiralCustomErrors {
|
|
2052
|
-
tile: TileErrorInfoProps;
|
|
2053
|
-
menu: MenuItemErrorInfoProps;
|
|
2054
|
-
modal: ModalErrorInfoProps;
|
|
2055
|
-
feed: FeedErrorInfoProps;
|
|
2056
|
-
}
|
|
2057
|
-
|
|
2058
|
-
/**
|
|
2059
|
-
* The error used when a registered extension component crashed.
|
|
2060
|
-
*/
|
|
2061
|
-
export interface ExtensionErrorInfoProps {
|
|
2062
|
-
/**
|
|
2063
|
-
* The type of the error.
|
|
2064
|
-
*/
|
|
2065
|
-
type: "extension";
|
|
2066
|
-
/**
|
|
2067
|
-
* The provided error details.
|
|
2068
|
-
*/
|
|
2069
|
-
error: any;
|
|
2070
|
-
/**
|
|
2071
|
-
* The name of the pilet emitting the error.
|
|
2072
|
-
*/
|
|
2073
|
-
pilet?: string;
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2076
|
-
/**
|
|
2077
|
-
* The error used when the app could not be loaded.
|
|
2078
|
-
*/
|
|
2079
|
-
export interface LoadingErrorInfoProps {
|
|
2080
|
-
/**
|
|
2081
|
-
* The type of the error.
|
|
2082
|
-
*/
|
|
2083
|
-
type: "loading";
|
|
2084
|
-
/**
|
|
2085
|
-
* The provided error details.
|
|
2086
|
-
*/
|
|
2087
|
-
error: any;
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
|
-
/**
|
|
2091
|
-
* The error used when a registered page component crashes.
|
|
2092
|
-
*/
|
|
2093
|
-
export interface PageErrorInfoProps extends ReactRouter.RouteComponentProps {
|
|
2094
|
-
/**
|
|
2095
|
-
* The type of the error.
|
|
2096
|
-
*/
|
|
2097
|
-
type: "page";
|
|
2098
|
-
/**
|
|
2099
|
-
* The provided error details.
|
|
2100
|
-
*/
|
|
2101
|
-
error: any;
|
|
2102
|
-
/**
|
|
2103
|
-
* The name of the pilet emitting the error.
|
|
2104
|
-
*/
|
|
2105
|
-
pilet?: string;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
/**
|
|
2109
|
-
* The error used when a route cannot be resolved.
|
|
2110
|
-
*/
|
|
2111
|
-
export interface NotFoundErrorInfoProps extends ReactRouter.RouteComponentProps {
|
|
2112
|
-
/**
|
|
2113
|
-
* The type of the error.
|
|
2114
|
-
*/
|
|
2115
|
-
type: "not_found";
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
/**
|
|
2119
|
-
* The error used when the exact type is unknown.
|
|
2120
|
-
*/
|
|
2121
|
-
export interface UnknownErrorInfoProps {
|
|
2122
|
-
/**
|
|
2123
|
-
* The type of the error.
|
|
2124
|
-
*/
|
|
2125
|
-
type: "unknown";
|
|
2126
|
-
/**
|
|
2127
|
-
* The provided error details.
|
|
2128
|
-
*/
|
|
2129
|
-
error: any;
|
|
2130
|
-
/**
|
|
2131
|
-
* The name of the pilet emitting the error.
|
|
2132
|
-
*/
|
|
2133
|
-
pilet?: string;
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
export interface FeedsState {
|
|
2137
|
-
[id: string]: FeedDataState;
|
|
2138
|
-
}
|
|
2139
|
-
|
|
2140
|
-
export interface SearchState {
|
|
2141
|
-
/**
|
|
2142
|
-
* Gets the current input value.
|
|
2143
|
-
*/
|
|
2144
|
-
input: string;
|
|
2145
|
-
/**
|
|
2146
|
-
* Gets the current result state.
|
|
2147
|
-
*/
|
|
2148
|
-
results: {
|
|
2149
|
-
/**
|
|
2150
|
-
* Gets weather the search is still loading.
|
|
2151
|
-
*/
|
|
2152
|
-
loading: boolean;
|
|
2153
|
-
/**
|
|
2154
|
-
* The results to display for the current search.
|
|
2155
|
-
*/
|
|
2156
|
-
items: Array<React.ReactChild>;
|
|
2157
|
-
};
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
|
-
/**
|
|
2161
|
-
* Custom parts of the global registry state defined outside of piral-core.
|
|
2162
|
-
*/
|
|
2163
|
-
export interface PiralCustomRegistryState {
|
|
2164
|
-
/**
|
|
2165
|
-
* The registered tile components for a dashboard.
|
|
2166
|
-
*/
|
|
2167
|
-
tiles: Dict<TileRegistration>;
|
|
2168
|
-
/**
|
|
2169
|
-
* The registered menu items for global display.
|
|
2170
|
-
*/
|
|
2171
|
-
menuItems: Dict<MenuItemRegistration>;
|
|
2172
|
-
/**
|
|
2173
|
-
* The registered modal dialog components.
|
|
2174
|
-
*/
|
|
2175
|
-
modals: Dict<ModalRegistration>;
|
|
2176
|
-
/**
|
|
2177
|
-
* The registered search providers for context aware search.
|
|
2178
|
-
*/
|
|
2179
|
-
searchProviders: Dict<SearchProviderRegistration>;
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
/**
|
|
2183
|
-
* The creator function for the pilet API.
|
|
2184
|
-
*/
|
|
2185
|
-
export interface PiletApiCreator {
|
|
2186
|
-
(target: PiletMetadata): PiletApi;
|
|
2187
|
-
}
|
|
2188
|
-
|
|
2189
|
-
/**
|
|
2190
|
-
* Metadata for pilets using the v0 schema with a content.
|
|
2191
|
-
*/
|
|
2192
|
-
export interface PiletV0ContentEntry extends PiletV0BaseEntry {
|
|
2193
|
-
/**
|
|
2194
|
-
* The content of the pilet. If the content is not available
|
|
2195
|
-
* the link will be used (unless caching has been activated).
|
|
2196
|
-
*/
|
|
2197
|
-
content: string;
|
|
2198
|
-
/**
|
|
2199
|
-
* If available indicates that the pilet should not be cached.
|
|
2200
|
-
* In case of a string this is interpreted as the expiration time
|
|
2201
|
-
* of the cache. In case of an accurate hash this should not be
|
|
2202
|
-
* required or set.
|
|
2203
|
-
*/
|
|
2204
|
-
noCache?: boolean | string;
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
/**
|
|
2208
|
-
* Metadata for pilets using the v0 schema with a link.
|
|
2209
|
-
*/
|
|
2210
|
-
export interface PiletV0LinkEntry extends PiletV0BaseEntry {
|
|
2211
|
-
/**
|
|
2212
|
-
* The link for retrieving the content of the pilet.
|
|
2213
|
-
*/
|
|
2214
|
-
link: string;
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
export type StateSelector<T extends State, U> = (state: T) => U;
|
|
2218
|
-
|
|
2219
|
-
export type EqualityChecker<T> = (state: T, newState: T) => boolean;
|
|
2220
|
-
|
|
2221
|
-
export type State = object;
|
|
2222
|
-
|
|
2223
|
-
export type StoreApi<T extends State> = {
|
|
2224
|
-
setState: SetState<T>;
|
|
2225
|
-
getState: GetState<T>;
|
|
2226
|
-
subscribe: Subscribe<T>;
|
|
2227
|
-
destroy: Destroy;
|
|
2228
|
-
};
|
|
2229
|
-
|
|
2230
|
-
/**
|
|
2231
|
-
* The interface describing a function capable of fetching pilets.
|
|
2232
|
-
*/
|
|
2233
|
-
export interface PiletRequester {
|
|
2234
|
-
(): Promise<PiletEntries>;
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
/**
|
|
2238
|
-
* Additional configuration options for the default loader.
|
|
2239
|
-
*/
|
|
2240
|
-
export interface DefaultLoaderConfig {
|
|
2241
|
-
/**
|
|
2242
|
-
* Sets the cross-origin attribute of potential script tags.
|
|
2243
|
-
* For pilets v1 this may be useful. Otherwise, only pilets that
|
|
2244
|
-
* have an integrity defined will be set to "anonymous".
|
|
2245
|
-
*/
|
|
2246
|
-
crossOrigin?: string;
|
|
2247
|
-
}
|
|
2248
|
-
|
|
2249
|
-
/**
|
|
2250
|
-
* The callback to be used to load a single pilet.
|
|
2251
|
-
*/
|
|
2252
|
-
export interface PiletLoader {
|
|
2253
|
-
(entry: PiletEntry): Promise<Pilet>;
|
|
2254
|
-
}
|
|
2255
|
-
|
|
2256
|
-
/**
|
|
2257
|
-
* Defines the spec identifiers for custom loading.
|
|
2258
|
-
*/
|
|
2259
|
-
export type CustomSpecLoaders = Record<string, PiletLoader>;
|
|
2260
|
-
|
|
2261
|
-
/**
|
|
2262
|
-
* A set of pipeline hooks used by the Piral loading orchestrator.
|
|
2263
|
-
*/
|
|
2264
|
-
export interface PiletLifecycleHooks {
|
|
2265
|
-
/**
|
|
2266
|
-
* Hook fired before a pilet is loaded.
|
|
2267
|
-
*/
|
|
2268
|
-
loadPilet?(pilet: PiletMetadata): void;
|
|
2269
|
-
/**
|
|
2270
|
-
* Hook fired before a pilet is being set up.
|
|
2271
|
-
*/
|
|
2272
|
-
setupPilet?(pilet: Pilet): void;
|
|
2273
|
-
/**
|
|
2274
|
-
* Hook fired before a pilet is being cleaned up.
|
|
2275
|
-
*/
|
|
2276
|
-
cleanupPilet?(pilet: Pilet): void;
|
|
2277
|
-
}
|
|
2278
|
-
|
|
2279
|
-
/**
|
|
2280
|
-
* The record containing all available dependencies.
|
|
2281
|
-
*/
|
|
2282
|
-
export interface AvailableDependencies {
|
|
2283
|
-
[name: string]: any;
|
|
2284
|
-
}
|
|
2285
|
-
|
|
2286
|
-
/**
|
|
2287
|
-
* The strategy for how pilets are loaded at runtime.
|
|
2288
|
-
*/
|
|
2289
|
-
export interface PiletLoadingStrategy {
|
|
2290
|
-
(options: LoadPiletsOptions, pilets: PiletsLoaded): PromiseLike<void>;
|
|
2291
|
-
}
|
|
2292
|
-
|
|
2293
|
-
export interface TileErrorInfoProps {
|
|
2294
|
-
/**
|
|
2295
|
-
* The type of the error.
|
|
2296
|
-
*/
|
|
2297
|
-
type: "tile";
|
|
2298
|
-
/**
|
|
2299
|
-
* The provided error details.
|
|
2300
|
-
*/
|
|
2301
|
-
error: any;
|
|
2302
|
-
/**
|
|
2303
|
-
* The currently used number of columns.
|
|
2304
|
-
*/
|
|
2305
|
-
columns: number;
|
|
2306
|
-
/**
|
|
2307
|
-
* The currently used number of rows.
|
|
2308
|
-
*/
|
|
2309
|
-
rows: number;
|
|
2310
|
-
/**
|
|
2311
|
-
* The name of the pilet emitting the error.
|
|
2312
|
-
*/
|
|
2313
|
-
pilet?: string;
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
|
-
/**
|
|
2317
|
-
* The error used when a registered menu item component crashed.
|
|
2318
|
-
*/
|
|
2319
|
-
export interface MenuItemErrorInfoProps {
|
|
2320
|
-
/**
|
|
2321
|
-
* The type of the error.
|
|
2322
|
-
*/
|
|
2323
|
-
type: "menu";
|
|
2324
|
-
/**
|
|
2325
|
-
* The provided error details.
|
|
2326
|
-
*/
|
|
2327
|
-
error: any;
|
|
2328
|
-
/**
|
|
2329
|
-
* The type of the used menu.
|
|
2330
|
-
*/
|
|
2331
|
-
menu: MenuType;
|
|
2332
|
-
/**
|
|
2333
|
-
* The name of the pilet emitting the error.
|
|
2334
|
-
*/
|
|
2335
|
-
pilet?: string;
|
|
2336
|
-
}
|
|
2337
|
-
|
|
2338
|
-
/**
|
|
2339
|
-
* The error used when a registered modal dialog crashed.
|
|
2340
|
-
*/
|
|
2341
|
-
export interface ModalErrorInfoProps {
|
|
2342
|
-
/**
|
|
2343
|
-
* The type of the error.
|
|
2344
|
-
*/
|
|
2345
|
-
type: "modal";
|
|
2346
|
-
/**
|
|
2347
|
-
* The provided error details.
|
|
2348
|
-
*/
|
|
2349
|
-
error: any;
|
|
2350
|
-
/**
|
|
2351
|
-
* Callback for closing the modal programmatically.
|
|
2352
|
-
*/
|
|
2353
|
-
onClose(): void;
|
|
2354
|
-
/**
|
|
2355
|
-
* The name of the pilet emitting the error.
|
|
2356
|
-
*/
|
|
2357
|
-
pilet?: string;
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
/**
|
|
2361
|
-
* The error used when loading a feed resulted in an error.
|
|
2362
|
-
*/
|
|
2363
|
-
export interface FeedErrorInfoProps {
|
|
2364
|
-
/**
|
|
2365
|
-
* The type of the error.
|
|
2366
|
-
*/
|
|
2367
|
-
type: "feed";
|
|
2368
|
-
/**
|
|
2369
|
-
* The provided error details.
|
|
2370
|
-
*/
|
|
2371
|
-
error: any;
|
|
2372
|
-
/**
|
|
2373
|
-
* The name of the pilet emitting the error.
|
|
2374
|
-
*/
|
|
2375
|
-
pilet?: string;
|
|
2376
|
-
}
|
|
2377
|
-
|
|
2378
|
-
export interface FeedDataState {
|
|
2379
|
-
/**
|
|
2380
|
-
* Determines if the feed data is currently loading.
|
|
2381
|
-
*/
|
|
2382
|
-
loading: boolean;
|
|
2383
|
-
/**
|
|
2384
|
-
* Indicates if the feed data was already loaded and is active.
|
|
2385
|
-
*/
|
|
2386
|
-
loaded: boolean;
|
|
2387
|
-
/**
|
|
2388
|
-
* Stores the potential error when initializing or loading the feed.
|
|
2389
|
-
*/
|
|
2390
|
-
error: any;
|
|
2391
|
-
/**
|
|
2392
|
-
* The currently stored feed data.
|
|
2393
|
-
*/
|
|
2394
|
-
data: any;
|
|
2395
|
-
}
|
|
2396
|
-
|
|
2397
|
-
/**
|
|
2398
|
-
* Basic metadata for pilets using the v0 schema.
|
|
2399
|
-
*/
|
|
2400
|
-
export interface PiletV0BaseEntry {
|
|
2401
|
-
/**
|
|
2402
|
-
* The name of the pilet, i.e., the package id.
|
|
2403
|
-
*/
|
|
2404
|
-
name: string;
|
|
2405
|
-
/**
|
|
2406
|
-
* The version of the pilet. Should be semantically versioned.
|
|
2407
|
-
*/
|
|
2408
|
-
version: string;
|
|
2409
|
-
/**
|
|
2410
|
-
* Optionally provides the version of the specification for this pilet.
|
|
2411
|
-
*/
|
|
2412
|
-
spec?: "v0";
|
|
2413
|
-
/**
|
|
2414
|
-
* The computed hash value of the pilet's content. Should be
|
|
2415
|
-
* accurate to allow caching.
|
|
2416
|
-
*/
|
|
2417
|
-
hash: string;
|
|
2418
|
-
/**
|
|
2419
|
-
* Optionally provides some custom metadata for the pilet.
|
|
2420
|
-
*/
|
|
2421
|
-
custom?: any;
|
|
2422
|
-
/**
|
|
2423
|
-
* Optionally provides some configuration to be used in the pilet.
|
|
2424
|
-
*/
|
|
2425
|
-
config?: Record<string, any>;
|
|
2426
|
-
/**
|
|
2427
|
-
* Additional shared dependency script files.
|
|
2428
|
-
*/
|
|
2429
|
-
dependencies?: Record<string, string>;
|
|
2430
|
-
}
|
|
2431
|
-
|
|
2432
|
-
export type SetState<T extends State> = {
|
|
2433
|
-
<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;
|
|
2434
|
-
};
|
|
2435
|
-
|
|
2436
|
-
export type GetState<T extends State> = () => T;
|
|
2437
|
-
|
|
2438
|
-
export type Subscribe<T extends State> = {
|
|
2439
|
-
(listener: StateListener<T>): () => void;
|
|
2440
|
-
<StateSlice>(listener: StateSliceListener<StateSlice>, selector?: StateSelector<T, StateSlice>, equalityFn?: EqualityChecker<StateSlice>): () => void;
|
|
2441
|
-
};
|
|
2442
|
-
|
|
2443
|
-
export type Destroy = () => void;
|
|
2444
|
-
|
|
2445
|
-
/**
|
|
2446
|
-
* The entries representing pilets from a feed service response.
|
|
2447
|
-
*/
|
|
2448
|
-
export type PiletEntries = Array<PiletEntry>;
|
|
2449
|
-
|
|
2450
|
-
/**
|
|
2451
|
-
* The callback to be used when pilets have been loaded.
|
|
2452
|
-
*/
|
|
2453
|
-
export interface PiletsLoaded {
|
|
2454
|
-
(error: Error | undefined, pilets: Array<Pilet>): void;
|
|
2455
|
-
}
|
|
2456
|
-
|
|
2457
|
-
/**
|
|
2458
|
-
* @deprecated Use the builtin `Partial<T>` instead of `PartialState<T>`.
|
|
2459
|
-
* Additionally turn on `--exactOptionalPropertyTypes` tsc flag.
|
|
2460
|
-
* `PartialState` will be removed in next major
|
|
2461
|
-
*/
|
|
2462
|
-
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);
|
|
2463
|
-
|
|
2464
|
-
export type StateListener<T> = (state: T, previousState: T) => void;
|
|
2465
|
-
|
|
2466
|
-
/**
|
|
2467
|
-
* @deprecated Use `StateListener<T>` instead of `StateSliceListener<T>`.
|
|
2468
|
-
*/
|
|
2469
|
-
export type StateSliceListener<T> = (slice: T, previousSlice: T) => void;
|
|
2470
977
|
}
|