repluggable-core 0.0.0-pr280.413 → 0.0.0-pr282.418
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/__tests__/spec-setup.js +3 -0
- package/dist/es/{API.d.ts → src/API.d.ts} +31 -10
- package/dist/es/src/API.d.ts.map +1 -0
- package/dist/es/src/API.js +2 -0
- package/dist/es/src/API.js.map +1 -0
- package/dist/es/src/IterableWeakMap.d.ts +20 -0
- package/dist/es/src/IterableWeakMap.d.ts.map +1 -0
- package/dist/es/src/IterableWeakMap.js +92 -0
- package/dist/es/src/IterableWeakMap.js.map +1 -0
- package/dist/es/src/appHost.d.ts +7 -0
- package/dist/es/src/appHost.d.ts.map +1 -0
- package/dist/es/src/appHost.js +848 -0
- package/dist/es/src/appHost.js.map +1 -0
- package/dist/es/src/appHostServices.d.ts +12 -0
- package/dist/es/src/appHostServices.d.ts.map +1 -0
- package/dist/es/src/appHostServices.js +25 -0
- package/dist/es/src/appHostServices.js.map +1 -0
- package/dist/es/src/appHostUtils.d.ts +4 -0
- package/dist/es/src/appHostUtils.d.ts.map +1 -0
- package/dist/es/src/appHostUtils.js +8 -0
- package/dist/es/src/appHostUtils.js.map +1 -0
- package/dist/es/src/extensionSlot.d.ts +8 -0
- package/dist/es/src/extensionSlot.d.ts.map +1 -0
- package/dist/es/src/extensionSlot.js +59 -0
- package/dist/es/src/extensionSlot.js.map +1 -0
- package/dist/es/src/hot.d.ts +14 -0
- package/dist/es/src/hot.d.ts.map +1 -0
- package/dist/es/src/hot.js +52 -0
- package/dist/es/src/hot.js.map +1 -0
- package/dist/es/src/index.d.ts +11 -0
- package/dist/es/src/index.d.ts.map +1 -0
- package/dist/es/src/index.js +10 -0
- package/dist/es/src/index.js.map +1 -0
- package/dist/es/src/installedShellsState.d.ts +19 -0
- package/dist/es/src/installedShellsState.d.ts.map +1 -0
- package/dist/es/src/installedShellsState.js +30 -0
- package/dist/es/src/installedShellsState.js.map +1 -0
- package/dist/es/src/interceptAnyObject.d.ts +7 -0
- package/dist/es/src/interceptAnyObject.d.ts.map +1 -0
- package/dist/es/src/interceptAnyObject.js +21 -0
- package/dist/es/src/interceptAnyObject.js.map +1 -0
- package/dist/es/src/interceptEntryPoints.d.ts +6 -0
- package/dist/es/src/interceptEntryPoints.d.ts.map +1 -0
- package/dist/es/src/interceptEntryPoints.js +22 -0
- package/dist/es/src/interceptEntryPoints.js.map +1 -0
- package/dist/es/src/invokeSlotCallbacks.d.ts +3 -0
- package/dist/es/src/invokeSlotCallbacks.d.ts.map +1 -0
- package/dist/es/src/invokeSlotCallbacks.js +20 -0
- package/dist/es/src/invokeSlotCallbacks.js.map +1 -0
- package/dist/es/src/loggers.d.ts +4 -0
- package/dist/es/src/loggers.d.ts.map +1 -0
- package/dist/es/src/loggers.js +100 -0
- package/dist/es/src/loggers.js.map +1 -0
- package/dist/es/src/monitorAPI.d.ts +3 -0
- package/dist/es/src/monitorAPI.d.ts.map +1 -0
- package/dist/es/src/monitorAPI.js +53 -0
- package/dist/es/src/monitorAPI.js.map +1 -0
- package/dist/es/src/repluggableAppDebug/index.d.ts +2 -0
- package/dist/es/src/repluggableAppDebug/index.d.ts.map +1 -0
- package/dist/es/src/repluggableAppDebug/index.js +2 -0
- package/dist/es/src/repluggableAppDebug/index.js.map +1 -0
- package/dist/es/src/repluggableAppDebug/performanceDebugInfo.d.ts +15 -0
- package/dist/es/src/repluggableAppDebug/performanceDebugInfo.d.ts.map +1 -0
- package/dist/es/src/repluggableAppDebug/performanceDebugInfo.js +94 -0
- package/dist/es/src/repluggableAppDebug/performanceDebugInfo.js.map +1 -0
- package/dist/es/src/repluggableAppDebug/repluggableAppDebug.d.ts +24 -0
- package/dist/es/src/repluggableAppDebug/repluggableAppDebug.d.ts.map +1 -0
- package/dist/es/src/repluggableAppDebug/repluggableAppDebug.js +132 -0
- package/dist/es/src/repluggableAppDebug/repluggableAppDebug.js.map +1 -0
- package/dist/es/src/tarjanGraph.d.ts +27 -0
- package/dist/es/src/tarjanGraph.d.ts.map +1 -0
- package/dist/es/src/tarjanGraph.js +94 -0
- package/dist/es/src/tarjanGraph.js.map +1 -0
- package/dist/es/src/throttledStore.d.ts +32 -0
- package/dist/es/src/throttledStore.d.ts.map +1 -0
- package/dist/es/src/throttledStore.js +240 -0
- package/dist/es/src/throttledStore.js.map +1 -0
- package/dist/es/test/IterableWeakMap.spec.d.ts +2 -0
- package/dist/es/test/IterableWeakMap.spec.d.ts.map +1 -0
- package/dist/es/test/IterableWeakMap.spec.js +218 -0
- package/dist/es/test/IterableWeakMap.spec.js.map +1 -0
- package/dist/es/test/appHost.mock.d.ts +4 -0
- package/dist/es/test/appHost.mock.d.ts.map +1 -0
- package/dist/es/test/appHost.mock.js +54 -0
- package/dist/es/test/appHost.mock.js.map +1 -0
- package/dist/es/test/appHost.spec.d.ts +2 -0
- package/dist/es/test/appHost.spec.d.ts.map +1 -0
- package/dist/es/test/appHost.spec.js +1323 -0
- package/dist/es/test/appHost.spec.js.map +1 -0
- package/dist/es/test/customExtensionSlot.spec.d.ts +2 -0
- package/dist/es/test/customExtensionSlot.spec.d.ts.map +1 -0
- package/dist/es/test/customExtensionSlot.spec.js +112 -0
- package/dist/es/test/customExtensionSlot.spec.js.map +1 -0
- package/dist/es/test/extensionSlot.spec.d.ts +2 -0
- package/dist/es/test/extensionSlot.spec.d.ts.map +1 -0
- package/dist/es/test/extensionSlot.spec.js +73 -0
- package/dist/es/test/extensionSlot.spec.js.map +1 -0
- package/dist/es/test/installedShellsState.spec.d.ts +2 -0
- package/dist/es/test/installedShellsState.spec.d.ts.map +1 -0
- package/dist/es/test/installedShellsState.spec.js +28 -0
- package/dist/es/test/installedShellsState.spec.js.map +1 -0
- package/dist/es/test/interceptAnyObject.spec.d.ts +2 -0
- package/dist/es/test/interceptAnyObject.spec.d.ts.map +1 -0
- package/dist/es/test/interceptAnyObject.spec.js +166 -0
- package/dist/es/test/interceptAnyObject.spec.js.map +1 -0
- package/dist/es/test/interceptEntryPoints.spec.d.ts +2 -0
- package/dist/es/test/interceptEntryPoints.spec.d.ts.map +1 -0
- package/dist/es/test/interceptEntryPoints.spec.js +244 -0
- package/dist/es/test/interceptEntryPoints.spec.js.map +1 -0
- package/dist/es/test/loggers.spec.d.ts +2 -0
- package/dist/es/test/loggers.spec.d.ts.map +1 -0
- package/dist/es/test/loggers.spec.js +218 -0
- package/dist/es/test/loggers.spec.js.map +1 -0
- package/dist/es/test/repluggableAppDebug.spec.d.ts +2 -0
- package/dist/es/test/repluggableAppDebug.spec.d.ts.map +1 -0
- package/dist/es/test/repluggableAppDebug.spec.js +107 -0
- package/dist/es/test/repluggableAppDebug.spec.js.map +1 -0
- package/dist/es/test/testKit.spec.d.ts +2 -0
- package/dist/es/test/testKit.spec.d.ts.map +1 -0
- package/dist/es/test/testKit.spec.js +129 -0
- package/dist/es/test/testKit.spec.js.map +1 -0
- package/dist/es/testKit/emptyLoggerOptions.d.ts +3 -0
- package/dist/es/testKit/emptyLoggerOptions.d.ts.map +1 -0
- package/dist/es/testKit/emptyLoggerOptions.js +15 -0
- package/dist/es/testKit/emptyLoggerOptions.js.map +1 -0
- package/dist/es/testKit/index.d.ts +25 -0
- package/dist/es/testKit/index.d.ts.map +1 -0
- package/dist/es/testKit/index.js +130 -0
- package/dist/es/testKit/index.js.map +1 -0
- package/dist/es/testKit/mockPackage.d.ts +21 -0
- package/dist/es/testKit/mockPackage.d.ts.map +1 -0
- package/dist/es/testKit/mockPackage.js +85 -0
- package/dist/es/testKit/mockPackage.js.map +1 -0
- package/dist/es/testKit/withConsoleErrors.d.ts +2 -0
- package/dist/es/testKit/withConsoleErrors.d.ts.map +1 -0
- package/dist/es/testKit/withConsoleErrors.js +12 -0
- package/dist/es/testKit/withConsoleErrors.js.map +1 -0
- package/dist/es/testKit/withThrowOnError.d.ts +3 -0
- package/dist/es/testKit/withThrowOnError.d.ts.map +1 -0
- package/dist/es/testKit/withThrowOnError.js +27 -0
- package/dist/es/testKit/withThrowOnError.js.map +1 -0
- package/dist/src/API.d.ts +31 -10
- package/dist/src/API.d.ts.map +1 -1
- package/dist/src/API.js +3 -0
- package/dist/src/API.js.map +1 -1
- package/dist/src/IterableWeakMap.d.ts +20 -0
- package/dist/src/IterableWeakMap.d.ts.map +1 -0
- package/dist/src/IterableWeakMap.js +96 -0
- package/dist/src/IterableWeakMap.js.map +1 -0
- package/dist/src/appHost.d.ts +7 -0
- package/dist/src/appHost.d.ts.map +1 -0
- package/dist/src/appHost.js +856 -0
- package/dist/src/appHost.js.map +1 -0
- package/dist/src/appHostServices.d.ts +12 -0
- package/dist/src/appHostServices.d.ts.map +1 -0
- package/dist/src/appHostServices.js +29 -0
- package/dist/src/appHostServices.js.map +1 -0
- package/dist/src/appHostUtils.d.ts +4 -0
- package/dist/src/appHostUtils.d.ts.map +1 -0
- package/dist/src/appHostUtils.js +16 -0
- package/dist/src/appHostUtils.js.map +1 -0
- package/dist/src/extensionSlot.d.ts +8 -0
- package/dist/src/extensionSlot.d.ts.map +1 -0
- package/dist/src/extensionSlot.js +67 -0
- package/dist/src/extensionSlot.js.map +1 -0
- package/dist/src/hot.d.ts +14 -0
- package/dist/src/hot.d.ts.map +1 -0
- package/dist/src/hot.js +56 -0
- package/dist/src/hot.js.map +1 -0
- package/dist/src/index.d.ts +10 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +23 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/installedShellsState.d.ts +19 -0
- package/dist/src/installedShellsState.d.ts.map +1 -0
- package/dist/src/installedShellsState.js +38 -0
- package/dist/src/installedShellsState.js.map +1 -0
- package/dist/src/interceptAnyObject.d.ts +7 -0
- package/dist/src/interceptAnyObject.d.ts.map +1 -0
- package/dist/src/interceptAnyObject.js +28 -0
- package/dist/src/interceptAnyObject.js.map +1 -0
- package/dist/src/interceptEntryPoints.d.ts +6 -0
- package/dist/src/interceptEntryPoints.d.ts.map +1 -0
- package/dist/src/interceptEntryPoints.js +30 -0
- package/dist/src/interceptEntryPoints.js.map +1 -0
- package/dist/src/invokeSlotCallbacks.d.ts +3 -0
- package/dist/src/invokeSlotCallbacks.d.ts.map +1 -0
- package/dist/src/invokeSlotCallbacks.js +24 -0
- package/dist/src/invokeSlotCallbacks.js.map +1 -0
- package/dist/src/loggers.d.ts +4 -0
- package/dist/src/loggers.d.ts.map +1 -0
- package/dist/src/loggers.js +104 -0
- package/dist/src/loggers.js.map +1 -0
- package/dist/src/monitorAPI.d.ts +3 -0
- package/dist/src/monitorAPI.d.ts.map +1 -0
- package/dist/src/monitorAPI.js +57 -0
- package/dist/src/monitorAPI.js.map +1 -0
- package/dist/src/repluggableAppDebug/index.d.ts +2 -0
- package/dist/src/repluggableAppDebug/index.d.ts.map +1 -0
- package/dist/src/repluggableAppDebug/index.js +6 -0
- package/dist/src/repluggableAppDebug/index.js.map +1 -0
- package/dist/src/repluggableAppDebug/performanceDebugInfo.d.ts +15 -0
- package/dist/src/repluggableAppDebug/performanceDebugInfo.d.ts.map +1 -0
- package/dist/src/repluggableAppDebug/performanceDebugInfo.js +101 -0
- package/dist/src/repluggableAppDebug/performanceDebugInfo.js.map +1 -0
- package/dist/src/repluggableAppDebug/repluggableAppDebug.d.ts +24 -0
- package/dist/src/repluggableAppDebug/repluggableAppDebug.d.ts.map +1 -0
- package/dist/src/repluggableAppDebug/repluggableAppDebug.js +139 -0
- package/dist/src/repluggableAppDebug/repluggableAppDebug.js.map +1 -0
- package/dist/src/tarjanGraph.d.ts +27 -0
- package/dist/src/tarjanGraph.d.ts.map +1 -0
- package/dist/src/tarjanGraph.js +100 -0
- package/dist/src/tarjanGraph.js.map +1 -0
- package/dist/src/throttledStore.d.ts +32 -0
- package/dist/src/throttledStore.d.ts.map +1 -0
- package/dist/src/throttledStore.js +249 -0
- package/dist/src/throttledStore.js.map +1 -0
- package/dist/test/IterableWeakMap.spec.d.ts +2 -0
- package/dist/test/IterableWeakMap.spec.d.ts.map +1 -0
- package/dist/test/IterableWeakMap.spec.js +220 -0
- package/dist/test/IterableWeakMap.spec.js.map +1 -0
- package/dist/test/appHost.mock.d.ts +4 -0
- package/dist/test/appHost.mock.d.ts.map +1 -0
- package/dist/test/appHost.mock.js +59 -0
- package/dist/test/appHost.mock.js.map +1 -0
- package/dist/test/appHost.spec.d.ts +2 -0
- package/dist/test/appHost.spec.d.ts.map +1 -0
- package/dist/test/appHost.spec.js +1328 -0
- package/dist/test/appHost.spec.js.map +1 -0
- package/dist/test/customExtensionSlot.spec.d.ts +2 -0
- package/dist/test/customExtensionSlot.spec.d.ts.map +1 -0
- package/dist/test/customExtensionSlot.spec.js +117 -0
- package/dist/test/customExtensionSlot.spec.js.map +1 -0
- package/dist/test/extensionSlot.spec.d.ts +2 -0
- package/dist/test/extensionSlot.spec.d.ts.map +1 -0
- package/dist/test/extensionSlot.spec.js +75 -0
- package/dist/test/extensionSlot.spec.js.map +1 -0
- package/dist/test/installedShellsState.spec.d.ts +2 -0
- package/dist/test/installedShellsState.spec.d.ts.map +1 -0
- package/dist/test/installedShellsState.spec.js +30 -0
- package/dist/test/installedShellsState.spec.js.map +1 -0
- package/dist/test/interceptAnyObject.spec.d.ts +2 -0
- package/dist/test/interceptAnyObject.spec.d.ts.map +1 -0
- package/dist/test/interceptAnyObject.spec.js +171 -0
- package/dist/test/interceptAnyObject.spec.js.map +1 -0
- package/dist/test/interceptEntryPoints.spec.d.ts +2 -0
- package/dist/test/interceptEntryPoints.spec.d.ts.map +1 -0
- package/dist/test/interceptEntryPoints.spec.js +249 -0
- package/dist/test/interceptEntryPoints.spec.js.map +1 -0
- package/dist/test/loggers.spec.d.ts +2 -0
- package/dist/test/loggers.spec.d.ts.map +1 -0
- package/dist/test/loggers.spec.js +220 -0
- package/dist/test/loggers.spec.js.map +1 -0
- package/dist/test/repluggableAppDebug.spec.d.ts +2 -0
- package/dist/test/repluggableAppDebug.spec.d.ts.map +1 -0
- package/dist/test/repluggableAppDebug.spec.js +109 -0
- package/dist/test/repluggableAppDebug.spec.js.map +1 -0
- package/dist/test/testKit.spec.d.ts +2 -0
- package/dist/test/testKit.spec.d.ts.map +1 -0
- package/dist/test/testKit.spec.js +134 -0
- package/dist/test/testKit.spec.js.map +1 -0
- package/dist/testKit/emptyLoggerOptions.d.ts +3 -0
- package/dist/testKit/emptyLoggerOptions.d.ts.map +1 -0
- package/dist/testKit/emptyLoggerOptions.js +18 -0
- package/dist/testKit/emptyLoggerOptions.js.map +1 -0
- package/dist/testKit/index.d.ts +25 -0
- package/dist/testKit/index.d.ts.map +1 -0
- package/dist/testKit/index.js +158 -0
- package/dist/testKit/index.js.map +1 -0
- package/dist/testKit/mockPackage.d.ts +21 -0
- package/dist/testKit/mockPackage.d.ts.map +1 -0
- package/dist/testKit/mockPackage.js +91 -0
- package/dist/testKit/mockPackage.js.map +1 -0
- package/dist/testKit/withConsoleErrors.d.ts +2 -0
- package/dist/testKit/withConsoleErrors.d.ts.map +1 -0
- package/dist/testKit/withConsoleErrors.js +16 -0
- package/dist/testKit/withConsoleErrors.js.map +1 -0
- package/dist/testKit/withThrowOnError.d.ts +3 -0
- package/dist/testKit/withThrowOnError.d.ts.map +1 -0
- package/dist/testKit/withThrowOnError.js +31 -0
- package/dist/testKit/withThrowOnError.js.map +1 -0
- package/jest.config.js +16 -0
- package/package.json +5 -3
- package/src/API.ts +474 -378
- package/src/IterableWeakMap.ts +121 -0
- package/src/appHost.ts +1383 -0
- package/src/appHostServices.ts +42 -0
- package/src/appHostUtils.ts +11 -0
- package/src/extensionSlot.ts +96 -0
- package/src/hot.ts +53 -0
- package/src/index.ts +55 -3
- package/src/installedShellsState.ts +54 -0
- package/src/interceptAnyObject.ts +39 -0
- package/src/interceptEntryPoints.ts +25 -0
- package/src/invokeSlotCallbacks.ts +20 -0
- package/src/loggers.ts +112 -0
- package/src/monitorAPI.ts +71 -0
- package/src/repluggableAppDebug/debug.d.ts +37 -0
- package/src/repluggableAppDebug/index.ts +1 -0
- package/src/repluggableAppDebug/performanceDebugInfo.ts +96 -0
- package/src/repluggableAppDebug/repluggableAppDebug.ts +192 -0
- package/src/tarjanGraph.ts +96 -0
- package/src/throttledStore.ts +355 -0
- package/test/IterableWeakMap.spec.ts +284 -0
- package/test/appHost.mock.ts +58 -0
- package/test/appHost.spec.ts +1629 -0
- package/test/customExtensionSlot.spec.ts +153 -0
- package/test/extensionSlot.spec.ts +94 -0
- package/test/installedShellsState.spec.ts +39 -0
- package/test/interceptAnyObject.spec.ts +217 -0
- package/test/interceptEntryPoints.spec.ts +291 -0
- package/test/loggers.spec.ts +288 -0
- package/test/repluggableAppDebug.spec.ts +118 -0
- package/test/testKit.spec.tsx +153 -0
- package/testKit/emptyLoggerOptions.ts +16 -0
- package/testKit/index.ts +172 -0
- package/testKit/mockPackage.ts +99 -0
- package/testKit/package.json +3 -0
- package/testKit/withConsoleErrors.ts +12 -0
- package/testKit/withThrowOnError.ts +34 -0
- package/tsconfig.json +11 -1
- package/dist/es/API.d.ts.map +0 -1
- package/dist/es/API.js +0 -2
- package/dist/es/API.js.map +0 -1
- package/dist/es/index.d.ts +0 -2
- package/dist/es/index.d.ts.map +0 -1
- package/dist/es/index.js +0 -2
- package/dist/es/index.js.map +0 -1
package/src/API.ts
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
import * as Redux from
|
|
1
|
+
import * as Redux from "redux";
|
|
2
|
+
|
|
3
|
+
import { ThrottledStore } from "./throttledStore";
|
|
4
|
+
|
|
5
|
+
export type ScopedStore<S> = Pick<
|
|
6
|
+
ThrottledStore<S>,
|
|
7
|
+
| "dispatch"
|
|
8
|
+
| "getState"
|
|
9
|
+
| "subscribe"
|
|
10
|
+
| "flush"
|
|
11
|
+
| "hasPendingSubscribers"
|
|
12
|
+
| "deferSubscriberNotifications"
|
|
13
|
+
>;
|
|
14
|
+
|
|
15
|
+
export { AppHostAPI } from "./appHostServices";
|
|
2
16
|
|
|
3
17
|
export interface AnySlotKey {
|
|
4
|
-
|
|
5
|
-
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly public?: boolean; // TODO: Move to new interface - APIKey
|
|
6
20
|
}
|
|
7
21
|
|
|
8
22
|
/**
|
|
@@ -16,94 +30,98 @@ export interface AnySlotKey {
|
|
|
16
30
|
* @template T
|
|
17
31
|
*/
|
|
18
32
|
export interface SlotKey<T> extends AnySlotKey {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Holds no value, only triggers type-checking of T
|
|
35
|
+
*/
|
|
36
|
+
readonly empty?: T;
|
|
37
|
+
/**
|
|
38
|
+
* Application layer/layers that will restrict usage of APIs contributed by this entry point.
|
|
39
|
+
* Layers hierarchy is defined in the host options
|
|
40
|
+
* @See {AppHostOptions.layers}
|
|
41
|
+
*/
|
|
42
|
+
readonly layer?: string | string[]; // TODO: Move to new interface - APIKey
|
|
43
|
+
/**
|
|
44
|
+
* Version of the API that will be part of the API key unique identification
|
|
45
|
+
*/
|
|
46
|
+
readonly version?: number; // TODO: Move to new interface - APIKey
|
|
33
47
|
}
|
|
34
48
|
|
|
35
|
-
export type ReactComponentContributor<TProps = {}> = (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
export type ReactComponentContributor<TProps = {}> = (
|
|
50
|
+
props?: TProps
|
|
51
|
+
) => React.ReactNode;
|
|
52
|
+
export type ReducersMapObjectContributor<
|
|
53
|
+
TState = {},
|
|
54
|
+
TAction extends Redux.AnyAction = Redux.AnyAction
|
|
55
|
+
> = () => Redux.ReducersMapObject<TState, TAction>;
|
|
56
|
+
export type ContributionPredicate = () => boolean;
|
|
41
57
|
export interface EntryPointTags {
|
|
42
|
-
|
|
58
|
+
[name: string]: string;
|
|
43
59
|
}
|
|
44
|
-
export type LazyEntryPointFactory = () => Promise<EntryPoint
|
|
45
|
-
export type ShellsChangedCallback = (shellNames: string[]) => void
|
|
46
|
-
export type ShellBoundaryAspect = React.FunctionComponent<
|
|
60
|
+
export type LazyEntryPointFactory = () => Promise<EntryPoint>; //TODO: get rid of these
|
|
61
|
+
export type ShellsChangedCallback = (shellNames: string[]) => void;
|
|
62
|
+
export type ShellBoundaryAspect = React.FunctionComponent<
|
|
63
|
+
React.PropsWithChildren<unknown>
|
|
64
|
+
>;
|
|
47
65
|
|
|
48
66
|
export interface LazyEntryPointDescriptor {
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
readonly name: string;
|
|
68
|
+
readonly factory: LazyEntryPointFactory;
|
|
51
69
|
}
|
|
52
70
|
|
|
53
|
-
|
|
54
|
-
|
|
55
71
|
/**
|
|
56
72
|
* Application part that will receive a {Shell} when loaded into the {AppHost}
|
|
57
73
|
* @export
|
|
58
74
|
* @interface EntryPoint
|
|
59
75
|
*/
|
|
60
76
|
export interface EntryPoint {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Unique name that will represent this entry point in the host
|
|
79
|
+
*/
|
|
80
|
+
readonly name: string;
|
|
81
|
+
readonly tags?: EntryPointTags;
|
|
82
|
+
/**
|
|
83
|
+
* Application layer / layers that will restrict usage of APIs contributed by this entry point.
|
|
84
|
+
* Layers hierarchy is defined in the host options
|
|
85
|
+
* See {AppHostOptions.layers}
|
|
86
|
+
*/
|
|
87
|
+
readonly layer?: string | string[];
|
|
88
|
+
/**
|
|
89
|
+
* Define which API keys (a.k.a. contracts) are mandatory for this entry point to be executed
|
|
90
|
+
* @return {SlotKey<any>[]} API keys to wait for implementation
|
|
91
|
+
*/
|
|
92
|
+
getDependencyAPIs?(): SlotKey<any>[];
|
|
93
|
+
/**
|
|
94
|
+
* Define which API keys (a.k.a. contracts) this entry point is going to implement and contribute
|
|
95
|
+
* @return {SlotKey<any>[]} API keys that will be contributed
|
|
96
|
+
*/
|
|
97
|
+
declareAPIs?(): SlotKey<any>[];
|
|
98
|
+
/**
|
|
99
|
+
* Execute logic that is independent from other entry points
|
|
100
|
+
* Most commonly - contribute APIs and state
|
|
101
|
+
* @param {Shell} shell
|
|
102
|
+
*/
|
|
103
|
+
attach?(shell: Shell): void;
|
|
104
|
+
/**
|
|
105
|
+
* Execute logic that is dependent on other entry points
|
|
106
|
+
* @param {Shell} shell
|
|
107
|
+
*/
|
|
108
|
+
extend?(shell: Shell): void;
|
|
109
|
+
/**
|
|
110
|
+
* Clean side effects
|
|
111
|
+
* @param {Shell} shell
|
|
112
|
+
*/
|
|
113
|
+
detach?(shell: Shell): void;
|
|
98
114
|
}
|
|
99
115
|
|
|
100
|
-
export type AnyEntryPoint = EntryPoint | LazyEntryPointDescriptor
|
|
101
|
-
export type EntryPointOrPackage = AnyEntryPoint | AnyEntryPoint[]
|
|
116
|
+
export type AnyEntryPoint = EntryPoint | LazyEntryPointDescriptor;
|
|
117
|
+
export type EntryPointOrPackage = AnyEntryPoint | AnyEntryPoint[];
|
|
102
118
|
export interface EntryPointOrPackagesMap {
|
|
103
|
-
|
|
119
|
+
[name: string]: EntryPointOrPackage;
|
|
104
120
|
}
|
|
105
121
|
|
|
106
|
-
export type ExtensionItemFilter<T> = (
|
|
122
|
+
export type ExtensionItemFilter<T> = (
|
|
123
|
+
extensionItem: ExtensionItem<T>
|
|
124
|
+
) => boolean;
|
|
107
125
|
/**
|
|
108
126
|
* A slot/container for holding any contribution of shape T
|
|
109
127
|
* Access to the slot is scoped to the {Shell}
|
|
@@ -113,64 +131,68 @@ export type ExtensionItemFilter<T> = (extensionItem: ExtensionItem<T>) => boolea
|
|
|
113
131
|
* @template T
|
|
114
132
|
*/
|
|
115
133
|
export interface ExtensionSlot<T> {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
134
|
+
/**
|
|
135
|
+
* a unique identifier for the slot
|
|
136
|
+
*/
|
|
137
|
+
readonly name: string;
|
|
138
|
+
readonly host: AppHost;
|
|
139
|
+
/**
|
|
140
|
+
* Which {Shell} owns this slot
|
|
141
|
+
*/
|
|
142
|
+
readonly declaringShell?: Shell;
|
|
143
|
+
/**
|
|
144
|
+
* Add an item to the slot
|
|
145
|
+
*
|
|
146
|
+
* @param {Shell} shell Who owns the contributed item
|
|
147
|
+
* @param {T} item Extension item to be added to the slot
|
|
148
|
+
* @param {ContributionPredicate} [condition] A predicate to condition the retrieval of the item when slot items are requested with {ExtensionSlot<T>.getItems}
|
|
149
|
+
*/
|
|
150
|
+
contribute(shell: Shell, item: T, condition?: ContributionPredicate): void;
|
|
151
|
+
/**
|
|
152
|
+
* Get all items contributed to the slot
|
|
153
|
+
*
|
|
154
|
+
* @param {boolean} [forceAll] Ignore items' contribution predicates and get all anyway
|
|
155
|
+
* @return {ExtensionItem<T>[]} All items contributed to the slot
|
|
156
|
+
*/
|
|
157
|
+
getItems(forceAll?: boolean): ExtensionItem<T>[];
|
|
158
|
+
/**
|
|
159
|
+
* Get the first item in the slot
|
|
160
|
+
*
|
|
161
|
+
* @return {ExtensionItem<T>} The first item in the slot
|
|
162
|
+
*/
|
|
163
|
+
getSingleItem(): ExtensionItem<T> | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Get a specific item in the slot
|
|
166
|
+
*
|
|
167
|
+
* @param {string} name Extension item name
|
|
168
|
+
* @return {ExtensionItem<T> | undefined} Extension item
|
|
169
|
+
*/
|
|
170
|
+
getItemByName(name: string): ExtensionItem<T> | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* Remove items from the slot by predicate
|
|
173
|
+
*
|
|
174
|
+
* @param {ExtensionItemFilter<T> | undefined} predicate Remove all items matching this predicate
|
|
175
|
+
*/
|
|
176
|
+
discardBy(predicate: ExtensionItemFilter<T>): void;
|
|
159
177
|
}
|
|
160
178
|
|
|
161
179
|
export interface PrivateExtensionSlot<T> extends ExtensionSlot<T> {
|
|
162
|
-
|
|
180
|
+
subscribe(callback: () => void): () => void;
|
|
163
181
|
}
|
|
164
182
|
|
|
165
183
|
export interface CustomExtensionSlotHandler<T> {
|
|
166
|
-
|
|
167
|
-
|
|
184
|
+
contribute(
|
|
185
|
+
fromShell: Shell,
|
|
186
|
+
item: T,
|
|
187
|
+
condition?: ContributionPredicate
|
|
188
|
+
): void;
|
|
189
|
+
discardBy(predicate: ExtensionItemFilter<T>): void;
|
|
168
190
|
}
|
|
169
191
|
|
|
170
192
|
export interface CustomExtensionSlot<T> extends CustomExtensionSlotHandler<T> {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly host: AppHost;
|
|
195
|
+
readonly declaringShell?: Shell;
|
|
174
196
|
}
|
|
175
197
|
|
|
176
198
|
/**
|
|
@@ -181,20 +203,20 @@ export interface CustomExtensionSlot<T> extends CustomExtensionSlotHandler<T> {
|
|
|
181
203
|
* @template T
|
|
182
204
|
*/
|
|
183
205
|
export interface ExtensionItem<T> {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
206
|
+
readonly name?: string;
|
|
207
|
+
/**
|
|
208
|
+
* Which {Shell} owns this item
|
|
209
|
+
*/
|
|
210
|
+
readonly shell: Shell;
|
|
211
|
+
/**
|
|
212
|
+
* Contribution content
|
|
213
|
+
*/
|
|
214
|
+
readonly contribution: T;
|
|
215
|
+
/**
|
|
216
|
+
* Condition for the retrieval of this item by {ExtensionSlot<T>.getItems}
|
|
217
|
+
*/
|
|
218
|
+
readonly condition: ContributionPredicate;
|
|
219
|
+
readonly uniqueId: string;
|
|
198
220
|
}
|
|
199
221
|
|
|
200
222
|
// addEntryPoints(entryPoints: EntryPoint[])
|
|
@@ -208,130 +230,143 @@ export interface ExtensionItem<T> {
|
|
|
208
230
|
* @interface AppHost
|
|
209
231
|
*/
|
|
210
232
|
export interface AppHost {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
233
|
+
/**
|
|
234
|
+
* Get the root store of the application
|
|
235
|
+
*
|
|
236
|
+
* @return {ThrottledStore}
|
|
237
|
+
*/
|
|
238
|
+
getStore(): ThrottledStore;
|
|
239
|
+
/**
|
|
240
|
+
* Get an implementation of API previously contributed to the {AppHost}
|
|
241
|
+
*
|
|
242
|
+
* @template TAPI
|
|
243
|
+
* @param {SlotKey<TAPI>} key API Key
|
|
244
|
+
* @return {*} {TAPI}
|
|
245
|
+
*/
|
|
246
|
+
getAPI<TAPI>(key: SlotKey<TAPI>): TAPI;
|
|
247
|
+
/**
|
|
248
|
+
* Get an extension slot defined on the host
|
|
249
|
+
*
|
|
250
|
+
* @template TItem
|
|
251
|
+
* @param {SlotKey<TItem>} key
|
|
252
|
+
* @return {ExtensionSlot<TItem>}
|
|
253
|
+
*/
|
|
254
|
+
getSlot<TItem>(key: SlotKey<TItem>): ExtensionSlot<TItem>;
|
|
255
|
+
/**
|
|
256
|
+
* Get all the extension slots defined on the host
|
|
257
|
+
*
|
|
258
|
+
* @return {*} {AnySlotKey[]}
|
|
259
|
+
*/
|
|
260
|
+
getAllSlotKeys(): AnySlotKey[];
|
|
261
|
+
/**
|
|
262
|
+
* Get all {EntryPoint}s addded to the {AppHost}
|
|
263
|
+
*
|
|
264
|
+
* @return {EntryPointsInfo[]}
|
|
265
|
+
*/
|
|
266
|
+
getAllEntryPoints(): EntryPointsInfo[];
|
|
267
|
+
/**
|
|
268
|
+
* Does the {AppHost} contain a specific {Shell}
|
|
269
|
+
*
|
|
270
|
+
* @param {string} name
|
|
271
|
+
* @return {boolean}
|
|
272
|
+
*/
|
|
273
|
+
hasShell(name: string): boolean;
|
|
274
|
+
// TODO: Deprecate
|
|
275
|
+
isLazyEntryPoint(name: string): boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Dynamically add {Shell}s after the host is created
|
|
278
|
+
*
|
|
279
|
+
* @param {EntryPointOrPackage[]} entryPointsOrPackages New packages or entry points to be added to the {AppHost}
|
|
280
|
+
* @return {Promise<void>}
|
|
281
|
+
*/
|
|
282
|
+
addShells(entryPointsOrPackages: EntryPointOrPackage[]): Promise<void>;
|
|
283
|
+
/**
|
|
284
|
+
* Dynamically remove {Shell}s after the host is created
|
|
285
|
+
*
|
|
286
|
+
* @param {string[]} names {Shell} names to be removed
|
|
287
|
+
* @return {Promise<void>}
|
|
288
|
+
*/
|
|
289
|
+
removeShells(names: string[]): Promise<void>;
|
|
290
|
+
onShellsChanged(callback: ShellsChangedCallback): string;
|
|
291
|
+
removeShellsChangedCallback(callbackId: string): void;
|
|
292
|
+
readonly log: HostLogger;
|
|
293
|
+
readonly options: AppHostOptions;
|
|
266
294
|
}
|
|
267
295
|
|
|
268
296
|
export interface PrivateAppHost extends AppHost {
|
|
269
|
-
|
|
297
|
+
executeWhenFree(identifier: string, callback: () => void): void;
|
|
270
298
|
}
|
|
271
299
|
|
|
272
300
|
export interface MonitoringOptions {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
301
|
+
enablePerformance?: boolean;
|
|
302
|
+
readonly disableMonitoring?: boolean;
|
|
303
|
+
readonly disableMemoization?: boolean;
|
|
304
|
+
readonly debugMemoization?: boolean;
|
|
277
305
|
}
|
|
278
306
|
|
|
279
307
|
export interface Trace {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
308
|
+
name: string;
|
|
309
|
+
duration: number;
|
|
310
|
+
startTime: number;
|
|
311
|
+
res: any;
|
|
312
|
+
args: any[];
|
|
285
313
|
}
|
|
286
314
|
|
|
287
315
|
export interface APILayer {
|
|
288
|
-
|
|
289
|
-
|
|
316
|
+
level: number;
|
|
317
|
+
name: string;
|
|
290
318
|
}
|
|
291
319
|
|
|
292
320
|
export interface AppHostOptions {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
321
|
+
readonly logger?: HostLogger;
|
|
322
|
+
readonly monitoring: MonitoringOptions;
|
|
323
|
+
readonly layers?: APILayer[] | APILayer[][];
|
|
324
|
+
readonly disableLayersValidation?: boolean;
|
|
325
|
+
readonly disableCheckCircularDependencies?: boolean;
|
|
326
|
+
readonly enableStickyErrorBoundaries?: boolean;
|
|
327
|
+
readonly enableReduxDevtoolsExtension?: boolean;
|
|
328
|
+
readonly experimentalCyclicMode?: boolean;
|
|
329
|
+
readonly shouldScopeReducers?: boolean;
|
|
302
330
|
}
|
|
303
331
|
|
|
304
332
|
export interface MemoizeMissHit {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
333
|
+
miss: number;
|
|
334
|
+
calls: number;
|
|
335
|
+
hit: number;
|
|
336
|
+
printHitMiss(): void;
|
|
309
337
|
}
|
|
310
338
|
|
|
311
|
-
export type enrichedMemoizationFunction = MemoizeMissHit &
|
|
339
|
+
export type enrichedMemoizationFunction = MemoizeMissHit &
|
|
340
|
+
AnyFunction &
|
|
341
|
+
_.MemoizedFunction;
|
|
312
342
|
|
|
313
343
|
export interface StatisticsMemoization {
|
|
314
|
-
|
|
315
|
-
|
|
344
|
+
func: enrichedMemoizationFunction;
|
|
345
|
+
name: string;
|
|
316
346
|
}
|
|
317
347
|
|
|
318
348
|
export interface ContributeAPIOptions<TAPI> {
|
|
319
|
-
|
|
320
|
-
|
|
349
|
+
includesNamespaces?: boolean;
|
|
350
|
+
disableMonitoring?: boolean | (keyof TAPI)[];
|
|
321
351
|
}
|
|
322
352
|
|
|
323
|
-
export type StateObserverUnsubscribe = () => void
|
|
324
|
-
export type StateObserver<TSelectorAPI> = (next: TSelectorAPI) => void
|
|
353
|
+
export type StateObserverUnsubscribe = () => void;
|
|
354
|
+
export type StateObserver<TSelectorAPI> = (next: TSelectorAPI) => void;
|
|
325
355
|
export interface ObservableState<TSelectorAPI> {
|
|
326
|
-
|
|
327
|
-
|
|
356
|
+
subscribe(
|
|
357
|
+
fromShell: Shell,
|
|
358
|
+
callback: StateObserver<TSelectorAPI>
|
|
359
|
+
): StateObserverUnsubscribe;
|
|
360
|
+
current(allowUnsafeReading?: boolean): TSelectorAPI;
|
|
328
361
|
}
|
|
329
362
|
|
|
330
|
-
export type AnyFunction = (...args: any[]) => any
|
|
331
|
-
export type FunctionWithSameArgs<F extends AnyFunction> = (
|
|
363
|
+
export type AnyFunction = (...args: any[]) => any;
|
|
364
|
+
export type FunctionWithSameArgs<F extends AnyFunction> = (
|
|
365
|
+
...args: Parameters<F>
|
|
366
|
+
) => any;
|
|
332
367
|
|
|
333
368
|
export interface Lazy<T> {
|
|
334
|
-
|
|
369
|
+
get(): T;
|
|
335
370
|
}
|
|
336
371
|
|
|
337
372
|
/**
|
|
@@ -342,174 +377,235 @@ export interface Lazy<T> {
|
|
|
342
377
|
* @interface Shell
|
|
343
378
|
* @extends {(Pick<AppHost, Exclude<keyof AppHost, 'getStore' | 'log' | 'options'>>)}
|
|
344
379
|
*/
|
|
345
|
-
export interface Shell
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
380
|
+
export interface Shell
|
|
381
|
+
extends Pick<
|
|
382
|
+
AppHost,
|
|
383
|
+
Exclude<keyof AppHost, "getStore" | "log" | "options">
|
|
384
|
+
> {
|
|
385
|
+
/**
|
|
386
|
+
* Unique name of the matching {EntryPoint}
|
|
387
|
+
*/
|
|
388
|
+
readonly name: string;
|
|
389
|
+
readonly log: ShellLogger;
|
|
390
|
+
/**
|
|
391
|
+
* Get store that is scoped for this {Shell}
|
|
392
|
+
*
|
|
393
|
+
* @template TState
|
|
394
|
+
* @return {ScopedStore<TState>} Scoped store for this {Shell}
|
|
395
|
+
*/
|
|
396
|
+
getStore<TState>(): ScopedStore<TState>;
|
|
397
|
+
/**
|
|
398
|
+
* Are APIs ready to be requested
|
|
399
|
+
*
|
|
400
|
+
* @return {*} {boolean}
|
|
401
|
+
*/
|
|
402
|
+
canUseAPIs(): boolean;
|
|
403
|
+
/**
|
|
404
|
+
* Is store ready to be requested
|
|
405
|
+
*
|
|
406
|
+
* @return {*} {boolean}
|
|
407
|
+
*/
|
|
408
|
+
canUseStore(): boolean;
|
|
409
|
+
/**
|
|
410
|
+
* Did the execution of {EntryPoint}s' lifecycle phases (attach, detach) are done
|
|
411
|
+
*
|
|
412
|
+
* @return {*} {boolean}
|
|
413
|
+
*/
|
|
414
|
+
wasInitializationCompleted(): boolean;
|
|
415
|
+
runLateInitializer<T>(initializer: () => T): T;
|
|
416
|
+
/**
|
|
417
|
+
* Create an {ExtensionSlot}
|
|
418
|
+
*
|
|
419
|
+
* @template TItem
|
|
420
|
+
* @param {SlotKey<TItem>} key Key that will represent the slot (an will be used for retrieval)
|
|
421
|
+
* @return {ExtensionSlot<TItem>} Actual slot
|
|
422
|
+
*/
|
|
423
|
+
declareSlot<TItem>(key: SlotKey<TItem>): ExtensionSlot<TItem>;
|
|
424
|
+
declareCustomSlot<TItem>(
|
|
425
|
+
key: SlotKey<TItem>,
|
|
426
|
+
handler: CustomExtensionSlotHandler<TItem>
|
|
427
|
+
): CustomExtensionSlot<TItem>;
|
|
428
|
+
|
|
429
|
+
// TODO: Fix contributeAPI factory type not to resort to lowest common
|
|
430
|
+
/**
|
|
431
|
+
* Contribute an implementation of an API (a.k.a contract)
|
|
432
|
+
*
|
|
433
|
+
* @template TAPI
|
|
434
|
+
* @param {SlotKey<TAPI>} key API Key that represents an interface TAPI
|
|
435
|
+
* @param {() => TAPI} factory Create an implementation of TAPI
|
|
436
|
+
* @param {ContributeAPIOptions<TAPI>} [options] Contribution options {ContributeAPIOptions}
|
|
437
|
+
* @return {TAPI} Result of the factory execution
|
|
438
|
+
*/
|
|
439
|
+
contributeAPI<TAPI>(
|
|
440
|
+
key: SlotKey<TAPI>,
|
|
441
|
+
factory: () => TAPI,
|
|
442
|
+
options?: ContributeAPIOptions<TAPI>
|
|
443
|
+
): TAPI;
|
|
444
|
+
/**
|
|
445
|
+
* Contribute a Redux reducer that will be added to the host store.
|
|
446
|
+
* Use it for slowly changing state (e.g. not changing because of mouse movement)
|
|
447
|
+
*
|
|
448
|
+
* @template TState
|
|
449
|
+
* @param {ReducersMapObjectContributor<TState>} contributor
|
|
450
|
+
*/
|
|
451
|
+
contributeState<TState, TAction extends Redux.AnyAction = Redux.AnyAction>(
|
|
452
|
+
contributor: ReducersMapObjectContributor<TState, TAction>
|
|
453
|
+
): void;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Contribute a Redux reducer that will be added to the host store
|
|
457
|
+
* Use it for rapidly changing state (e.g. changing on every mouse movement event)
|
|
458
|
+
* Changes to this state won't trigger the usual subscribers.
|
|
459
|
+
* In order to subscribe to changes in this state, use the observer object returned by this function.
|
|
460
|
+
*
|
|
461
|
+
* @template TState
|
|
462
|
+
* @param {ReducersMapObjectContributor<TState>} contributor
|
|
463
|
+
* @return {TAPI} Observer object for subscribing to state changes. The observer can also be passed to {connectWithShell}.
|
|
464
|
+
*/
|
|
465
|
+
contributeObservableState<
|
|
466
|
+
TState,
|
|
467
|
+
TSelector,
|
|
468
|
+
TAction extends Redux.AnyAction = Redux.AnyAction
|
|
469
|
+
>(
|
|
470
|
+
contributor: ReducersMapObjectContributor<TState, TAction>,
|
|
471
|
+
selectorFactory: (state: TState) => TSelector
|
|
472
|
+
): ObservableState<TSelector>;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Contribute the main view (root) of the application
|
|
476
|
+
* Intended to be used by a single {Shell} in an application
|
|
477
|
+
*
|
|
478
|
+
* @param {Shell} fromShell Who owns the main view
|
|
479
|
+
* @param {ReactComponentContributor} contributor Create the main view component
|
|
480
|
+
*/
|
|
481
|
+
contributeMainView(
|
|
482
|
+
fromShell: Shell,
|
|
483
|
+
contributor: ReactComponentContributor
|
|
484
|
+
): void;
|
|
485
|
+
contributeBoundaryAspect(component: ShellBoundaryAspect): void;
|
|
486
|
+
/**
|
|
487
|
+
* Create a function with internal cache until any state change in the {AppHost} store
|
|
488
|
+
*
|
|
489
|
+
* @template T
|
|
490
|
+
* @param {T} func Function to build cache for
|
|
491
|
+
* @param {FunctionWithSameArgs<T>} resolver Key creator to index results by
|
|
492
|
+
* @param {() => boolean} [shouldClear] Custom clear condition (if not provided, behaves like () => true)
|
|
493
|
+
* @return {*} {(((...args: Parameters<T>) => ReturnType<T>) & Partial<_.MemoizedFunction> & Partial<MemoizeMissHit>)}
|
|
494
|
+
*/
|
|
495
|
+
memoizeForState<T extends AnyFunction>(
|
|
496
|
+
func: T,
|
|
497
|
+
resolver: FunctionWithSameArgs<T>,
|
|
498
|
+
shouldClear?: () => boolean
|
|
499
|
+
): ((...args: Parameters<T>) => ReturnType<T>) &
|
|
500
|
+
Partial<_.MemoizedFunction> &
|
|
501
|
+
Partial<MemoizeMissHit>;
|
|
502
|
+
/**
|
|
503
|
+
* Manually trigger clear condition for function memoized with {Shell.memoizeForState}
|
|
504
|
+
*/
|
|
505
|
+
flushMemoizedForState(): void;
|
|
506
|
+
/**
|
|
507
|
+
* Create a function with internal cache
|
|
508
|
+
*
|
|
509
|
+
* @template T
|
|
510
|
+
* @param {T} func Function to build cache for
|
|
511
|
+
* @param {FunctionWithSameArgs<T>} resolver Key creator to index results by
|
|
512
|
+
* @return {*} {(((...args: Parameters<T>) => ReturnType<T>) & Partial<_.MemoizedFunction> & Partial<MemoizeMissHit>)}
|
|
513
|
+
*/
|
|
514
|
+
memoize<T extends AnyFunction>(
|
|
515
|
+
func: T,
|
|
516
|
+
resolver: FunctionWithSameArgs<T>
|
|
517
|
+
): ((...args: Parameters<T>) => ReturnType<T>) &
|
|
518
|
+
Partial<_.MemoizedFunction> &
|
|
519
|
+
Partial<MemoizeMissHit>;
|
|
520
|
+
/**
|
|
521
|
+
* Clear cache of a memoized function
|
|
522
|
+
*
|
|
523
|
+
* @param {(Partial<_.MemoizedFunction> & Partial<MemoizeMissHit>)} memoizedFunction
|
|
524
|
+
*/
|
|
525
|
+
clearCache(
|
|
526
|
+
memoizedFunction: Partial<_.MemoizedFunction> & Partial<MemoizeMissHit>
|
|
527
|
+
): void;
|
|
528
|
+
/**
|
|
529
|
+
* Creates a lazy-evaluated value. The function `func` is only executed once when `get` is called for the first time,
|
|
530
|
+
* and the result is cached for subsequent calls.
|
|
531
|
+
*
|
|
532
|
+
* @template T
|
|
533
|
+
* @param {F} func - The function that will be lazily evaluated. It should not take any arguments.
|
|
534
|
+
* @returns {Lazy<T>} An object with a `get` method that returns the lazily evaluated value of type `T`.
|
|
535
|
+
*/
|
|
536
|
+
lazyEvaluator<F extends AnyFunction, T extends ReturnType<F>>(
|
|
537
|
+
func: F
|
|
538
|
+
): Lazy<T>;
|
|
466
539
|
}
|
|
467
540
|
|
|
468
541
|
export interface PrivateShell extends Shell {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
542
|
+
readonly entryPoint: EntryPoint;
|
|
543
|
+
setDependencyAPIs(APIs: AnySlotKey[]): void;
|
|
544
|
+
setLifecycleState(
|
|
545
|
+
enableStore: boolean,
|
|
546
|
+
enableAPIs: boolean,
|
|
547
|
+
initCompleted: boolean
|
|
548
|
+
): void;
|
|
549
|
+
getBoundaryAspects(): ShellBoundaryAspect[];
|
|
550
|
+
getHostOptions(): AppHostOptions;
|
|
551
|
+
getAppHost(): AppHost;
|
|
475
552
|
}
|
|
476
553
|
|
|
477
554
|
export interface EntryPointsInfo {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
555
|
+
readonly name: string;
|
|
556
|
+
readonly lazy: boolean;
|
|
557
|
+
readonly attached: boolean;
|
|
481
558
|
}
|
|
482
559
|
|
|
483
560
|
export interface EntryPointInterceptor {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
561
|
+
interceptName?(innerName: string): string;
|
|
562
|
+
interceptTags?(innerTags?: EntryPointTags): EntryPointTags;
|
|
563
|
+
interceptGetDependencyAPIs?(
|
|
564
|
+
innerGetDependencyAPIs?: EntryPoint["getDependencyAPIs"]
|
|
565
|
+
): EntryPoint["getDependencyAPIs"];
|
|
566
|
+
interceptDeclareAPIs?(
|
|
567
|
+
innerDeclareAPIs?: EntryPoint["declareAPIs"]
|
|
568
|
+
): EntryPoint["declareAPIs"];
|
|
569
|
+
interceptAttach?(innerAttach?: EntryPoint["attach"]): EntryPoint["attach"];
|
|
570
|
+
interceptDetach?(innerDetach?: EntryPoint["detach"]): EntryPoint["detach"];
|
|
571
|
+
interceptExtend?(innerExtend?: EntryPoint["extend"]): EntryPoint["extend"];
|
|
491
572
|
}
|
|
492
573
|
|
|
493
|
-
export type LogSeverity =
|
|
494
|
-
|
|
574
|
+
export type LogSeverity =
|
|
575
|
+
| "debug"
|
|
576
|
+
| "info"
|
|
577
|
+
| "event"
|
|
578
|
+
| "warning"
|
|
579
|
+
| "error"
|
|
580
|
+
| "critical";
|
|
581
|
+
export type LogSpanFlag = "begin" | "end"; //TODO:deprecated-kept-for-backward-compat
|
|
495
582
|
|
|
496
583
|
export interface HostLogger {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
584
|
+
log(
|
|
585
|
+
severity: LogSeverity,
|
|
586
|
+
id: string,
|
|
587
|
+
error?: Error,
|
|
588
|
+
keyValuePairs?: Object
|
|
589
|
+
): void;
|
|
590
|
+
spanChild(messageId: string, keyValuePairs?: Object): ShellLoggerSpan;
|
|
591
|
+
spanRoot(messageId: string, keyValuePairs?: Object): ShellLoggerSpan;
|
|
500
592
|
}
|
|
501
593
|
|
|
502
594
|
export interface ShellLogger extends HostLogger {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
595
|
+
debug(messageId: string, keyValuePairs?: Object): void;
|
|
596
|
+
info(messageId: string, keyValuePairs?: Object): void;
|
|
597
|
+
warning(messageId: string, keyValuePairs?: Object): void;
|
|
598
|
+
error(messageId: string, error?: Error, keyValuePairs?: Object): void;
|
|
599
|
+
critical(messageId: string, error?: Error, keyValuePairs?: Object): void;
|
|
600
|
+
spanChild(messageId: string, keyValuePairs?: Object): ShellLoggerSpan;
|
|
601
|
+
spanRoot(messageId: string, keyValuePairs?: Object): ShellLoggerSpan;
|
|
602
|
+
monitor<T>(
|
|
603
|
+
messageId: string,
|
|
604
|
+
keyValuePairs: Object,
|
|
605
|
+
monitoredCode: () => T
|
|
606
|
+
): T;
|
|
511
607
|
}
|
|
512
608
|
|
|
513
609
|
export interface ShellLoggerSpan {
|
|
514
|
-
|
|
610
|
+
end(success: boolean, error?: Error, keyValuePairs?: Object): void;
|
|
515
611
|
}
|