@player-ui/player 0.8.0--canary.307.9621 → 0.8.0-next.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/dist/Player.native.js +11630 -0
- package/dist/Player.native.js.map +1 -0
- package/dist/cjs/index.cjs +5626 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/{index.esm.js → index.legacy-esm.js} +2044 -1667
- package/dist/{index.cjs.js → index.mjs} +2052 -1761
- package/dist/index.mjs.map +1 -0
- package/package.json +29 -63
- package/src/__tests__/data.test.ts +498 -0
- package/src/__tests__/flow.test.ts +312 -0
- package/src/__tests__/helpers/action-exp.plugin.ts +22 -0
- package/src/__tests__/helpers/actions.flow.ts +67 -0
- package/src/__tests__/helpers/binding.plugin.ts +125 -0
- package/src/__tests__/helpers/expression.plugin.ts +88 -0
- package/src/__tests__/helpers/transform-plugin.ts +19 -0
- package/src/__tests__/helpers/validation.flow.ts +56 -0
- package/src/__tests__/player.test.ts +597 -0
- package/src/__tests__/string-resolver.test.ts +186 -0
- package/src/__tests__/validation.test.ts +3555 -0
- package/src/__tests__/view.test.ts +715 -0
- package/src/binding/__tests__/binding.test.ts +113 -0
- package/src/binding/__tests__/index.test.ts +208 -0
- package/src/binding/__tests__/resolver.test.ts +83 -0
- package/src/binding/binding.ts +6 -6
- package/src/binding/index.ts +34 -34
- package/src/binding/resolver.ts +19 -19
- package/src/binding/utils.ts +7 -7
- package/src/binding-grammar/__tests__/parser.test.ts +64 -0
- package/src/binding-grammar/__tests__/test-utils/ast-cases.ts +198 -0
- package/src/binding-grammar/__tests__/test-utils/perf-test.ts +66 -0
- package/src/binding-grammar/ast.ts +11 -11
- package/src/binding-grammar/custom/index.ts +19 -22
- package/src/binding-grammar/ebnf/index.ts +20 -21
- package/src/binding-grammar/ebnf/types.ts +13 -13
- package/src/binding-grammar/index.ts +4 -4
- package/src/binding-grammar/parsimmon/index.ts +14 -14
- package/src/controllers/constants/__tests__/index.test.ts +106 -0
- package/src/controllers/constants/index.ts +3 -3
- package/src/controllers/constants/utils.ts +4 -4
- package/src/controllers/data/controller.ts +22 -22
- package/src/controllers/data/index.ts +1 -1
- package/src/controllers/data/utils.ts +7 -7
- package/src/controllers/flow/__tests__/controller.test.ts +195 -0
- package/src/controllers/flow/__tests__/flow.test.ts +381 -0
- package/src/controllers/flow/controller.ts +13 -13
- package/src/controllers/flow/flow.ts +23 -23
- package/src/controllers/flow/index.ts +2 -2
- package/src/controllers/index.ts +5 -5
- package/src/controllers/validation/binding-tracker.ts +71 -59
- package/src/controllers/validation/controller.ts +104 -104
- package/src/controllers/validation/index.ts +2 -2
- package/src/controllers/view/asset-transform.ts +20 -20
- package/src/controllers/view/controller.ts +27 -27
- package/src/controllers/view/index.ts +4 -4
- package/src/controllers/view/store.ts +3 -3
- package/src/controllers/view/types.ts +7 -7
- package/src/data/__tests__/__snapshots__/dependency-tracker.test.ts.snap +64 -0
- package/src/data/__tests__/dependency-tracker.test.ts +146 -0
- package/src/data/__tests__/local-model.test.ts +46 -0
- package/src/data/__tests__/model.test.ts +78 -0
- package/src/data/dependency-tracker.ts +16 -16
- package/src/data/index.ts +4 -4
- package/src/data/local-model.ts +6 -6
- package/src/data/model.ts +17 -17
- package/src/data/noop-model.ts +1 -1
- package/src/expressions/__tests__/__snapshots__/parser.test.ts.snap +854 -0
- package/src/expressions/__tests__/evaluator-functions.test.ts +47 -0
- package/src/expressions/__tests__/evaluator.test.ts +410 -0
- package/src/expressions/__tests__/parser.test.ts +115 -0
- package/src/expressions/__tests__/utils.test.ts +44 -0
- package/src/expressions/evaluator-functions.ts +6 -6
- package/src/expressions/evaluator.ts +71 -67
- package/src/expressions/index.ts +4 -4
- package/src/expressions/parser.ts +102 -105
- package/src/expressions/types.ts +29 -21
- package/src/expressions/utils.ts +32 -21
- package/src/index.ts +13 -13
- package/src/logger/__tests__/consoleLogger.test.ts +46 -0
- package/src/logger/__tests__/noopLogger.test.ts +13 -0
- package/src/logger/__tests__/proxyLogger.test.ts +31 -0
- package/src/logger/__tests__/tapableLogger.test.ts +41 -0
- package/src/logger/consoleLogger.ts +9 -9
- package/src/logger/index.ts +5 -5
- package/src/logger/noopLogger.ts +1 -1
- package/src/logger/proxyLogger.ts +6 -6
- package/src/logger/tapableLogger.ts +7 -7
- package/src/logger/types.ts +2 -2
- package/src/player.ts +60 -58
- package/src/plugins/default-exp-plugin.ts +10 -10
- package/src/plugins/default-view-plugin.ts +29 -0
- package/src/plugins/flow-exp-plugin.ts +6 -6
- package/src/schema/__tests__/schema.test.ts +243 -0
- package/src/schema/index.ts +2 -2
- package/src/schema/schema.ts +24 -24
- package/src/schema/types.ts +4 -4
- package/src/string-resolver/__tests__/index.test.ts +361 -0
- package/src/string-resolver/index.ts +17 -17
- package/src/types.ts +17 -17
- package/src/utils/__tests__/replaceParams.test.ts +33 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/replaceParams.ts +1 -1
- package/src/validator/__tests__/binding-map-splice.test.ts +53 -0
- package/src/validator/__tests__/validation-middleware.test.ts +127 -0
- package/src/validator/binding-map-splice.ts +5 -5
- package/src/validator/index.ts +4 -4
- package/src/validator/registry.ts +1 -1
- package/src/validator/types.ts +13 -13
- package/src/validator/validation-middleware.ts +15 -15
- package/src/view/__tests__/view.immutable.test.ts +269 -0
- package/src/view/__tests__/view.test.ts +959 -0
- package/src/view/builder/index.test.ts +69 -0
- package/src/view/builder/index.ts +3 -3
- package/src/view/index.ts +5 -5
- package/src/view/parser/__tests__/__snapshots__/parser.test.ts.snap +394 -0
- package/src/view/parser/__tests__/parser.test.ts +264 -0
- package/src/view/parser/index.ts +43 -33
- package/src/view/parser/types.ts +11 -11
- package/src/view/parser/utils.ts +5 -5
- package/src/view/plugins/__tests__/__snapshots__/template.test.ts.snap +278 -0
- package/src/view/plugins/__tests__/applicability.test.ts +265 -0
- package/src/view/plugins/__tests__/string.test.ts +122 -0
- package/src/view/plugins/__tests__/template.test.ts +724 -0
- package/src/view/plugins/applicability.ts +19 -19
- package/src/view/plugins/index.ts +4 -5
- package/src/view/plugins/options.ts +1 -1
- package/src/view/plugins/string-resolver.ts +22 -22
- package/src/view/plugins/switch.ts +22 -23
- package/src/view/plugins/template-plugin.ts +26 -27
- package/src/view/resolver/__tests__/dependencies.test.ts +321 -0
- package/src/view/resolver/__tests__/edgecases.test.ts +626 -0
- package/src/view/resolver/index.ts +42 -42
- package/src/view/resolver/types.ts +21 -20
- package/src/view/resolver/utils.ts +9 -9
- package/src/view/view.ts +32 -22
- package/types/binding/binding.d.ts +50 -0
- package/types/binding/index.d.ts +29 -0
- package/types/binding/resolver.d.ts +26 -0
- package/types/binding/utils.d.ts +12 -0
- package/types/binding-grammar/ast.d.ts +67 -0
- package/types/binding-grammar/custom/index.d.ts +4 -0
- package/types/binding-grammar/ebnf/index.d.ts +4 -0
- package/types/binding-grammar/ebnf/types.d.ts +75 -0
- package/types/binding-grammar/index.d.ts +5 -0
- package/types/binding-grammar/parsimmon/index.d.ts +4 -0
- package/types/controllers/constants/index.d.ts +45 -0
- package/types/controllers/constants/utils.d.ts +6 -0
- package/types/controllers/data/controller.d.ts +45 -0
- package/types/controllers/data/index.d.ts +2 -0
- package/types/controllers/data/utils.d.ts +14 -0
- package/types/controllers/flow/controller.d.ts +25 -0
- package/types/controllers/flow/flow.d.ts +50 -0
- package/types/controllers/flow/index.d.ts +3 -0
- package/types/controllers/index.d.ts +6 -0
- package/types/controllers/validation/binding-tracker.d.ts +32 -0
- package/types/controllers/validation/controller.d.ts +151 -0
- package/types/controllers/validation/index.d.ts +3 -0
- package/types/controllers/view/asset-transform.d.ts +19 -0
- package/types/controllers/view/controller.d.ts +37 -0
- package/types/controllers/view/index.d.ts +5 -0
- package/types/controllers/view/store.d.ts +20 -0
- package/types/controllers/view/types.d.ts +16 -0
- package/types/data/dependency-tracker.d.ts +49 -0
- package/types/data/index.d.ts +5 -0
- package/types/data/local-model.d.ts +16 -0
- package/types/data/model.d.ts +86 -0
- package/types/data/noop-model.d.ts +13 -0
- package/types/expressions/evaluator-functions.d.ts +15 -0
- package/types/expressions/evaluator.d.ts +52 -0
- package/types/expressions/index.d.ts +5 -0
- package/types/expressions/parser.d.ts +10 -0
- package/types/expressions/types.d.ts +144 -0
- package/types/expressions/utils.d.ts +12 -0
- package/types/index.d.ts +14 -0
- package/types/logger/consoleLogger.d.ts +17 -0
- package/types/logger/index.d.ts +6 -0
- package/types/logger/noopLogger.d.ts +10 -0
- package/types/logger/proxyLogger.d.ts +15 -0
- package/types/logger/tapableLogger.d.ts +23 -0
- package/types/logger/types.d.ts +6 -0
- package/types/player.d.ts +101 -0
- package/types/plugins/default-exp-plugin.d.ts +9 -0
- package/types/plugins/default-view-plugin.d.ts +9 -0
- package/types/plugins/flow-exp-plugin.d.ts +11 -0
- package/types/schema/index.d.ts +3 -0
- package/types/schema/schema.d.ts +36 -0
- package/types/schema/types.d.ts +38 -0
- package/types/string-resolver/index.d.ts +30 -0
- package/types/types.d.ts +73 -0
- package/types/utils/index.d.ts +2 -0
- package/types/utils/replaceParams.d.ts +9 -0
- package/types/validator/binding-map-splice.d.ts +10 -0
- package/types/validator/index.d.ts +5 -0
- package/types/validator/registry.d.ts +11 -0
- package/types/validator/types.d.ts +53 -0
- package/types/validator/validation-middleware.d.ts +36 -0
- package/types/view/builder/index.d.ts +35 -0
- package/types/view/index.d.ts +6 -0
- package/types/view/parser/index.d.ts +52 -0
- package/types/view/parser/types.d.ts +109 -0
- package/types/view/parser/utils.d.ts +6 -0
- package/types/view/plugins/applicability.d.ts +10 -0
- package/types/view/plugins/index.d.ts +5 -0
- package/types/view/plugins/options.d.ts +4 -0
- package/types/view/plugins/string-resolver.d.ts +13 -0
- package/types/view/plugins/switch.d.ts +14 -0
- package/types/view/plugins/template-plugin.d.ts +33 -0
- package/types/view/resolver/index.d.ts +73 -0
- package/types/view/resolver/types.d.ts +129 -0
- package/types/view/resolver/utils.d.ts +11 -0
- package/types/view/view.d.ts +37 -0
- package/dist/index.d.ts +0 -1814
- package/dist/player.dev.js +0 -11472
- package/dist/player.prod.js +0 -2
- package/src/view/plugins/plugin.ts +0 -21
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export interface Node<T extends string> {
|
|
2
|
+
/** The basic node type */
|
|
3
|
+
name: T;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* An AST node that represents a nested path in the model
|
|
7
|
+
* foo.{{bar}}.baz (this is {{bar}})
|
|
8
|
+
*/
|
|
9
|
+
export interface PathNode extends Node<"PathNode"> {
|
|
10
|
+
/** The path in the model that this node represents */
|
|
11
|
+
path: Array<AnyNode>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A segment representing a query
|
|
15
|
+
* [foo=bar]
|
|
16
|
+
*/
|
|
17
|
+
export interface QueryNode extends Node<"Query"> {
|
|
18
|
+
/** The key to query */
|
|
19
|
+
key: AnyNode;
|
|
20
|
+
/** The target value */
|
|
21
|
+
value?: AnyNode;
|
|
22
|
+
}
|
|
23
|
+
/** A simple segment */
|
|
24
|
+
export interface ValueNode extends Node<"Value"> {
|
|
25
|
+
/** The segment value */
|
|
26
|
+
value: string | number;
|
|
27
|
+
}
|
|
28
|
+
/** A nested expression */
|
|
29
|
+
export interface ExpressionNode extends Node<"Expression"> {
|
|
30
|
+
/** The expression */
|
|
31
|
+
value: string;
|
|
32
|
+
}
|
|
33
|
+
/** Helper to create a value node */
|
|
34
|
+
export declare const toValue: (value: string | number) => ValueNode;
|
|
35
|
+
/** Helper to create an expression node */
|
|
36
|
+
export declare const toExpression: (value: string) => ExpressionNode;
|
|
37
|
+
/** Helper to create a nested path node */
|
|
38
|
+
export declare const toPath: (path: Array<AnyNode>) => PathNode;
|
|
39
|
+
/** Helper to create a query node */
|
|
40
|
+
export declare const toQuery: (key: AnyNode, value?: AnyNode) => QueryNode;
|
|
41
|
+
/** Create a concat node */
|
|
42
|
+
export declare const toConcatenatedNode: (values: Array<PathNode | ValueNode | ExpressionNode>) => PathNode | ValueNode | ConcatenatedNode | ExpressionNode;
|
|
43
|
+
/**
|
|
44
|
+
* A binding segment that's multiple smaller ones
|
|
45
|
+
* {{foo}}_bar_{{baz}}
|
|
46
|
+
*/
|
|
47
|
+
export interface ConcatenatedNode extends Node<"Concatenated"> {
|
|
48
|
+
/** A list of nested paths, or value nodes to concat together to form a segment */
|
|
49
|
+
value: Array<PathNode | ValueNode | ExpressionNode>;
|
|
50
|
+
}
|
|
51
|
+
export type AnyNode = PathNode | QueryNode | ValueNode | ConcatenatedNode | ExpressionNode;
|
|
52
|
+
export type Path = Array<AnyNode>;
|
|
53
|
+
export interface ParserSuccessResult {
|
|
54
|
+
/** A successful parse result */
|
|
55
|
+
status: true;
|
|
56
|
+
/** The path the binding represents */
|
|
57
|
+
path: PathNode;
|
|
58
|
+
}
|
|
59
|
+
export interface ParserFailureResult {
|
|
60
|
+
/** A failed parse result */
|
|
61
|
+
status: false;
|
|
62
|
+
/** The message representing the reason the parse result failed */
|
|
63
|
+
error: string;
|
|
64
|
+
}
|
|
65
|
+
export type ParserResult = ParserSuccessResult | ParserFailureResult;
|
|
66
|
+
export type Parser = (raw: string) => ParserResult;
|
|
67
|
+
//# sourceMappingURL=ast.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { IToken } from "ebnf";
|
|
2
|
+
export interface ValueToken extends IToken {
|
|
3
|
+
/** A value type */
|
|
4
|
+
type: "value";
|
|
5
|
+
/** Any children of the value */
|
|
6
|
+
children: Array<SegmentAndBracketToken>;
|
|
7
|
+
}
|
|
8
|
+
export interface SegmentAndBracketToken extends IToken {
|
|
9
|
+
/** A token for a segment + brackets */
|
|
10
|
+
type: "segment_and_bracket";
|
|
11
|
+
/** The segment + brackets */
|
|
12
|
+
children: [SegmentToken, ...Array<BracketToken>];
|
|
13
|
+
}
|
|
14
|
+
export interface SegmentToken extends IToken {
|
|
15
|
+
/** A segment token */
|
|
16
|
+
type: "segment";
|
|
17
|
+
/** Any children of the token */
|
|
18
|
+
children: [ConcatenatedToken | IdentifierToken];
|
|
19
|
+
}
|
|
20
|
+
export interface BracketToken extends IToken {
|
|
21
|
+
/** A bracket token */
|
|
22
|
+
type: "bracket";
|
|
23
|
+
/** Any children of the token */
|
|
24
|
+
children: [OptionallyQuotedSegment | QueryToken];
|
|
25
|
+
}
|
|
26
|
+
export interface ExpressionValueToken extends IToken {
|
|
27
|
+
/** Expression value token */
|
|
28
|
+
type: "expression_value";
|
|
29
|
+
/** No children here */
|
|
30
|
+
children: [];
|
|
31
|
+
}
|
|
32
|
+
export interface ExpressionToken extends IToken {
|
|
33
|
+
/** Expression token */
|
|
34
|
+
type: "expression";
|
|
35
|
+
/** Children is the expression value */
|
|
36
|
+
children: [ExpressionValueToken];
|
|
37
|
+
}
|
|
38
|
+
export interface QuotedValueToken extends IToken {
|
|
39
|
+
/** A quoted value */
|
|
40
|
+
type: "quoted_value";
|
|
41
|
+
/** Any children of the token */
|
|
42
|
+
children: [];
|
|
43
|
+
}
|
|
44
|
+
export interface IdentifierToken extends IToken {
|
|
45
|
+
/** Any identifier */
|
|
46
|
+
type: "identifier";
|
|
47
|
+
/** Any children of the token */
|
|
48
|
+
children: [];
|
|
49
|
+
}
|
|
50
|
+
export interface ConcatenatedToken extends IToken {
|
|
51
|
+
/** A node of more than 1 identifier */
|
|
52
|
+
type: "concatenated";
|
|
53
|
+
/** Any children of the token */
|
|
54
|
+
children: Array<IdentifierToken | ModelRefToken | ExpressionToken>;
|
|
55
|
+
}
|
|
56
|
+
export interface ModelRefToken extends IToken {
|
|
57
|
+
/** A nested model reference */
|
|
58
|
+
type: "modelRef";
|
|
59
|
+
/** Any children of the token */
|
|
60
|
+
children: [ValueToken];
|
|
61
|
+
}
|
|
62
|
+
export interface OptionallyQuotedSegment extends IToken {
|
|
63
|
+
/** Any optionally quoted segment */
|
|
64
|
+
type: "optionally_quoted_segment";
|
|
65
|
+
/** Any children of the token */
|
|
66
|
+
children: [QuotedValueToken | SegmentToken];
|
|
67
|
+
}
|
|
68
|
+
export interface QueryToken extends IToken {
|
|
69
|
+
/** A query */
|
|
70
|
+
type: "query";
|
|
71
|
+
/** Any children of the token */
|
|
72
|
+
children: [OptionallyQuotedSegment, OptionallyQuotedSegment];
|
|
73
|
+
}
|
|
74
|
+
export type Token = ValueToken | QueryToken | QuotedValueToken | OptionallyQuotedSegment | SegmentAndBracketToken | SegmentToken | BracketToken | IdentifierToken | ConcatenatedToken | ModelRefToken | ExpressionValueToken | ExpressionToken;
|
|
75
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface ConstantsProvider {
|
|
2
|
+
/**
|
|
3
|
+
* Function to add constants to the providers store
|
|
4
|
+
* - @param data values to add to the constants store
|
|
5
|
+
*/
|
|
6
|
+
addConstants(data: Record<string, any>, namespace: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Function to retrieve constants from the providers store
|
|
9
|
+
* - @param key Key used for the store access
|
|
10
|
+
* - @param namespace namespace values were loaded under (defined in the plugin)
|
|
11
|
+
* - @param fallback Optional - if key doesn't exist in namespace what to return (will return unknown if not provided)
|
|
12
|
+
*/
|
|
13
|
+
getConstants(key: any, namespace: string, fallback?: any): any;
|
|
14
|
+
/**
|
|
15
|
+
* Function to set values to temporarily override certain keys in the perminant store
|
|
16
|
+
* - @param data values to override store with
|
|
17
|
+
* - @param namespace namespace to override
|
|
18
|
+
*/
|
|
19
|
+
setTemporaryValues(data: any, namespace: string): void;
|
|
20
|
+
/**
|
|
21
|
+
* Clears any temporary values that were previously set
|
|
22
|
+
*/
|
|
23
|
+
clearTemporaryValues(): void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Key/Value store for constants and context for Player
|
|
27
|
+
*/
|
|
28
|
+
export declare class ConstantsController implements ConstantsProvider {
|
|
29
|
+
/**
|
|
30
|
+
* Data store is basically a map of namespaces to DataModels to provide some data isolation
|
|
31
|
+
*/
|
|
32
|
+
private store;
|
|
33
|
+
/**
|
|
34
|
+
* Separate store for temporary flow specific overrides.
|
|
35
|
+
* They are kept in a separate data model to make clearing it easier between flows
|
|
36
|
+
* and so there is no confusion on what is static and what is temporary
|
|
37
|
+
*/
|
|
38
|
+
private tempStore;
|
|
39
|
+
constructor();
|
|
40
|
+
addConstants(data: any, namespace: string): void;
|
|
41
|
+
getConstants(key: string, namespace: string, fallback?: any): any;
|
|
42
|
+
setTemporaryValues(data: any, namespace: string): void;
|
|
43
|
+
clearTemporaryValues(namespace?: string): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BindingInstance } from "../../binding";
|
|
2
|
+
/** Recursively flattens a nested object to be an object of depth 1 with keys being the full path in the orginal object */
|
|
3
|
+
export declare function flatten(obj: any, roots?: [string][], sep?: string): any;
|
|
4
|
+
/** Converts an object into a list of binding/value tuples to use with a LocalModel object */
|
|
5
|
+
export declare function objectToBatchSet(obj: any): [BindingInstance, any][];
|
|
6
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SyncHook, SyncWaterfallHook, SyncBailHook } from "tapable-ts";
|
|
2
|
+
import type { Logger } from "../../logger";
|
|
3
|
+
import type { BindingParser, BindingLike } from "../../binding";
|
|
4
|
+
import { BindingInstance } from "../../binding";
|
|
5
|
+
import type { BatchSetTransaction, Updates, DataModelOptions, DataModelWithParser, DataPipeline, DataModelMiddleware } from "../../data";
|
|
6
|
+
import { PipelinedDataModel } from "../../data";
|
|
7
|
+
import type { RawSetTransaction } from "../../types";
|
|
8
|
+
import { ReadOnlyDataController } from "./utils";
|
|
9
|
+
/** The orchestrator for player data */
|
|
10
|
+
export declare class DataController implements DataModelWithParser<DataModelOptions> {
|
|
11
|
+
hooks: {
|
|
12
|
+
resolve: SyncWaterfallHook<any[], Record<string, any>>;
|
|
13
|
+
resolveDataStages: SyncWaterfallHook<[DataPipeline], Record<string, any>>;
|
|
14
|
+
resolveDefaultValue: SyncBailHook<[BindingInstance], any, Record<string, any>>;
|
|
15
|
+
onDelete: SyncHook<[any], Record<string, any>>;
|
|
16
|
+
onSet: SyncHook<[BatchSetTransaction], Record<string, any>>;
|
|
17
|
+
onGet: SyncHook<[any, any], Record<string, any>>;
|
|
18
|
+
onUpdate: SyncHook<[Updates, DataModelOptions | undefined], Record<string, any>>;
|
|
19
|
+
format: SyncWaterfallHook<[any, BindingInstance], Record<string, any>>;
|
|
20
|
+
deformat: SyncWaterfallHook<[any, BindingInstance], Record<string, any>>;
|
|
21
|
+
serialize: SyncWaterfallHook<[any], Record<string, any>>;
|
|
22
|
+
};
|
|
23
|
+
private model?;
|
|
24
|
+
private trash;
|
|
25
|
+
private pathResolver;
|
|
26
|
+
private baseMiddleware;
|
|
27
|
+
private logger?;
|
|
28
|
+
constructor(model: Record<any, unknown> | undefined, options: {
|
|
29
|
+
/** A means of parsing a raw binding to a Binding object */
|
|
30
|
+
pathResolver: BindingParser;
|
|
31
|
+
/** middleware to use. typically for validation */
|
|
32
|
+
middleware?: Array<DataModelMiddleware>;
|
|
33
|
+
/** A logger to use */
|
|
34
|
+
logger?: Logger;
|
|
35
|
+
});
|
|
36
|
+
getModel(): PipelinedDataModel;
|
|
37
|
+
private resolveDataValue;
|
|
38
|
+
set(transaction: RawSetTransaction, options?: DataModelOptions): Updates;
|
|
39
|
+
private resolve;
|
|
40
|
+
get(binding: BindingLike, options?: DataModelOptions): any;
|
|
41
|
+
delete(binding: BindingLike, options?: DataModelOptions): void;
|
|
42
|
+
serialize(): object;
|
|
43
|
+
makeReadOnly(): ReadOnlyDataController;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DataController } from ".";
|
|
2
|
+
import type { Logger } from "../../logger";
|
|
3
|
+
import type { BindingLike } from "../../binding";
|
|
4
|
+
import type { DataModelWithParser, DataModelOptions, Updates } from "../../data";
|
|
5
|
+
/** Wrapper for the Data Controller Class that prevents writes */
|
|
6
|
+
export declare class ReadOnlyDataController implements DataModelWithParser<DataModelOptions> {
|
|
7
|
+
private controller;
|
|
8
|
+
private logger?;
|
|
9
|
+
constructor(controller: DataController, logger?: Logger);
|
|
10
|
+
get(binding: BindingLike, options?: DataModelOptions | undefined): any;
|
|
11
|
+
set(transaction: [BindingLike, any][], options?: DataModelOptions | undefined): Updates;
|
|
12
|
+
delete(binding: BindingLike, options?: DataModelOptions | undefined): void;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SyncHook } from "tapable-ts";
|
|
2
|
+
import type { Navigation, NavigationFlowEndState } from "@player-ui/types";
|
|
3
|
+
import type { Logger } from "../../logger";
|
|
4
|
+
import type { TransitionOptions } from "./flow";
|
|
5
|
+
import { FlowInstance } from "./flow";
|
|
6
|
+
/** A manager for the navigation section of a Content blob */
|
|
7
|
+
export declare class FlowController {
|
|
8
|
+
readonly hooks: {
|
|
9
|
+
flow: SyncHook<[FlowInstance], Record<string, any>>;
|
|
10
|
+
};
|
|
11
|
+
private readonly log?;
|
|
12
|
+
private navigation;
|
|
13
|
+
private navStack;
|
|
14
|
+
current?: FlowInstance;
|
|
15
|
+
constructor(navigation: Navigation, options?: {
|
|
16
|
+
/** A logger instance to use */
|
|
17
|
+
logger?: Logger;
|
|
18
|
+
});
|
|
19
|
+
/** Navigate to another state in the state-machine */
|
|
20
|
+
transition(stateTransition: string, options?: TransitionOptions): void;
|
|
21
|
+
private addNewFlow;
|
|
22
|
+
private run;
|
|
23
|
+
start(): Promise<NavigationFlowEndState>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SyncBailHook, SyncHook, SyncWaterfallHook } from "tapable-ts";
|
|
2
|
+
import type { NavigationFlow, NavigationFlowState, NavigationFlowEndState } from "@player-ui/types";
|
|
3
|
+
import type { Logger } from "../../logger";
|
|
4
|
+
export interface NamedState {
|
|
5
|
+
/** The name of the navigation node */
|
|
6
|
+
name: string;
|
|
7
|
+
/** The nav node */
|
|
8
|
+
value: NavigationFlowState;
|
|
9
|
+
}
|
|
10
|
+
export interface TransitionOptions {
|
|
11
|
+
/** Ignore any validations or other signals preventing the transition from taking place */
|
|
12
|
+
force?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type TransitionFunction = (name: string, options?: TransitionOptions) => void;
|
|
15
|
+
/** The Content navigation state machine */
|
|
16
|
+
export declare class FlowInstance {
|
|
17
|
+
private flow;
|
|
18
|
+
private log?;
|
|
19
|
+
private history;
|
|
20
|
+
private isTransitioning;
|
|
21
|
+
private flowPromise?;
|
|
22
|
+
readonly id: string;
|
|
23
|
+
currentState?: NamedState;
|
|
24
|
+
readonly hooks: {
|
|
25
|
+
beforeStart: SyncBailHook<[NavigationFlow], NavigationFlow, Record<string, any>>;
|
|
26
|
+
/** A callback when the onStart node was present */
|
|
27
|
+
onStart: SyncHook<[any], Record<string, any>>;
|
|
28
|
+
/** A callback when the onEnd node was present */
|
|
29
|
+
onEnd: SyncHook<[any], Record<string, any>>;
|
|
30
|
+
/** A hook to intercept and block a transition */
|
|
31
|
+
skipTransition: SyncBailHook<[NamedState | undefined], boolean | undefined, Record<string, any>>;
|
|
32
|
+
/** A chance to manipulate the flow-node used to calculate the given transition used */
|
|
33
|
+
beforeTransition: SyncWaterfallHook<[import("@player-ui/types").NavigationFlowViewState | import("@player-ui/types").NavigationFlowFlowState | import("@player-ui/types").NavigationFlowActionState | import("@player-ui/types").NavigationFlowExternalState, string], Record<string, any>>;
|
|
34
|
+
/** A chance to manipulate the flow-node calculated after a transition */
|
|
35
|
+
resolveTransitionNode: SyncWaterfallHook<[NavigationFlowState], Record<string, any>>;
|
|
36
|
+
/** A callback when a transition from 1 state to another was made */
|
|
37
|
+
transition: SyncHook<[NamedState | undefined, NamedState], Record<string, any>>;
|
|
38
|
+
/** A callback to run actions after a transition occurs */
|
|
39
|
+
afterTransition: SyncHook<[FlowInstance], Record<string, any>>;
|
|
40
|
+
};
|
|
41
|
+
constructor(id: string, flow: NavigationFlow, options?: {
|
|
42
|
+
/** Logger instance to use */
|
|
43
|
+
logger?: Logger;
|
|
44
|
+
});
|
|
45
|
+
/** Start the state machine */
|
|
46
|
+
start(): Promise<NavigationFlowEndState>;
|
|
47
|
+
transition(transitionValue: string, options?: TransitionOptions): void;
|
|
48
|
+
private pushHistory;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=flow.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ViewPlugin, Resolver, ViewInstance } from "../../view";
|
|
2
|
+
import type { BindingInstance, BindingFactory } from "../../binding";
|
|
3
|
+
export interface BindingTracker {
|
|
4
|
+
/** Get the bindings currently being tracked for validation */
|
|
5
|
+
getBindings(): Set<BindingInstance>;
|
|
6
|
+
/** Add a binding to the tracked set */
|
|
7
|
+
trackBinding(binding: BindingInstance): void;
|
|
8
|
+
}
|
|
9
|
+
interface Options {
|
|
10
|
+
/** Parse a binding from a view */
|
|
11
|
+
parseBinding: BindingFactory;
|
|
12
|
+
/** Callbacks when events happen */
|
|
13
|
+
callbacks?: {
|
|
14
|
+
/** Called when a binding is encountered for the first time in a view */
|
|
15
|
+
onAdd?: (binding: BindingInstance) => void;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** A view plugin that manages bindings tracked across updates */
|
|
19
|
+
export declare class ValidationBindingTrackerViewPlugin implements ViewPlugin, BindingTracker {
|
|
20
|
+
private options;
|
|
21
|
+
private trackedBindings;
|
|
22
|
+
constructor(options: Options);
|
|
23
|
+
/** Fetch the tracked bindings in the current view */
|
|
24
|
+
getBindings(): Set<BindingInstance>;
|
|
25
|
+
/** Add a binding to the tracked set */
|
|
26
|
+
trackBinding(binding: BindingInstance): void;
|
|
27
|
+
/** Attach hooks to the given resolver */
|
|
28
|
+
applyResolver(resolver: Resolver): void;
|
|
29
|
+
apply(view: ViewInstance): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=binding-tracker.d.ts.map
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { Validation } from "@player-ui/types";
|
|
2
|
+
import { SyncHook, SyncWaterfallHook } from "tapable-ts";
|
|
3
|
+
import type { BindingInstance, BindingFactory } from "../../binding";
|
|
4
|
+
import type { DataModelMiddleware } from "../../data";
|
|
5
|
+
import type { SchemaController } from "../../schema";
|
|
6
|
+
import type { ErrorValidationResponse, ValidationObjectWithHandler, ValidatorContext, ValidationProvider, ValidationResponse, WarningValidationResponse } from "../../validator";
|
|
7
|
+
import { ValidatorRegistry } from "../../validator";
|
|
8
|
+
import type { Logger } from "../../logger";
|
|
9
|
+
import type { Resolve, ViewInstance } from "../../view";
|
|
10
|
+
import type { BindingTracker } from "./binding-tracker";
|
|
11
|
+
export declare const SCHEMA_VALIDATION_PROVIDER_NAME = "schema";
|
|
12
|
+
export declare const VIEW_VALIDATION_PROVIDER_NAME = "view";
|
|
13
|
+
export declare const VALIDATION_PROVIDER_NAME_SYMBOL: unique symbol;
|
|
14
|
+
export type ValidationObjectWithSource = ValidationObjectWithHandler & {
|
|
15
|
+
/** The name of the validation */
|
|
16
|
+
[VALIDATION_PROVIDER_NAME_SYMBOL]: string;
|
|
17
|
+
};
|
|
18
|
+
type SimpleValidatorContext = Omit<ValidatorContext, "validation" | "schemaType">;
|
|
19
|
+
interface BaseActiveValidation<T> {
|
|
20
|
+
/** The validation is being actively shown */
|
|
21
|
+
state: "active";
|
|
22
|
+
/** The validation response */
|
|
23
|
+
response: T;
|
|
24
|
+
}
|
|
25
|
+
type ActiveWarning = BaseActiveValidation<WarningValidationResponse> & {
|
|
26
|
+
/** Warnings track if they can be dismissed automatically (by navigating) */
|
|
27
|
+
dismissable: boolean;
|
|
28
|
+
};
|
|
29
|
+
type ActiveError = BaseActiveValidation<ErrorValidationResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* warnings that keep track of their active state
|
|
32
|
+
*/
|
|
33
|
+
type StatefulWarning = {
|
|
34
|
+
/** A common key to differentiate between errors and warnings */
|
|
35
|
+
type: "warning";
|
|
36
|
+
/** The underlying validation this tracks */
|
|
37
|
+
value: ValidationObjectWithSource;
|
|
38
|
+
/** If this is currently preventing navigation from continuing */
|
|
39
|
+
isBlockingNavigation: boolean;
|
|
40
|
+
} & ({
|
|
41
|
+
/** warnings start with no state, but can active or dismissed */
|
|
42
|
+
state: "none" | "dismissed";
|
|
43
|
+
} | ActiveWarning);
|
|
44
|
+
/** Errors that keep track of their state */
|
|
45
|
+
type StatefulError = {
|
|
46
|
+
/** A common key to differentiate between errors and warnings */
|
|
47
|
+
type: "error";
|
|
48
|
+
/** The underlying validation this tracks */
|
|
49
|
+
value: ValidationObjectWithSource;
|
|
50
|
+
/** If this is currently preventing navigation from continuing */
|
|
51
|
+
isBlockingNavigation: boolean;
|
|
52
|
+
} & ({
|
|
53
|
+
/** Errors start with no state an can be activated */
|
|
54
|
+
state: "none";
|
|
55
|
+
} | ActiveError);
|
|
56
|
+
export type StatefulValidationObject = StatefulWarning | StatefulError;
|
|
57
|
+
type ValidationRunner = (obj: ValidationObjectWithHandler) => {
|
|
58
|
+
/** A validation message */
|
|
59
|
+
message: string;
|
|
60
|
+
} | undefined;
|
|
61
|
+
/** A class that manages validating bindings across phases */
|
|
62
|
+
declare class ValidatedBinding {
|
|
63
|
+
currentPhase?: Validation.Trigger;
|
|
64
|
+
private applicableValidations;
|
|
65
|
+
private validationsByState;
|
|
66
|
+
get allValidations(): Array<StatefulValidationObject>;
|
|
67
|
+
weakBindings: Set<BindingInstance>;
|
|
68
|
+
private onDismiss?;
|
|
69
|
+
constructor(possibleValidations: Array<ValidationObjectWithSource>, onDismiss?: () => void, log?: Logger, weakBindings?: Set<BindingInstance>);
|
|
70
|
+
private checkIfBlocking;
|
|
71
|
+
getAll(): Array<ValidationResponse>;
|
|
72
|
+
get(): ValidationResponse | undefined;
|
|
73
|
+
private runApplicableValidations;
|
|
74
|
+
update(phase: Validation.Trigger, canDismiss: boolean, runner: ValidationRunner): void;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A controller for orchestrating validation within a running player
|
|
78
|
+
*
|
|
79
|
+
* The current validation flow is as follows:
|
|
80
|
+
*
|
|
81
|
+
* - When a binding is first seen, gather all of the possible validations for it from the providers
|
|
82
|
+
* - Schema and Crossfield (view) are both providers of possible validations
|
|
83
|
+
* - Run all of the applicable validations for that binding for the `load` trigger
|
|
84
|
+
*
|
|
85
|
+
* - When a change occurs, set the phase of the binding to `change`.
|
|
86
|
+
* - Run all of the `change` triggered validations for that binding.
|
|
87
|
+
*
|
|
88
|
+
* - When a navigation event occurs, set the phase of the binding to `navigate`.
|
|
89
|
+
* - Run all `change` and `navigate` validations for each tracked binding.
|
|
90
|
+
* - For any warnings, also keep a state of `shown` or `dismissed`.
|
|
91
|
+
* - Set all non-dismissed warnings to `shown`.
|
|
92
|
+
* - Set all `shown` warnings to `dismissed`.
|
|
93
|
+
* - Allow navigation forward if there are no non-dismissed warnings and no valid errors.
|
|
94
|
+
*/
|
|
95
|
+
export declare class ValidationController implements BindingTracker {
|
|
96
|
+
readonly hooks: {
|
|
97
|
+
/** A hook called to tap into the validator registry for adding more validators */
|
|
98
|
+
createValidatorRegistry: SyncHook<[ValidatorRegistry], Record<string, any>>;
|
|
99
|
+
/** A callback/event when a new validation is added to the view */
|
|
100
|
+
onAddValidation: SyncWaterfallHook<[ValidationResponse, BindingInstance], Record<string, any>>;
|
|
101
|
+
/** The inverse of onAddValidation, this is called when a validation is removed from the list */
|
|
102
|
+
onRemoveValidation: SyncWaterfallHook<[ValidationResponse, BindingInstance], Record<string, any>>;
|
|
103
|
+
resolveValidationProviders: SyncWaterfallHook<[{
|
|
104
|
+
/** The name of the provider */
|
|
105
|
+
source: string;
|
|
106
|
+
/** The provider itself */
|
|
107
|
+
provider: ValidationProvider;
|
|
108
|
+
}[]], {
|
|
109
|
+
/** The view this is triggered for */
|
|
110
|
+
view?: ViewInstance | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
/** A hook called when a binding is added to the tracker */
|
|
113
|
+
onTrackBinding: SyncHook<[BindingInstance], Record<string, any>>;
|
|
114
|
+
};
|
|
115
|
+
private tracker;
|
|
116
|
+
private validations;
|
|
117
|
+
private validatorRegistry?;
|
|
118
|
+
private schema;
|
|
119
|
+
private providers;
|
|
120
|
+
private viewValidationProvider?;
|
|
121
|
+
private options?;
|
|
122
|
+
private weakBindingTracker;
|
|
123
|
+
constructor(schema: SchemaController, options?: SimpleValidatorContext);
|
|
124
|
+
setOptions(options: SimpleValidatorContext): void;
|
|
125
|
+
/** Return the middleware for the data-model to stop propagation of invalid data */
|
|
126
|
+
getDataMiddleware(): Array<DataModelMiddleware>;
|
|
127
|
+
private getValidationProviders;
|
|
128
|
+
reset(): void;
|
|
129
|
+
onView(view: ViewInstance): void;
|
|
130
|
+
updateValidationsForBinding(binding: BindingInstance, trigger: Validation.Trigger, validationContext?: SimpleValidatorContext, onDismiss?: () => void): void;
|
|
131
|
+
validationRunner(validationObj: ValidationObjectWithHandler, binding: BindingInstance, context?: SimpleValidatorContext | undefined): {
|
|
132
|
+
message: string;
|
|
133
|
+
} | undefined;
|
|
134
|
+
private updateValidationsForView;
|
|
135
|
+
private get activeBindings();
|
|
136
|
+
getValidator(type: string): import("../../validator").ValidatorFunction | undefined;
|
|
137
|
+
getBindings(): Set<BindingInstance>;
|
|
138
|
+
trackBinding(binding: BindingInstance): void;
|
|
139
|
+
/** Executes all known validations for the tracked bindings using the given model */
|
|
140
|
+
validateView(trigger?: Validation.Trigger): {
|
|
141
|
+
/** Indicating if the view can proceed without error */
|
|
142
|
+
canTransition: boolean;
|
|
143
|
+
/** the validations that are preventing the view from continuing */
|
|
144
|
+
validations?: Map<BindingInstance, ValidationResponse>;
|
|
145
|
+
};
|
|
146
|
+
/** Get the current tracked validation for the given binding */
|
|
147
|
+
getValidationForBinding(binding: BindingInstance): ValidatedBinding | undefined;
|
|
148
|
+
forView(parser: BindingFactory): Resolve.Validation;
|
|
149
|
+
}
|
|
150
|
+
export {};
|
|
151
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Node } from "../../view";
|
|
2
|
+
import { LocalStateStore } from "./store";
|
|
3
|
+
import type { TransformRegistry } from "./types";
|
|
4
|
+
import type { ViewController } from "./controller";
|
|
5
|
+
/**
|
|
6
|
+
* A plugin to register custom transforms on certain asset types
|
|
7
|
+
* This allows users to embed stateful data into transforms.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AssetTransformCorePlugin {
|
|
10
|
+
readonly stateStore: Map<Node.Node, LocalStateStore>;
|
|
11
|
+
private readonly registry;
|
|
12
|
+
private beforeResolveSymbol;
|
|
13
|
+
private resolveSymbol;
|
|
14
|
+
private beforeResolveCountSymbol;
|
|
15
|
+
private resolveCountSymbol;
|
|
16
|
+
constructor(registry: TransformRegistry);
|
|
17
|
+
apply(viewController: ViewController): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=asset-transform.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SyncHook, SyncWaterfallHook } from "tapable-ts";
|
|
2
|
+
import type { View, NavigationFlowViewState } from "@player-ui/types";
|
|
3
|
+
import type { Resolve } from "../../view";
|
|
4
|
+
import { ViewInstance } from "../../view";
|
|
5
|
+
import type { Logger } from "../../logger";
|
|
6
|
+
import type { FlowController } from "../flow";
|
|
7
|
+
import type { DataController } from "../data/controller";
|
|
8
|
+
import type { TransformRegistry } from "./types";
|
|
9
|
+
export interface ViewControllerOptions {
|
|
10
|
+
/** Where to get data from */
|
|
11
|
+
model: DataController;
|
|
12
|
+
/** Where to log data */
|
|
13
|
+
logger?: Logger;
|
|
14
|
+
/** A flow-controller instance to listen for view changes */
|
|
15
|
+
flowController: FlowController;
|
|
16
|
+
}
|
|
17
|
+
/** A controller to manage updating/switching views */
|
|
18
|
+
export declare class ViewController {
|
|
19
|
+
readonly hooks: {
|
|
20
|
+
/** Do any processing before the `View` instance is created */
|
|
21
|
+
resolveView: SyncWaterfallHook<[(import("@player-ui/types").Asset<string> & {
|
|
22
|
+
validation?: import("@player-ui/types").Validation.CrossfieldReference[] | undefined;
|
|
23
|
+
}) | undefined, string, NavigationFlowViewState], Record<string, any>>;
|
|
24
|
+
view: SyncHook<[ViewInstance], Record<string, any>>;
|
|
25
|
+
};
|
|
26
|
+
private readonly viewMap;
|
|
27
|
+
private readonly viewOptions;
|
|
28
|
+
private pendingUpdate?;
|
|
29
|
+
currentView?: ViewInstance;
|
|
30
|
+
transformRegistry: TransformRegistry;
|
|
31
|
+
optimizeUpdates: boolean;
|
|
32
|
+
constructor(initialViews: View[], options: Resolve.ResolverOptions & ViewControllerOptions);
|
|
33
|
+
private queueUpdate;
|
|
34
|
+
private getViewForRef;
|
|
35
|
+
onView(state: NavigationFlowViewState): void;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Store {
|
|
2
|
+
useLocalState<T>(initialState: T): readonly [T, (value: T) => void];
|
|
3
|
+
useSharedState<T>(key: string | symbol): (initialState: T) => readonly [T, (value: T) => void];
|
|
4
|
+
}
|
|
5
|
+
interface SharedStore {
|
|
6
|
+
getLocalStateFunction<T>(key: string | symbol, countKey: symbol): (initialState: T) => readonly [T, (value: T) => void];
|
|
7
|
+
useSharedState<T>(key: string | symbol): (initialState: T) => readonly [T, (value: T) => void];
|
|
8
|
+
}
|
|
9
|
+
/** A store that holds on to state for a transform */
|
|
10
|
+
export declare class LocalStateStore implements SharedStore {
|
|
11
|
+
private state;
|
|
12
|
+
private updateCallback?;
|
|
13
|
+
constructor(onUpdate?: () => void);
|
|
14
|
+
removeKey(key: symbol | string): void;
|
|
15
|
+
reset(): void;
|
|
16
|
+
useSharedState<T>(key: string | symbol): (initialState: T) => readonly [T, (newState: T) => void];
|
|
17
|
+
getLocalStateFunction<T>(key: symbol, countKey: symbol): (initialState: T) => readonly [T, (newState: T) => void];
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=store.d.ts.map
|