@wordpress/data 10.41.0 → 10.41.1-next.v.202603161435.0
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/README.md +20 -28
- package/build/components/async-mode-provider/context.cjs +1 -1
- package/build/components/async-mode-provider/context.cjs.map +3 -3
- package/build/components/async-mode-provider/index.cjs +1 -1
- package/build/components/async-mode-provider/index.cjs.map +1 -1
- package/build/components/async-mode-provider/use-async-mode.cjs +1 -1
- package/build/components/async-mode-provider/use-async-mode.cjs.map +3 -3
- package/build/components/registry-provider/context.cjs +1 -1
- package/build/components/registry-provider/context.cjs.map +1 -1
- package/build/components/registry-provider/index.cjs +1 -1
- package/build/components/registry-provider/index.cjs.map +1 -1
- package/build/components/registry-provider/use-registry.cjs +1 -1
- package/build/components/registry-provider/use-registry.cjs.map +3 -3
- package/build/components/use-dispatch/index.cjs +1 -1
- package/build/components/use-dispatch/index.cjs.map +1 -1
- package/build/components/use-dispatch/use-dispatch-with-map.cjs +1 -1
- package/build/components/use-dispatch/use-dispatch-with-map.cjs.map +3 -3
- package/build/components/use-dispatch/use-dispatch.cjs +1 -1
- package/build/components/use-dispatch/use-dispatch.cjs.map +3 -3
- package/build/components/use-select/index.cjs +2 -2
- package/build/components/use-select/index.cjs.map +3 -3
- package/build/components/with-dispatch/index.cjs +1 -1
- package/build/components/with-dispatch/index.cjs.map +3 -3
- package/build/components/with-registry/index.cjs +1 -1
- package/build/components/with-registry/index.cjs.map +3 -3
- package/build/components/with-select/index.cjs +1 -1
- package/build/components/with-select/index.cjs.map +3 -3
- package/build/controls.cjs +7 -6
- package/build/controls.cjs.map +3 -3
- package/build/default-registry.cjs +3 -2
- package/build/default-registry.cjs.map +3 -3
- package/build/dispatch.cjs +3 -1
- package/build/dispatch.cjs.map +2 -2
- package/build/factory.cjs.map +2 -2
- package/build/index.cjs +9 -8
- package/build/index.cjs.map +3 -3
- package/build/plugins/index.cjs +1 -1
- package/build/plugins/index.cjs.map +1 -1
- package/build/plugins/persistence/index.cjs +13 -8
- package/build/plugins/persistence/index.cjs.map +3 -3
- package/build/plugins/persistence/storage/default.cjs +1 -1
- package/build/plugins/persistence/storage/default.cjs.map +3 -3
- package/build/plugins/persistence/storage/object.cjs +1 -1
- package/build/plugins/persistence/storage/object.cjs.map +3 -3
- package/build/promise-middleware.cjs +2 -1
- package/build/promise-middleware.cjs.map +3 -3
- package/build/redux-store/index.cjs +32 -16
- package/build/redux-store/index.cjs.map +3 -3
- package/build/redux-store/metadata/selectors.cjs +1 -1
- package/build/redux-store/metadata/selectors.cjs.map +3 -3
- package/build/redux-store/metadata/types.cjs +19 -0
- package/build/redux-store/metadata/types.cjs.map +7 -0
- package/build/registry.cjs +11 -7
- package/build/registry.cjs.map +3 -3
- package/build/resolvers-cache-middleware.cjs +6 -3
- package/build/resolvers-cache-middleware.cjs.map +3 -3
- package/build/select.cjs +3 -1
- package/build/select.cjs.map +2 -2
- package/build/store/index.cjs +1 -1
- package/build/store/index.cjs.map +3 -3
- package/build/types.cjs.map +1 -1
- package/build-module/components/async-mode-provider/context.mjs +1 -1
- package/build-module/components/async-mode-provider/context.mjs.map +3 -3
- package/build-module/components/async-mode-provider/index.mjs +1 -1
- package/build-module/components/async-mode-provider/index.mjs.map +1 -1
- package/build-module/components/async-mode-provider/use-async-mode.mjs +1 -1
- package/build-module/components/async-mode-provider/use-async-mode.mjs.map +3 -3
- package/build-module/components/registry-provider/context.mjs +1 -1
- package/build-module/components/registry-provider/context.mjs.map +1 -1
- package/build-module/components/registry-provider/index.mjs +1 -1
- package/build-module/components/registry-provider/index.mjs.map +1 -1
- package/build-module/components/registry-provider/use-registry.mjs +1 -1
- package/build-module/components/registry-provider/use-registry.mjs.map +3 -3
- package/build-module/components/use-dispatch/index.mjs +1 -1
- package/build-module/components/use-dispatch/index.mjs.map +1 -1
- package/build-module/components/use-dispatch/use-dispatch-with-map.mjs +1 -1
- package/build-module/components/use-dispatch/use-dispatch-with-map.mjs.map +3 -3
- package/build-module/components/use-dispatch/use-dispatch.mjs +1 -1
- package/build-module/components/use-dispatch/use-dispatch.mjs.map +3 -3
- package/build-module/components/use-select/index.mjs +2 -2
- package/build-module/components/use-select/index.mjs.map +3 -3
- package/build-module/components/with-dispatch/index.mjs +1 -1
- package/build-module/components/with-dispatch/index.mjs.map +3 -3
- package/build-module/components/with-registry/index.mjs +1 -1
- package/build-module/components/with-registry/index.mjs.map +3 -3
- package/build-module/components/with-select/index.mjs +1 -1
- package/build-module/components/with-select/index.mjs.map +3 -3
- package/build-module/controls.mjs +7 -6
- package/build-module/controls.mjs.map +3 -3
- package/build-module/default-registry.mjs +3 -2
- package/build-module/default-registry.mjs.map +3 -3
- package/build-module/dispatch.mjs +3 -1
- package/build-module/dispatch.mjs.map +2 -2
- package/build-module/factory.mjs.map +2 -2
- package/build-module/index.mjs +4 -3
- package/build-module/index.mjs.map +2 -2
- package/build-module/plugins/index.mjs +1 -1
- package/build-module/plugins/index.mjs.map +1 -1
- package/build-module/plugins/persistence/index.mjs +13 -8
- package/build-module/plugins/persistence/index.mjs.map +3 -3
- package/build-module/plugins/persistence/storage/default.mjs +1 -1
- package/build-module/plugins/persistence/storage/default.mjs.map +3 -3
- package/build-module/plugins/persistence/storage/object.mjs +1 -1
- package/build-module/plugins/persistence/storage/object.mjs.map +3 -3
- package/build-module/promise-middleware.mjs +2 -1
- package/build-module/promise-middleware.mjs.map +3 -3
- package/build-module/redux-store/index.mjs +32 -16
- package/build-module/redux-store/index.mjs.map +3 -3
- package/build-module/redux-store/metadata/selectors.mjs +1 -1
- package/build-module/redux-store/metadata/selectors.mjs.map +3 -3
- package/build-module/redux-store/metadata/types.mjs +1 -0
- package/build-module/redux-store/metadata/types.mjs.map +7 -0
- package/build-module/registry.mjs +11 -7
- package/build-module/registry.mjs.map +3 -3
- package/build-module/resolvers-cache-middleware.mjs +6 -3
- package/build-module/resolvers-cache-middleware.mjs.map +3 -3
- package/build-module/select.mjs +3 -1
- package/build-module/select.mjs.map +2 -2
- package/build-module/store/index.mjs +1 -1
- package/build-module/store/index.mjs.map +3 -3
- package/build-types/components/async-mode-provider/context.d.ts +37 -3
- package/build-types/components/async-mode-provider/context.d.ts.map +1 -1
- package/build-types/components/async-mode-provider/index.d.ts +2 -2
- package/build-types/components/async-mode-provider/index.d.ts.map +1 -1
- package/build-types/components/async-mode-provider/use-async-mode.d.ts.map +1 -1
- package/build-types/components/registry-provider/context.d.ts +10 -3
- package/build-types/components/registry-provider/context.d.ts.map +1 -1
- package/build-types/components/registry-provider/index.d.ts +2 -2
- package/build-types/components/registry-provider/index.d.ts.map +1 -1
- package/build-types/components/registry-provider/use-registry.d.ts +3 -2
- package/build-types/components/registry-provider/use-registry.d.ts.map +1 -1
- package/build-types/components/use-dispatch/index.d.ts +2 -2
- package/build-types/components/use-dispatch/index.d.ts.map +1 -1
- package/build-types/components/use-dispatch/use-dispatch-with-map.d.ts +11 -9
- package/build-types/components/use-dispatch/use-dispatch-with-map.d.ts.map +1 -1
- package/build-types/components/use-dispatch/use-dispatch.d.ts +10 -19
- package/build-types/components/use-dispatch/use-dispatch.d.ts.map +1 -1
- package/build-types/components/use-select/index.d.ts +24 -28
- package/build-types/components/use-select/index.d.ts.map +1 -1
- package/build-types/components/with-dispatch/index.d.ts +10 -11
- package/build-types/components/with-dispatch/index.d.ts.map +1 -1
- package/build-types/components/with-registry/index.d.ts +2 -6
- package/build-types/components/with-registry/index.d.ts.map +1 -1
- package/build-types/components/with-select/index.d.ts +7 -8
- package/build-types/components/with-select/index.d.ts.map +1 -1
- package/build-types/controls.d.ts +57 -44
- package/build-types/controls.d.ts.map +1 -1
- package/build-types/default-registry.d.ts +2 -2
- package/build-types/default-registry.d.ts.map +1 -1
- package/build-types/dispatch.d.ts +4 -0
- package/build-types/dispatch.d.ts.map +1 -1
- package/build-types/factory.d.ts +2 -1
- package/build-types/factory.d.ts.map +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/plugins/index.d.ts +1 -1
- package/build-types/plugins/index.d.ts.map +1 -1
- package/build-types/plugins/persistence/index.d.ts +38 -27
- package/build-types/plugins/persistence/index.d.ts.map +1 -1
- package/build-types/plugins/persistence/storage/default.d.ts +7 -1
- package/build-types/plugins/persistence/storage/default.d.ts.map +1 -1
- package/build-types/plugins/persistence/storage/object.d.ts +4 -5
- package/build-types/plugins/persistence/storage/object.d.ts.map +1 -1
- package/build-types/promise-middleware.d.ts +6 -4
- package/build-types/promise-middleware.d.ts.map +1 -1
- package/build-types/redux-store/index.d.ts +12 -15
- package/build-types/redux-store/index.d.ts.map +1 -1
- package/build-types/redux-store/metadata/selectors.d.ts +45 -50
- package/build-types/redux-store/metadata/selectors.d.ts.map +1 -1
- package/build-types/redux-store/metadata/types.d.ts +48 -0
- package/build-types/redux-store/metadata/types.d.ts.map +1 -0
- package/build-types/registry.d.ts +5 -49
- package/build-types/registry.d.ts.map +1 -1
- package/build-types/resolvers-cache-middleware.d.ts +13 -7
- package/build-types/resolvers-cache-middleware.d.ts.map +1 -1
- package/build-types/select.d.ts +3 -0
- package/build-types/select.d.ts.map +1 -1
- package/build-types/store/index.d.ts +5 -12
- package/build-types/store/index.d.ts.map +1 -1
- package/build-types/types.d.ts +201 -10
- package/build-types/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/components/async-mode-provider/{context.js → context.ts} +0 -1
- package/src/components/async-mode-provider/{use-async-mode.js → use-async-mode.ts} +1 -1
- package/src/components/registry-provider/{use-registry.js → use-registry.ts} +3 -2
- package/src/components/use-dispatch/{use-dispatch-with-map.js → use-dispatch-with-map.ts} +18 -9
- package/src/components/use-dispatch/{use-dispatch.js → use-dispatch.ts} +25 -20
- package/src/components/use-select/{index.js → index.ts} +84 -70
- package/src/components/with-dispatch/{index.js → index.tsx} +20 -13
- package/src/components/with-registry/{index.js → index.tsx} +1 -5
- package/src/components/with-select/{index.js → index.tsx} +17 -10
- package/src/{controls.js → controls.ts} +53 -26
- package/src/{default-registry.js → default-registry.ts} +3 -1
- package/src/dispatch.ts +7 -1
- package/src/factory.ts +4 -3
- package/src/index.ts +4 -8
- package/src/plugins/persistence/{index.js → index.ts} +93 -54
- package/src/plugins/persistence/storage/{default.js → default.ts} +3 -2
- package/src/plugins/persistence/storage/object.ts +25 -0
- package/src/{promise-middleware.js → promise-middleware.ts} +3 -3
- package/src/redux-store/{index.js → index.ts} +218 -131
- package/src/redux-store/metadata/{selectors.js → selectors.ts} +83 -54
- package/src/redux-store/metadata/types.ts +100 -0
- package/src/{registry.js → registry.ts} +98 -88
- package/src/{resolvers-cache-middleware.js → resolvers-cache-middleware.ts} +22 -7
- package/src/select.ts +6 -1
- package/src/store/{index.js → index.ts} +13 -8
- package/src/types.ts +263 -24
- package/src/plugins/persistence/storage/object.js +0 -23
- /package/src/components/async-mode-provider/{index.js → index.ts} +0 -0
- /package/src/components/registry-provider/{context.js → context.ts} +0 -0
- /package/src/components/registry-provider/{index.js → index.ts} +0 -0
- /package/src/components/use-dispatch/{index.js → index.ts} +0 -0
- /package/src/plugins/{index.js → index.ts} +0 -0
|
@@ -1,41 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* and `set` respectively).
|
|
4
|
-
*
|
|
5
|
-
* @param {WPDataPersistencePluginOptions} options Plugin options.
|
|
6
|
-
*
|
|
7
|
-
* @return {Object} Persistence interface.
|
|
8
|
-
*/
|
|
9
|
-
export function createPersistenceInterface(options: WPDataPersistencePluginOptions): Object;
|
|
10
|
-
export function withLazySameState(reducer: Function): Function;
|
|
11
|
-
export default persistencePlugin;
|
|
12
|
-
export type WPDataRegistry = import("../../registry").WPDataRegistry;
|
|
13
|
-
export type WPDataPlugin = import("../../registry").WPDataPlugin;
|
|
14
|
-
/**
|
|
15
|
-
* Persistence plugin options.
|
|
16
|
-
*/
|
|
17
|
-
export type WPDataPersistencePluginOptions = {
|
|
1
|
+
import type { DataRegistry, StorageInterface } from '../../types';
|
|
2
|
+
interface PersistencePluginOptions {
|
|
18
3
|
/**
|
|
19
4
|
* Persistent storage implementation. This must
|
|
20
5
|
* at least implement `getItem` and `setItem` of
|
|
21
6
|
* the Web Storage API.
|
|
22
7
|
*/
|
|
23
|
-
storage
|
|
8
|
+
storage?: StorageInterface;
|
|
24
9
|
/**
|
|
25
10
|
* Key on which to set in persistent storage.
|
|
26
11
|
*/
|
|
27
|
-
storageKey
|
|
28
|
-
}
|
|
12
|
+
storageKey?: string;
|
|
13
|
+
}
|
|
14
|
+
interface PersistenceInterface {
|
|
15
|
+
get: () => Record<string, unknown>;
|
|
16
|
+
set: (key: string, value: unknown) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Higher-order reducer which invokes the original reducer only if state is
|
|
20
|
+
* inequal from that of the action's `nextState` property, otherwise returning
|
|
21
|
+
* the original state reference.
|
|
22
|
+
*
|
|
23
|
+
* @param reducer Original reducer.
|
|
24
|
+
*
|
|
25
|
+
* @return Enhanced reducer.
|
|
26
|
+
*/
|
|
27
|
+
export declare const withLazySameState: (reducer: (state: any, action: any) => any) => (state: unknown, action: {
|
|
28
|
+
nextState: unknown;
|
|
29
|
+
}) => any;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a persistence interface, exposing getter and setter methods (`get`
|
|
32
|
+
* and `set` respectively).
|
|
33
|
+
*
|
|
34
|
+
* @param options Plugin options.
|
|
35
|
+
*
|
|
36
|
+
* @return Persistence interface.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createPersistenceInterface(options: PersistencePluginOptions): PersistenceInterface;
|
|
29
39
|
/**
|
|
30
40
|
* Data plugin to persist store state into a single storage key.
|
|
31
41
|
*
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
42
|
+
* @param registry Data registry.
|
|
43
|
+
* @param pluginOptions Plugin options.
|
|
34
44
|
*
|
|
35
|
-
* @return
|
|
45
|
+
* @return Data plugin.
|
|
36
46
|
*/
|
|
37
|
-
declare function persistencePlugin(registry:
|
|
38
|
-
declare
|
|
39
|
-
|
|
40
|
-
}
|
|
47
|
+
declare function persistencePlugin(registry: DataRegistry, pluginOptions: PersistencePluginOptions): Partial<DataRegistry>;
|
|
48
|
+
declare const _default: typeof persistencePlugin & {
|
|
49
|
+
__unstableMigrate: () => void;
|
|
50
|
+
};
|
|
51
|
+
export default _default;
|
|
41
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/persistence/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/persistence/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACX,YAAY,EAEZ,gBAAgB,EAChB,MAAM,aAAa,CAAC;AAErB,UAAU,wBAAwB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,oBAAoB;IAC7B,GAAG,EAAE,MAAM,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAC;IACrC,GAAG,EAAE,CAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAM,IAAI,CAAC;CAC7C;AAYD;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC3B,SAAS,CAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAM,GAAG,MAC3C,OAAO,OAAO,EAAE,QAAQ;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAM/C,CAAC;AAEH;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,wBAAwB,GAC/B,oBAAoB,CA+CtB;AAED;;;;;;;GAOG;AACH,iBAAS,iBAAiB,CACzB,QAAQ,EAAE,YAAY,EACtB,aAAa,EAAE,wBAAwB,GACrC,OAAO,CAAE,YAAY,CAAE,CA8HzB;;;;AAED,wBAEI"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { StorageInterface } from '../../../types';
|
|
5
|
+
declare let storage: StorageInterface & {
|
|
6
|
+
removeItem?: (key: string) => void;
|
|
7
|
+
};
|
|
1
8
|
export default storage;
|
|
2
|
-
declare let storage: any;
|
|
3
9
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/plugins/persistence/storage/default.
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/plugins/persistence/storage/default.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,QAAA,IAAI,OAAO,EAAE,gBAAgB,GAAG;IAAE,UAAU,CAAC,EAAE,CAAE,GAAG,EAAE,MAAM,KAAM,IAAI,CAAA;CAAE,CAAC;AAazE,eAAe,OAAO,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type { StorageInterface } from '../../../types';
|
|
2
|
+
declare const storage: StorageInterface & {
|
|
3
|
+
clear: VoidFunction;
|
|
4
|
+
};
|
|
1
5
|
export default storage;
|
|
2
|
-
declare namespace storage {
|
|
3
|
-
function getItem(key: any): any;
|
|
4
|
-
function setItem(key: any, value: any): void;
|
|
5
|
-
function clear(): void;
|
|
6
|
-
}
|
|
7
6
|
//# sourceMappingURL=object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../src/plugins/persistence/storage/object.
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../../src/plugins/persistence/storage/object.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD,QAAA,MAAM,OAAO,EAAE,gBAAgB,GAAG;IAAE,KAAK,EAAE,YAAY,CAAA;CAkBtD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Middleware } from 'redux';
|
|
2
5
|
/**
|
|
3
6
|
* Simplest possible promise redux middleware.
|
|
4
|
-
*
|
|
5
|
-
* @type {import('redux').Middleware}
|
|
6
7
|
*/
|
|
7
|
-
declare const promiseMiddleware:
|
|
8
|
+
declare const promiseMiddleware: Middleware;
|
|
9
|
+
export default promiseMiddleware;
|
|
8
10
|
//# sourceMappingURL=promise-middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promise-middleware.d.ts","sourceRoot":"","sources":["../src/promise-middleware.
|
|
1
|
+
{"version":3,"file":"promise-middleware.d.ts","sourceRoot":"","sources":["../src/promise-middleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGxC;;GAEG;AACH,QAAA,MAAM,iBAAiB,EAAE,UAWxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { combineReducers } from './combine-reducers';
|
|
5
|
+
import type { StoreDescriptor, ReduxStoreConfig } from '../types';
|
|
6
|
+
export { combineReducers };
|
|
1
7
|
/**
|
|
2
8
|
* Creates a data store descriptor for the provided Redux store configuration containing
|
|
3
9
|
* properties describing reducer, actions, selectors, controls and resolvers.
|
|
@@ -14,21 +20,12 @@
|
|
|
14
20
|
* } );
|
|
15
21
|
* ```
|
|
16
22
|
*
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* @param {ReduxStoreConfig<State,Actions,Selectors>} options Registered store options, with properties
|
|
22
|
-
* describing reducer, actions, selectors,
|
|
23
|
-
* and resolvers.
|
|
23
|
+
* @param key Unique namespace identifier.
|
|
24
|
+
* @param options Registered store options, with properties
|
|
25
|
+
* describing reducer, actions, selectors,
|
|
26
|
+
* and resolvers.
|
|
24
27
|
*
|
|
25
|
-
* @return
|
|
28
|
+
* @return Store Object.
|
|
26
29
|
*/
|
|
27
|
-
export default function createReduxStore<State, Actions
|
|
28
|
-
export { combineReducers };
|
|
29
|
-
export type DataRegistry = import("../types").DataRegistry;
|
|
30
|
-
export type ListenerFunction = import("../types").ListenerFunction;
|
|
31
|
-
export type StoreDescriptor<C extends import("../types").AnyConfig> = import("../types").StoreDescriptor<C>;
|
|
32
|
-
export type ReduxStoreConfig<State, Actions extends Record<string, import("../types").ActionCreator>, Selectors> = import("../types").ReduxStoreConfig<State, Actions, Selectors>;
|
|
33
|
-
import { combineReducers } from './combine-reducers';
|
|
30
|
+
export default function createReduxStore<State, Actions, Selectors>(key: string, options: ReduxStoreConfig<State, Actions, Selectors>): StoreDescriptor<ReduxStoreConfig<State, Actions, Selectors>>;
|
|
34
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/redux-store/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/redux-store/index.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AASrD,OAAO,KAAK,EAGX,eAAe,EACf,gBAAgB,EAGhB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,eAAe,EAAE,CAAC;AA6I3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAClE,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,gBAAgB,CAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAE,GACpD,eAAe,CAAE,gBAAgB,CAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAE,CAAE,CA8WlE"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
/** @typedef {import('./reducer').StateValue} StateValue */
|
|
3
|
-
/** @typedef {import('./reducer').Status} Status */
|
|
1
|
+
import type { State, StateValue } from './reducer';
|
|
4
2
|
/**
|
|
5
3
|
* Returns the raw resolution state value for a given selector name,
|
|
6
4
|
* and arguments set. May be undefined if the selector has never been resolved
|
|
7
5
|
* or not resolved for the given set of arguments, otherwise true or false for
|
|
8
6
|
* resolution started and completed respectively.
|
|
9
7
|
*
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
8
|
+
* @param state Data state.
|
|
9
|
+
* @param selectorName Selector name.
|
|
10
|
+
* @param args Arguments passed to selector.
|
|
13
11
|
*
|
|
14
|
-
* @return
|
|
12
|
+
* @return isResolving value.
|
|
15
13
|
*/
|
|
16
|
-
export function getResolutionState(state:
|
|
14
|
+
export declare function getResolutionState(state: Record<string, State>, selectorName: string, args?: unknown[] | null): StateValue | undefined;
|
|
17
15
|
/**
|
|
18
16
|
* Returns an `isResolving`-like value for a given selector name and arguments set.
|
|
19
17
|
* Its value is either `undefined` if the selector has never been resolved or has been
|
|
@@ -26,94 +24,91 @@ export function getResolutionState(state: State, selectorName: string, args: unk
|
|
|
26
24
|
*
|
|
27
25
|
* @deprecated
|
|
28
26
|
*
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
27
|
+
* @param state Data state.
|
|
28
|
+
* @param selectorName Selector name.
|
|
29
|
+
* @param args Arguments passed to selector.
|
|
32
30
|
*
|
|
33
|
-
* @return
|
|
31
|
+
* @return isResolving value.
|
|
34
32
|
*/
|
|
35
|
-
export function getIsResolving(state:
|
|
33
|
+
export declare function getIsResolving(state: Record<string, State>, selectorName: string, args?: unknown[] | null): boolean | undefined;
|
|
36
34
|
/**
|
|
37
35
|
* Returns true if resolution has already been triggered for a given
|
|
38
36
|
* selector name, and arguments set.
|
|
39
37
|
*
|
|
40
|
-
* @param
|
|
41
|
-
* @param
|
|
42
|
-
* @param
|
|
38
|
+
* @param state Data state.
|
|
39
|
+
* @param selectorName Selector name.
|
|
40
|
+
* @param args Arguments passed to selector.
|
|
43
41
|
*
|
|
44
|
-
* @return
|
|
42
|
+
* @return Whether resolution has been triggered.
|
|
45
43
|
*/
|
|
46
|
-
export function hasStartedResolution(state:
|
|
44
|
+
export declare function hasStartedResolution(state: Record<string, State>, selectorName: string, args?: unknown[] | null): boolean;
|
|
47
45
|
/**
|
|
48
46
|
* Returns true if resolution has completed for a given selector
|
|
49
47
|
* name, and arguments set.
|
|
50
48
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
49
|
+
* @param state Data state.
|
|
50
|
+
* @param selectorName Selector name.
|
|
51
|
+
* @param args Arguments passed to selector.
|
|
54
52
|
*
|
|
55
|
-
* @return
|
|
53
|
+
* @return Whether resolution has completed.
|
|
56
54
|
*/
|
|
57
|
-
export function hasFinishedResolution(state:
|
|
55
|
+
export declare function hasFinishedResolution(state: Record<string, State>, selectorName: string, args?: unknown[] | null): boolean;
|
|
58
56
|
/**
|
|
59
57
|
* Returns true if resolution has failed for a given selector
|
|
60
58
|
* name, and arguments set.
|
|
61
59
|
*
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
60
|
+
* @param state Data state.
|
|
61
|
+
* @param selectorName Selector name.
|
|
62
|
+
* @param args Arguments passed to selector.
|
|
65
63
|
*
|
|
66
|
-
* @return
|
|
64
|
+
* @return Has resolution failed
|
|
67
65
|
*/
|
|
68
|
-
export function hasResolutionFailed(state:
|
|
66
|
+
export declare function hasResolutionFailed(state: Record<string, State>, selectorName: string, args?: unknown[] | null): boolean;
|
|
69
67
|
/**
|
|
70
68
|
* Returns the resolution error for a given selector name, and arguments set.
|
|
71
69
|
* Note it may be of an Error type, but may also be null, undefined, or anything else
|
|
72
70
|
* that can be `throw`-n.
|
|
73
71
|
*
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
72
|
+
* @param state Data state.
|
|
73
|
+
* @param selectorName Selector name.
|
|
74
|
+
* @param args Arguments passed to selector.
|
|
77
75
|
*
|
|
78
|
-
* @return
|
|
76
|
+
* @return Last resolution error
|
|
79
77
|
*/
|
|
80
|
-
export function getResolutionError(state:
|
|
78
|
+
export declare function getResolutionError(state: Record<string, State>, selectorName: string, args?: unknown[] | null): Error | unknown;
|
|
81
79
|
/**
|
|
82
80
|
* Returns true if resolution has been triggered but has not yet completed for
|
|
83
81
|
* a given selector name, and arguments set.
|
|
84
82
|
*
|
|
85
|
-
* @param
|
|
86
|
-
* @param
|
|
87
|
-
* @param
|
|
83
|
+
* @param state Data state.
|
|
84
|
+
* @param selectorName Selector name.
|
|
85
|
+
* @param args Arguments passed to selector.
|
|
88
86
|
*
|
|
89
|
-
* @return
|
|
87
|
+
* @return Whether resolution is in progress.
|
|
90
88
|
*/
|
|
91
|
-
export function isResolving(state:
|
|
89
|
+
export declare function isResolving(state: Record<string, State>, selectorName: string, args?: unknown[] | null): boolean;
|
|
92
90
|
/**
|
|
93
91
|
* Returns the list of the cached resolvers.
|
|
94
92
|
*
|
|
95
|
-
* @param
|
|
93
|
+
* @param state Data state.
|
|
96
94
|
*
|
|
97
|
-
* @return
|
|
95
|
+
* @return Resolvers mapped by args and selectorName.
|
|
98
96
|
*/
|
|
99
|
-
export function getCachedResolvers(state: State): State
|
|
97
|
+
export declare function getCachedResolvers(state: Record<string, State>): Record<string, State>;
|
|
100
98
|
/**
|
|
101
99
|
* Whether the store has any currently resolving selectors.
|
|
102
100
|
*
|
|
103
|
-
* @param
|
|
101
|
+
* @param state Data state.
|
|
104
102
|
*
|
|
105
|
-
* @return
|
|
103
|
+
* @return True if one or more selectors are resolving, false otherwise.
|
|
106
104
|
*/
|
|
107
|
-
export function hasResolvingSelectors(state: State): boolean;
|
|
105
|
+
export declare function hasResolvingSelectors(state: Record<string, State>): boolean;
|
|
108
106
|
/**
|
|
109
107
|
* Retrieves the total number of selectors, grouped per status.
|
|
110
108
|
*
|
|
111
|
-
* @param
|
|
109
|
+
* @param state Data state.
|
|
112
110
|
*
|
|
113
|
-
* @return
|
|
111
|
+
* @return Object, containing selector totals by status.
|
|
114
112
|
*/
|
|
115
|
-
export const countSelectorsByStatus: ((state:
|
|
116
|
-
export type State = Record<string, import("./reducer").State>;
|
|
117
|
-
export type StateValue = import("./reducer").StateValue;
|
|
118
|
-
export type Status = import("./reducer").Status;
|
|
113
|
+
export declare const countSelectorsByStatus: ((state: Record<string, State>) => Record<string, number>) & import("rememo").EnhancedSelector;
|
|
119
114
|
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/redux-store/metadata/selectors.
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/redux-store/metadata/selectors.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,MAAM,CAAE,MAAM,EAAE,KAAK,CAAE,EAC9B,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,GACrB,UAAU,GAAG,SAAS,CAOxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,MAAM,CAAE,MAAM,EAAE,KAAK,CAAE,EAC9B,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,GACrB,OAAO,GAAG,SAAS,CASrB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE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MAAM,CAAE,MAAM,EAAE,MAAM,CAAE,qCAyB5D,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { StoreDescriptor, ReduxStoreConfig } from '../../types';
|
|
5
|
+
import type { StateValue as MetadataStateValue } from './reducer';
|
|
6
|
+
/**
|
|
7
|
+
* Extracts selector key names from a store descriptor.
|
|
8
|
+
* Falls back to `string` when the store type is unknown.
|
|
9
|
+
*/
|
|
10
|
+
export type SelectorKeysOf<S> = S extends StoreDescriptor<ReduxStoreConfig<any, any, infer Selectors>> ? string & keyof Selectors : string;
|
|
11
|
+
/**
|
|
12
|
+
* Metadata selectors injected into every Redux store.
|
|
13
|
+
*
|
|
14
|
+
* These are resolution-tracking selectors that the data module
|
|
15
|
+
* automatically adds to every registered store. The `S` parameter
|
|
16
|
+
* provides type-safe selector names via `SelectorKeysOf`.
|
|
17
|
+
*/
|
|
18
|
+
export type MetadataSelectors<S = unknown> = {
|
|
19
|
+
getResolutionState: (selectorName: SelectorKeysOf<S>, args?: unknown[] | null) => MetadataStateValue | undefined;
|
|
20
|
+
getIsResolving: (selectorName: SelectorKeysOf<S>, args?: unknown[] | null) => boolean | undefined;
|
|
21
|
+
hasStartedResolution: (selectorName: SelectorKeysOf<S>, args?: unknown[] | null) => boolean;
|
|
22
|
+
hasFinishedResolution: (selectorName: SelectorKeysOf<S>, args?: unknown[] | null) => boolean;
|
|
23
|
+
hasResolutionFailed: (selectorName: SelectorKeysOf<S>, args?: unknown[] | null) => boolean;
|
|
24
|
+
getResolutionError: (selectorName: SelectorKeysOf<S>, args?: unknown[] | null) => Error | unknown;
|
|
25
|
+
isResolving: (selectorName: SelectorKeysOf<S>, args?: unknown[] | null) => boolean;
|
|
26
|
+
getCachedResolvers: () => Record<string, unknown>;
|
|
27
|
+
hasResolvingSelectors: () => boolean;
|
|
28
|
+
countSelectorsByStatus: () => Record<string, number>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Metadata actions injected into every Redux store.
|
|
32
|
+
*
|
|
33
|
+
* These are resolution-tracking actions that the data module
|
|
34
|
+
* automatically adds to every registered store. The `S` parameter
|
|
35
|
+
* provides type-safe selector names via `SelectorKeysOf`.
|
|
36
|
+
*/
|
|
37
|
+
export type MetadataActions<S = unknown> = {
|
|
38
|
+
startResolution: (selectorName: SelectorKeysOf<S>, args: unknown[]) => Promise<void>;
|
|
39
|
+
finishResolution: (selectorName: SelectorKeysOf<S>, args: unknown[]) => Promise<void>;
|
|
40
|
+
failResolution: (selectorName: SelectorKeysOf<S>, args: unknown[], error: Error | unknown) => Promise<void>;
|
|
41
|
+
startResolutions: (selectorName: SelectorKeysOf<S>, args: unknown[][]) => Promise<void>;
|
|
42
|
+
finishResolutions: (selectorName: SelectorKeysOf<S>, args: unknown[][]) => Promise<void>;
|
|
43
|
+
failResolutions: (selectorName: SelectorKeysOf<S>, args: unknown[], errors: (Error | unknown)[]) => Promise<void>;
|
|
44
|
+
invalidateResolution: (selectorName: SelectorKeysOf<S>, args: unknown[]) => Promise<void>;
|
|
45
|
+
invalidateResolutionForStore: () => Promise<void>;
|
|
46
|
+
invalidateResolutionForStoreSelector: (selectorName: SelectorKeysOf<S>) => Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/redux-store/metadata/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,IAAI,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAE,CAAC,IAAK,CAAC,SAAS,eAAe,CAC1D,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,MAAM,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E,CAAC;CACrB,CAAC"}
|
|
@@ -1,56 +1,12 @@
|
|
|
1
|
+
import type { DataRegistry, ReduxStoreConfig } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* Creates a new store registry, given an optional object of initial store
|
|
3
4
|
* configurations.
|
|
4
5
|
*
|
|
5
|
-
* @param
|
|
6
|
-
* @param
|
|
6
|
+
* @param storeConfigs Initial store configurations.
|
|
7
|
+
* @param parent Parent registry.
|
|
7
8
|
*
|
|
8
|
-
* @return
|
|
9
|
+
* @return Data registry.
|
|
9
10
|
*/
|
|
10
|
-
export function createRegistry(storeConfigs?:
|
|
11
|
-
export type StoreDescriptor = import("./types").StoreDescriptor;
|
|
12
|
-
/**
|
|
13
|
-
* An isolated orchestrator of store registrations.
|
|
14
|
-
*/
|
|
15
|
-
export type WPDataRegistry = {
|
|
16
|
-
/**
|
|
17
|
-
* Given a namespace key and settings
|
|
18
|
-
* object, registers a new generic
|
|
19
|
-
* store.
|
|
20
|
-
*/
|
|
21
|
-
registerGenericStore: Function;
|
|
22
|
-
/**
|
|
23
|
-
* Given a namespace key and settings
|
|
24
|
-
* object, registers a new namespace
|
|
25
|
-
* store.
|
|
26
|
-
*/
|
|
27
|
-
registerStore: Function;
|
|
28
|
-
/**
|
|
29
|
-
* Given a function callback, invokes
|
|
30
|
-
* the callback on any change to state
|
|
31
|
-
* within any registered store.
|
|
32
|
-
*/
|
|
33
|
-
subscribe: Function;
|
|
34
|
-
/**
|
|
35
|
-
* Given a namespace key, returns an
|
|
36
|
-
* object of the store's registered
|
|
37
|
-
* selectors.
|
|
38
|
-
*/
|
|
39
|
-
select: Function;
|
|
40
|
-
/**
|
|
41
|
-
* Given a namespace key, returns an
|
|
42
|
-
* object of the store's registered
|
|
43
|
-
* action dispatchers.
|
|
44
|
-
*/
|
|
45
|
-
dispatch: Function;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* An object of registry function overrides.
|
|
49
|
-
*/
|
|
50
|
-
export type WPDataPlugin = {
|
|
51
|
-
/**
|
|
52
|
-
* registers store.
|
|
53
|
-
*/
|
|
54
|
-
registerStore: Function;
|
|
55
|
-
};
|
|
11
|
+
export declare function createRegistry(storeConfigs?: Record<string, ReduxStoreConfig<any, any, any>>, parent?: DataRegistry | null): DataRegistry;
|
|
56
12
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAGX,YAAY,EAIZ,gBAAgB,EAChB,MAAM,SAAS,CAAC;AAQjB;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,YAAY,GAAE,MAAM,CAAE,MAAM,EAAE,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAO,EACtE,MAAM,GAAE,YAAY,GAAG,IAAW,GAChC,YAAY,CA8Wd"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Middleware } from 'redux';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import type { DataRegistry } from './types';
|
|
4
9
|
/**
|
|
5
10
|
* Creates a middleware handling resolvers cache invalidation.
|
|
6
11
|
*
|
|
7
|
-
* @param
|
|
8
|
-
* @param
|
|
12
|
+
* @param registry Registry for which to create the middleware.
|
|
13
|
+
* @param storeName Name of the store for which to create the middleware.
|
|
9
14
|
*
|
|
10
|
-
* @return
|
|
15
|
+
* @return Middleware function.
|
|
11
16
|
*/
|
|
12
|
-
declare
|
|
17
|
+
declare const createResolversCacheMiddleware: (registry: DataRegistry, storeName: string) => Middleware;
|
|
18
|
+
export default createResolversCacheMiddleware;
|
|
13
19
|
//# sourceMappingURL=resolvers-cache-middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolvers-cache-middleware.d.ts","sourceRoot":"","sources":["../src/resolvers-cache-middleware.
|
|
1
|
+
{"version":3,"file":"resolvers-cache-middleware.d.ts","sourceRoot":"","sources":["../src/resolvers-cache-middleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAExC;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;GAOG;AACH,QAAA,MAAM,8BAA8B,GACjC,UAAU,YAAY,EAAE,WAAW,MAAM,KAAI,UAyC9C,CAAC;AAEH,eAAe,8BAA8B,CAAC"}
|
package/build-types/select.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ import type { AnyConfig, CurriedSelectorsOf, StoreDescriptor } from './types';
|
|
|
7
7
|
* The selector functions are been pre-bound to pass the current state automatically.
|
|
8
8
|
* As a consumer, you need only pass arguments of the selector, if applicable.
|
|
9
9
|
*
|
|
10
|
+
* Warning: This global `select` function only works with the default registry.
|
|
11
|
+
* It will not work with custom `RegistryProvider` or `BlockEditorProvider` contexts.
|
|
12
|
+
* In React components, prefer the `useSelect` hook instead, which is registry-aware.
|
|
10
13
|
*
|
|
11
14
|
* @param storeNameOrDescriptor The store descriptor. The legacy calling convention
|
|
12
15
|
* of passing the store name is also supported.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/select.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG9E
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/select.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,MAAM,CAAE,CAAC,SAAS,eAAe,CAAE,SAAS,CAAE,EAC7D,qBAAqB,EAAE,MAAM,GAAG,CAAC,GAC/B,kBAAkB,CAAE,CAAC,CAAE,CAIzB"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { StoreDescriptor, AnyConfig } from '../types';
|
|
5
|
+
declare const coreDataStore: StoreDescriptor<AnyConfig>;
|
|
1
6
|
export default coreDataStore;
|
|
2
|
-
declare namespace coreDataStore {
|
|
3
|
-
let name: string;
|
|
4
|
-
function instantiate(registry: any): {
|
|
5
|
-
getSelectors(): {
|
|
6
|
-
[k: string]: (key: any, ...args: any[]) => any;
|
|
7
|
-
};
|
|
8
|
-
getActions(): {
|
|
9
|
-
[k: string]: (key: any, ...args: any[]) => any;
|
|
10
|
-
};
|
|
11
|
-
subscribe(): () => () => void;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAgB,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEzE,QAAA,MAAM,aAAa,EAAE,eAAe,CAAE,SAAS,CAuD9C,CAAC;AAEF,eAAe,aAAa,CAAC"}
|