@genesislcap/foundation-store 14.117.0 → 14.118.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/README.md +94 -36
  2. package/dist/dts/__test__/elements.d.ts +701 -0
  3. package/dist/dts/__test__/elements.d.ts.map +1 -0
  4. package/dist/dts/__test__/index.d.ts +5 -0
  5. package/dist/dts/__test__/index.d.ts.map +1 -0
  6. package/dist/dts/__test__/services.d.ts +40 -0
  7. package/dist/dts/__test__/services.d.ts.map +1 -0
  8. package/dist/dts/__test__/store.d.ts +145 -0
  9. package/dist/dts/__test__/store.d.ts.map +1 -0
  10. package/dist/dts/__test__/types.d.ts +15 -0
  11. package/dist/dts/__test__/types.d.ts.map +1 -0
  12. package/dist/dts/store/errorMap.d.ts +3 -0
  13. package/dist/dts/store/errorMap.d.ts.map +1 -1
  14. package/dist/dts/store/foundationStore.d.ts +108 -12
  15. package/dist/dts/store/foundationStore.d.ts.map +1 -1
  16. package/dist/esm/__test__/elements.js +118 -0
  17. package/dist/esm/__test__/index.js +4 -0
  18. package/dist/esm/__test__/services.js +37 -0
  19. package/dist/esm/__test__/store.js +154 -0
  20. package/dist/esm/__test__/types.js +1 -0
  21. package/dist/esm/store/foundationStore.js +145 -40
  22. package/dist/foundation-store.api.json +174 -13
  23. package/dist/foundation-store.d.ts +113 -12
  24. package/docs/api/foundation-store.abstractstore.createasynclistener.md +35 -1
  25. package/docs/api/foundation-store.abstractstore.createerrorlistener.md +1 -1
  26. package/docs/api/foundation-store.abstractstore.createlistener.md +1 -1
  27. package/docs/api/foundation-store.abstractstore.invokeasyncapi.md +46 -0
  28. package/docs/api/foundation-store.abstractstore.md +4 -3
  29. package/docs/api/foundation-store.errordetailmap.md +4 -0
  30. package/docs/api/foundation-store.errormap.md +4 -0
  31. package/docs/api/foundation-store.errormaplogger.md +4 -0
  32. package/docs/api/foundation-store.registerstore.md +1 -1
  33. package/docs/api-report.md +27 -6
  34. package/package.json +11 -7
@@ -16,6 +16,6 @@ registerStore: <K extends Key>(Base: Constructable<Store>, name?: string) => imp
16
16
 
17
17
 
18
18
  ```ts
19
- export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
19
+ export const TradeEntry = registerStore<TradeEntry>(DefaultTradeEntry, 'TradeEntry');
20
20
  ```
21
21
 
@@ -40,14 +40,18 @@ export abstract class AbstractStore<TStore extends Store, TEventDetailMap extend
40
40
  connect(root: TStoreRoot): void;
41
41
  // @internal
42
42
  protected connectStoreFragments(root: TStoreRoot): void;
43
- protected createAsyncListener: <TDetail = void, TReturn = void>(key: keyof (TEventDetailMap & TInternalEventDetailMap), token: (detail: TDetail) => Promise<TReturn>) => EventListener;
44
- protected createErrorListener: <TDetail extends Error = Error>(key: keyof (TEventDetailMap & TInternalEventDetailMap), token?: (detail: TDetail) => void) => EventListener;
45
- protected createListener: <TDetail = void>(key: keyof (TEventDetailMap & TInternalEventDetailMap), token: (detail: TDetail) => void) => EventListener;
43
+ // Warning: (ae-incompatible-release-tags) The symbol "createAsyncListener" is marked as @public, but its signature references "KeyOrKeys" which is marked as @internal
44
+ protected createAsyncListener: <TDetail = void, TReturn = void>(keys: KeyOrKeys<TEventDetailMap & TInternalEventDetailMap>, token: (detail: TDetail, event?: CustomEvent<TDetail>) => Promise<TReturn>) => EventListener;
45
+ // Warning: (ae-incompatible-release-tags) The symbol "createErrorListener" is marked as @public, but its signature references "KeyOrKeys" which is marked as @internal
46
+ protected createErrorListener: <TDetail extends Error = Error>(keys: KeyOrKeys<TEventDetailMap & TInternalEventDetailMap>, token?: (detail: TDetail, event?: CustomEvent<TDetail>) => void) => EventListener;
47
+ // Warning: (ae-incompatible-release-tags) The symbol "createListener" is marked as @public, but its signature references "KeyOrKeys" which is marked as @internal
48
+ protected createListener: <TDetail = void>(keys: KeyOrKeys<TEventDetailMap & TInternalEventDetailMap>, token: (detail: TDetail, event?: CustomEvent<TDetail>) => void) => EventListener;
46
49
  disconnect(root: TStoreRoot): void;
47
50
  // @internal
48
51
  protected disconnectStoreFragments(root: TStoreRoot): void;
49
52
  protected emit<K extends keyof (TEventDetailMap & TInternalEventDetailMap) & string>(...args: (TEventDetailMap & TInternalEventDetailMap)[K] extends void ? [key: K] : [key: K, detail: (TEventDetailMap & TInternalEventDetailMap)[K]]): void;
50
53
  errors: ErrorMap_2<TEventDetailMap & TInternalEventDetailMap>;
54
+ protected invokeAsyncAPI<TResult>(api: () => Promise<TResult>, error: keyof (TEventDetailMap & TInternalEventDetailMap), success?: keyof (TEventDetailMap & TInternalEventDetailMap)): Promise<void>;
51
55
  get name(): string;
52
56
  // @internal
53
57
  protected removeEventListeners(element: HTMLElement): void;
@@ -73,18 +77,35 @@ export abstract class AbstractStoreRoot<TStore extends StoreRoot, TEventDetailMa
73
77
  // @public @deprecated
74
78
  export const createErrorMap: <TErrorDetailMap extends ErrorDetailMap>(logger: ErrorMapLogger) => ErrorMap<TErrorDetailMap>;
75
79
 
76
- // @public (undocumented)
80
+ // @public @deprecated (undocumented)
77
81
  export type ErrorDetailMap = Record<string, unknown>;
78
82
 
79
- // @public (undocumented)
83
+ // @public @deprecated (undocumented)
80
84
  export interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extends Pick<Map<keyof TErrorDetailMap, Error>, 'get' | 'has' | 'delete' | 'clear' | 'size'> {
81
85
  readonly messages: string;
82
86
  set(key: keyof TErrorDetailMap, error: Error): void;
83
87
  }
84
88
 
85
- // @public (undocumented)
89
+ // @public @deprecated (undocumented)
86
90
  export type ErrorMapLogger = (...args: any[]) => void;
87
91
 
92
+ // Warning: (ae-internal-missing-underscore) The name "EventListenerType" should be prefixed with an underscore because the declaration is marked as @internal
93
+ //
94
+ // @internal (undocumented)
95
+ export enum EventListenerType {
96
+ // (undocumented)
97
+ async = "async",
98
+ // (undocumented)
99
+ error = "error",
100
+ // (undocumented)
101
+ sync = "sync"
102
+ }
103
+
104
+ // Warning: (ae-internal-missing-underscore) The name "KeyOrKeys" should be prefixed with an underscore because the declaration is marked as @internal
105
+ //
106
+ // @internal (undocumented)
107
+ export type KeyOrKeys<TEventDetailMaps extends EventDetailMap> = keyof TEventDetailMaps | (keyof TEventDetailMaps)[];
108
+
88
109
  // @public
89
110
  export const registerStore: <K extends Key>(Base: Constructable<Store>, name?: string) => InterfaceSymbol<K>;
90
111
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-store",
3
3
  "description": "Genesis Foundation Store",
4
- "version": "14.117.0",
4
+ "version": "14.118.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -22,18 +22,22 @@
22
22
  "dev:rollup": "genx dev -b rollup",
23
23
  "dev:tsc": "genx dev -b ts",
24
24
  "dev:webpack": "genx dev -b webpack",
25
- "serve": "genx serve"
25
+ "serve": "genx serve",
26
+ "test": "tsc && genx test",
27
+ "test:coverage": "genx test --coverage"
26
28
  },
27
29
  "devDependencies": {
28
- "@genesislcap/genx": "14.117.0",
30
+ "@genesislcap/foundation-testing": "14.118.1",
31
+ "@genesislcap/genx": "14.118.1",
29
32
  "rimraf": "^3.0.2"
30
33
  },
31
34
  "dependencies": {
32
- "@genesislcap/foundation-events": "14.117.0",
33
- "@genesislcap/foundation-logger": "14.117.0",
34
- "@genesislcap/foundation-utils": "14.117.0",
35
+ "@genesislcap/foundation-events": "14.118.1",
36
+ "@genesislcap/foundation-logger": "14.118.1",
37
+ "@genesislcap/foundation-utils": "14.118.1",
35
38
  "@microsoft/fast-element": "^1.7.0",
36
39
  "@microsoft/fast-foundation": "^2.33.2",
40
+ "@microsoft/fast-web-utilities": "^5.0.2",
37
41
  "fast-safe-stringify": "^2.1.1",
38
42
  "rxjs": "^7.5.4",
39
43
  "tslib": "^2.3.1"
@@ -46,5 +50,5 @@
46
50
  "publishConfig": {
47
51
  "access": "public"
48
52
  },
49
- "gitHead": "450cf89ee7d7b6a97f1ce8f8a34d6dcede30bc9e"
53
+ "gitHead": "179ca69eb20ca2d30c62890f68e6bf60649f0ba6"
50
54
  }