cross-state 0.53.3 → 0.54.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/chunk-CUT6urMc.cjs +30 -0
- package/dist/diff-BQ8bB3Wk.d.cts +22 -0
- package/dist/diff-gZezL04N.d.ts +22 -0
- package/dist/extendedJson-BZkQBXEv.js +29 -0
- package/dist/extendedJson-BZkQBXEv.js.map +1 -0
- package/dist/extendedJson-Dn2F7Edo.cjs +53 -0
- package/dist/extendedJson-Dn2F7Edo.cjs.map +1 -0
- package/dist/hash-BV06P7va.js +19 -0
- package/dist/hash-BV06P7va.js.map +1 -0
- package/dist/hash-CJPl7SRj.cjs +30 -0
- package/dist/hash-CJPl7SRj.cjs.map +1 -0
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/mutative/index.cjs +3 -0
- package/dist/mutative/index.d.cts +3 -0
- package/dist/mutative/index.d.ts +3 -0
- package/dist/mutative/index.js +3 -0
- package/dist/mutative/register.cjs +10 -0
- package/dist/mutative/register.cjs.map +1 -0
- package/dist/mutative/register.d.cts +11 -0
- package/dist/mutative/register.d.ts +9 -0
- package/dist/mutative/register.js +10 -0
- package/dist/mutative/register.js.map +1 -0
- package/dist/mutativeMethods-6QzygG3W.d.cts +13 -0
- package/dist/mutativeMethods-Br3xN2Iq.d.ts +13 -0
- package/dist/mutativeMethods-CZKeRIDL.js +27 -0
- package/dist/mutativeMethods-CZKeRIDL.js.map +1 -0
- package/dist/mutativeMethods-CgXk_bMt.cjs +33 -0
- package/dist/mutativeMethods-CgXk_bMt.cjs.map +1 -0
- package/dist/patchMethods-C3L7Kh8T.d.cts +48 -0
- package/dist/patchMethods-D5YJwcpn.cjs +264 -0
- package/dist/patchMethods-D5YJwcpn.cjs.map +1 -0
- package/dist/patchMethods-DRPfkhAe.js +241 -0
- package/dist/patchMethods-DRPfkhAe.js.map +1 -0
- package/dist/patchMethods-Dxad6HF6.d.ts +48 -0
- package/dist/patches/index.cjs +5 -0
- package/dist/patches/index.d.cts +4 -0
- package/dist/patches/index.d.ts +4 -0
- package/dist/patches/index.js +5 -0
- package/dist/patches/register.cjs +11 -0
- package/dist/patches/register.cjs.map +1 -0
- package/dist/patches/register.d.cts +12 -0
- package/dist/patches/register.d.ts +10 -0
- package/dist/patches/register.js +11 -0
- package/dist/patches/register.js.map +1 -0
- package/dist/persist/register.cjs +13 -0
- package/dist/persist/register.cjs.map +1 -0
- package/dist/persist/register.d.cts +15 -0
- package/dist/persist/register.d.ts +13 -0
- package/dist/persist/register.js +13 -0
- package/dist/persist/register.js.map +1 -0
- package/dist/persist-BluRVcW6.js +258 -0
- package/dist/persist-BluRVcW6.js.map +1 -0
- package/dist/persist-CPjpg6D0.d.ts +61 -0
- package/dist/persist-CztClydq.cjs +263 -0
- package/dist/persist-CztClydq.cjs.map +1 -0
- package/dist/persist-D7MAsyyW.d.cts +61 -0
- package/dist/propAccess-ByqBjC19.cjs +173 -0
- package/dist/propAccess-ByqBjC19.cjs.map +1 -0
- package/dist/propAccess-DGchzVfy.js +113 -0
- package/dist/propAccess-DGchzVfy.js.map +1 -0
- package/dist/react/index.cjs +610 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +305 -0
- package/dist/react/index.d.ts +305 -0
- package/dist/react/index.js +590 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/register.cjs +16 -0
- package/dist/react/register.cjs.map +1 -0
- package/dist/react/register.d.cts +16 -0
- package/dist/react/register.d.ts +14 -0
- package/dist/react/register.js +16 -0
- package/dist/react/register.js.map +1 -0
- package/dist/scope-DI1OFHcr.d.ts +167 -0
- package/dist/scope-DO5vpLPV.d.cts +167 -0
- package/dist/scope-DU5dFP1T.js +322 -0
- package/dist/scope-DU5dFP1T.js.map +1 -0
- package/dist/scope-DvqvkIHB.cjs +369 -0
- package/dist/scope-DvqvkIHB.cjs.map +1 -0
- package/dist/store-BEsiS8y7.d.cts +242 -0
- package/dist/store-BWMWEUpu.cjs +819 -0
- package/dist/store-BWMWEUpu.cjs.map +1 -0
- package/dist/store-DKaeE840.d.ts +242 -0
- package/dist/store-Dr8gM3lq.js +730 -0
- package/dist/store-Dr8gM3lq.js.map +1 -0
- package/dist/storeMethods-AIJSwxHz.js +315 -0
- package/dist/storeMethods-AIJSwxHz.js.map +1 -0
- package/dist/storeMethods-BQwU2Uia.d.cts +107 -0
- package/dist/storeMethods-C4luym7C.d.ts +107 -0
- package/dist/storeMethods-DVVsmUg1.cjs +375 -0
- package/dist/storeMethods-DVVsmUg1.cjs.map +1 -0
- package/package.json +92 -135
- package/dist/cjs/hash.cjs +0 -30
- package/dist/cjs/hash.cjs.map +0 -1
- package/dist/cjs/index.cjs +0 -56
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/index2.cjs +0 -300
- package/dist/cjs/index2.cjs.map +0 -1
- package/dist/cjs/mutative/index.cjs +0 -10
- package/dist/cjs/mutative/index.cjs.map +0 -1
- package/dist/cjs/mutative/register.cjs +0 -8
- package/dist/cjs/mutative/register.cjs.map +0 -1
- package/dist/cjs/mutativeMethods.cjs +0 -29
- package/dist/cjs/mutativeMethods.cjs.map +0 -1
- package/dist/cjs/patches/index.cjs +0 -10
- package/dist/cjs/patches/index.cjs.map +0 -1
- package/dist/cjs/patches/register.cjs +0 -8
- package/dist/cjs/patches/register.cjs.map +0 -1
- package/dist/cjs/persist/register.cjs +0 -11
- package/dist/cjs/persist/register.cjs.map +0 -1
- package/dist/cjs/persist.cjs +0 -302
- package/dist/cjs/persist.cjs.map +0 -1
- package/dist/cjs/propAccess.cjs +0 -162
- package/dist/cjs/propAccess.cjs.map +0 -1
- package/dist/cjs/react/index.cjs +0 -628
- package/dist/cjs/react/index.cjs.map +0 -1
- package/dist/cjs/react/register.cjs +0 -13
- package/dist/cjs/react/register.cjs.map +0 -1
- package/dist/cjs/scope.cjs +0 -400
- package/dist/cjs/scope.cjs.map +0 -1
- package/dist/cjs/store.cjs +0 -829
- package/dist/cjs/store.cjs.map +0 -1
- package/dist/cjs/storeMethods.cjs +0 -856
- package/dist/cjs/storeMethods.cjs.map +0 -1
- package/dist/cjs/urlStore.cjs +0 -120
- package/dist/cjs/urlStore.cjs.map +0 -1
- package/dist/es/hash.mjs +0 -27
- package/dist/es/hash.mjs.map +0 -1
- package/dist/es/index.mjs +0 -20
- package/dist/es/index.mjs.map +0 -1
- package/dist/es/index2.mjs +0 -291
- package/dist/es/index2.mjs.map +0 -1
- package/dist/es/mutative/index.mjs +0 -2
- package/dist/es/mutative/index.mjs.map +0 -1
- package/dist/es/mutative/register.mjs +0 -6
- package/dist/es/mutative/register.mjs.map +0 -1
- package/dist/es/mutativeMethods.mjs +0 -27
- package/dist/es/mutativeMethods.mjs.map +0 -1
- package/dist/es/patches/index.mjs +0 -2
- package/dist/es/patches/index.mjs.map +0 -1
- package/dist/es/patches/register.mjs +0 -6
- package/dist/es/patches/register.mjs.map +0 -1
- package/dist/es/persist/register.mjs +0 -9
- package/dist/es/persist/register.mjs.map +0 -1
- package/dist/es/persist.mjs +0 -300
- package/dist/es/persist.mjs.map +0 -1
- package/dist/es/propAccess.mjs +0 -151
- package/dist/es/propAccess.mjs.map +0 -1
- package/dist/es/react/index.mjs +0 -611
- package/dist/es/react/index.mjs.map +0 -1
- package/dist/es/react/register.mjs +0 -11
- package/dist/es/react/register.mjs.map +0 -1
- package/dist/es/scope.mjs +0 -391
- package/dist/es/scope.mjs.map +0 -1
- package/dist/es/store.mjs +0 -812
- package/dist/es/store.mjs.map +0 -1
- package/dist/es/storeMethods.mjs +0 -845
- package/dist/es/storeMethods.mjs.map +0 -1
- package/dist/es/urlStore.mjs +0 -116
- package/dist/es/urlStore.mjs.map +0 -1
- package/dist/types/core/cache.d.ts +0 -119
- package/dist/types/core/commonTypes.d.ts +0 -76
- package/dist/types/core/index.d.ts +0 -6
- package/dist/types/core/resourceGroup.d.ts +0 -16
- package/dist/types/core/scope.d.ts +0 -5
- package/dist/types/core/store.d.ts +0 -86
- package/dist/types/core/urlStore.d.ts +0 -21
- package/dist/types/index.d.ts +0 -14
- package/dist/types/lib/applyPatches.d.ts +0 -2
- package/dist/types/lib/autobind.d.ts +0 -1
- package/dist/types/lib/cacheState.d.ts +0 -20
- package/dist/types/lib/calcDuration.d.ts +0 -2
- package/dist/types/lib/calculatedValue.d.ts +0 -9
- package/dist/types/lib/castArray.d.ts +0 -1
- package/dist/types/lib/clone.d.ts +0 -1
- package/dist/types/lib/constrain.d.ts +0 -1
- package/dist/types/lib/debounce.d.ts +0 -12
- package/dist/types/lib/deferred.d.ts +0 -5
- package/dist/types/lib/diff.d.ts +0 -17
- package/dist/types/lib/disposable.d.ts +0 -3
- package/dist/types/lib/equals.d.ts +0 -3
- package/dist/types/lib/extendedJson.d.ts +0 -5
- package/dist/types/lib/forwardError.d.ts +0 -1
- package/dist/types/lib/hash.d.ts +0 -5
- package/dist/types/lib/helpers.d.ts +0 -2
- package/dist/types/lib/instanceCache.d.ts +0 -18
- package/dist/types/lib/isPromise.d.ts +0 -1
- package/dist/types/lib/makeSelector.d.ts +0 -2
- package/dist/types/lib/maybePromise.d.ts +0 -1
- package/dist/types/lib/path.d.ts +0 -41
- package/dist/types/lib/promiseChain.d.ts +0 -5
- package/dist/types/lib/promiseWithCancel.d.ts +0 -8
- package/dist/types/lib/promiseWithState.d.ts +0 -9
- package/dist/types/lib/propAccess.d.ts +0 -7
- package/dist/types/lib/queue.d.ts +0 -11
- package/dist/types/lib/standardMethods.d.ts +0 -20
- package/dist/types/lib/throttle.d.ts +0 -2
- package/dist/types/lib/trackingProxy.d.ts +0 -2
- package/dist/types/lib/trie.d.ts +0 -11
- package/dist/types/lib/typeHelpers.d.ts +0 -12
- package/dist/types/lib/unwrapPromise.d.ts +0 -1
- package/dist/types/lib/updateHelpers.d.ts +0 -1
- package/dist/types/lib/wildcardMatch.d.ts +0 -3
- package/dist/types/mutative/index.d.ts +0 -1
- package/dist/types/mutative/mutativeMethods.d.ts +0 -11
- package/dist/types/mutative/register.d.ts +0 -7
- package/dist/types/patches/index.d.ts +0 -1
- package/dist/types/patches/patchMethods.d.ts +0 -44
- package/dist/types/patches/register.d.ts +0 -7
- package/dist/types/persist/index.d.ts +0 -3
- package/dist/types/persist/persist.d.ts +0 -40
- package/dist/types/persist/persistPathHelpers.d.ts +0 -6
- package/dist/types/persist/persistStorage.d.ts +0 -17
- package/dist/types/persist/register.d.ts +0 -9
- package/dist/types/react/cacheMethods.d.ts +0 -5
- package/dist/types/react/form/customInput.d.ts +0 -6
- package/dist/types/react/form/form.d.ts +0 -98
- package/dist/types/react/form/formField.d.ts +0 -68
- package/dist/types/react/form/formForEach.d.ts +0 -19
- package/dist/types/react/form/index.d.ts +0 -3
- package/dist/types/react/form/useFormAutosave.d.ts +0 -9
- package/dist/types/react/index.d.ts +0 -11
- package/dist/types/react/loadingBoundary.d.ts +0 -21
- package/dist/types/react/register.d.ts +0 -15
- package/dist/types/react/scope.d.ts +0 -24
- package/dist/types/react/scopeMethods.d.ts +0 -20
- package/dist/types/react/storeMethods.d.ts +0 -15
- package/dist/types/react/useCache.d.ts +0 -34
- package/dist/types/react/useDecoupledState.d.ts +0 -7
- package/dist/types/react/useProp.d.ts +0 -8
- package/dist/types/react/useStore.d.ts +0 -16
- package/dist/types/react/useUrlParamScope.d.ts +0 -4
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const autobind: <TClass extends abstract new (...args: any) => any = abstract new (...args: any) => any>(_class: TClass) => TClass;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type ValueState<T> = {
|
|
2
|
-
status: 'value';
|
|
3
|
-
value: T;
|
|
4
|
-
error?: undefined;
|
|
5
|
-
};
|
|
6
|
-
export type ErrorState = {
|
|
7
|
-
status: 'error';
|
|
8
|
-
value?: undefined;
|
|
9
|
-
error: unknown;
|
|
10
|
-
};
|
|
11
|
-
export type PendingState = {
|
|
12
|
-
status: 'pending';
|
|
13
|
-
value?: undefined;
|
|
14
|
-
error?: undefined;
|
|
15
|
-
};
|
|
16
|
-
export type CacheState<T> = (ValueState<T> | ErrorState | PendingState) & {
|
|
17
|
-
isStale: boolean;
|
|
18
|
-
isUpdating: boolean;
|
|
19
|
-
isConnected: boolean;
|
|
20
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Store } from '../core/store';
|
|
2
|
-
export interface CalculatedValue<T> {
|
|
3
|
-
value: T;
|
|
4
|
-
check: () => void;
|
|
5
|
-
stop(): void;
|
|
6
|
-
invalidateDependencies(recursive?: boolean): void;
|
|
7
|
-
}
|
|
8
|
-
export declare function calculatedValue<T>(store: Store<T>, notify: () => void): CalculatedValue<T>;
|
|
9
|
-
export declare function staticValue<T>(value: T): CalculatedValue<T>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function castArray<T>(value: T | T[]): T[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function flatClone<T>(object: T): T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type Constrain<T, S> = T & S;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Duration } from '../core';
|
|
2
|
-
export type DebounceOptions = Duration | {
|
|
3
|
-
wait: Duration;
|
|
4
|
-
maxWait?: Duration;
|
|
5
|
-
waitOnRunNow?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function debounce<Args extends any[]>(action: (...args: Args) => void, options: Duration | DebounceOptions): {
|
|
8
|
-
(...args: Args): void;
|
|
9
|
-
flush(): void;
|
|
10
|
-
cancel(): void;
|
|
11
|
-
isScheduled(): boolean;
|
|
12
|
-
};
|
package/dist/types/lib/diff.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { KeyType } from './path';
|
|
2
|
-
export type Patch = {
|
|
3
|
-
op: 'add';
|
|
4
|
-
path: KeyType[];
|
|
5
|
-
value: any;
|
|
6
|
-
} | {
|
|
7
|
-
op: 'remove';
|
|
8
|
-
path: KeyType[];
|
|
9
|
-
} | {
|
|
10
|
-
op: 'replace';
|
|
11
|
-
path: KeyType[];
|
|
12
|
-
value: any;
|
|
13
|
-
};
|
|
14
|
-
export interface DiffOptions {
|
|
15
|
-
stopAt?: number | ((path: KeyType[]) => boolean);
|
|
16
|
-
}
|
|
17
|
-
export declare function diff(a: any, b: any, options?: DiffOptions): [patches: Patch[], reversePatches: Patch[]];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare function toExtendedJson(value: unknown): unknown;
|
|
2
|
-
export declare function toExtendedJsonString(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
3
|
-
export declare function toExtendedJsonString(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
4
|
-
export declare function fromExtendedJson(value: unknown): unknown;
|
|
5
|
-
export declare function fromExtendedJsonString(value: string, reviver?: (this: any, key: string, value: any) => any): unknown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function forwardError(error: unknown): void;
|
package/dist/types/lib/hash.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare class InstanceCache<Args extends any[], T extends object> {
|
|
2
|
-
readonly factory: (...args: Args) => T;
|
|
3
|
-
readonly cacheTime?: number | undefined;
|
|
4
|
-
private cache;
|
|
5
|
-
private interval;
|
|
6
|
-
constructor(factory: (...args: Args) => T, cacheTime?: number | undefined);
|
|
7
|
-
cleanup(): void;
|
|
8
|
-
get(...args: Args): T;
|
|
9
|
-
getWithKey(args: Args, cacheKey: unknown): T;
|
|
10
|
-
values(): T[];
|
|
11
|
-
stop(): void;
|
|
12
|
-
stats(): {
|
|
13
|
-
count: number;
|
|
14
|
-
withRef: number;
|
|
15
|
-
withWeakRef: number;
|
|
16
|
-
};
|
|
17
|
-
private now;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function isPromise(value: unknown): value is Promise<unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type MaybePromise<T> = T | Promise<T>;
|
package/dist/types/lib/path.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { ArrayToStringPath, Array_, IsAny, IsNever, Object_, OptionalPropertyOf, StringToArrayPath, StringToNumber } from './typeHelpers';
|
|
2
|
-
export type KeyType = string | number | symbol;
|
|
3
|
-
export type AnyPath = string | readonly KeyType[];
|
|
4
|
-
export type GetKeys<T extends Object_ | Array_> = T extends Array_ ? T extends readonly [] ? never : '0' extends keyof T ? StringToNumber<keyof T> : number : keyof T;
|
|
5
|
-
export type _PathAsArray<T, Optional, MaxDepth, Depth extends 1[]> = (Optional extends false ? readonly [] : never) | (true extends IsAny<T> ? readonly KeyType[] : T extends never ? never : T extends Object_ ? Depth['length'] extends MaxDepth ? readonly string[] : T extends Map<infer K extends KeyType, infer V> ? readonly [K] | readonly [K, ..._PathAsArray<V, Optional, MaxDepth, [...Depth, 1]>] : T extends Set<any> ? readonly [number] : {
|
|
6
|
-
[K in GetKeys<T>]: (Optional extends true ? K extends OptionalPropertyOf<T> ? readonly [K] : never : readonly [K]) | readonly [K, ..._PathAsArray<T[K], Optional, MaxDepth, [...Depth, 1]>];
|
|
7
|
-
}[GetKeys<T>] : never);
|
|
8
|
-
export type PathAsArray<T, Optional extends boolean = false, MaxDepth extends number = 5> = _PathAsArray<T, Optional, MaxDepth, []>;
|
|
9
|
-
export type PathAsString<T, Optional extends boolean = false, MaxDepth extends number = 5> = ArrayToStringPath<PathAsArray<T, Optional, MaxDepth>>;
|
|
10
|
-
export type Path<T, Optional extends boolean = false, MaxDepth extends number = 5> = PathAsString<T, Optional, MaxDepth> | PathAsArray<T, Optional, MaxDepth>;
|
|
11
|
-
export type Value<T, P> = P extends readonly [] ? T : true extends IsAny<T> | IsAny<P> ? any : true extends IsNever<T> | IsNever<P> ? never : P extends string ? Value<T, StringToArrayPath<P>> : P extends readonly [infer First extends KeyType, ...infer Rest extends readonly KeyType[]] ? T extends Map<any, infer V> | Set<infer V> ? Value<V, Rest> | undefined : T extends Array_ ? any[] extends T ? Value<T[First & keyof T], Rest> | undefined : Value<T[First & keyof T], Rest> : T extends Object_ ? Record<any, any> extends T ? Value<T[First], Rest> | undefined : Value<T[First], Rest> : never : never;
|
|
12
|
-
export type _WildcardPathAsArray<T, MaxDepth, Depth extends 1[]> = [] | (0 extends 1 & T ? KeyType[] : T extends never ? never : T extends Object_ ? Depth['length'] extends MaxDepth ? string[] : T extends Map<infer K extends KeyType, infer V> ? ['*'] | [K] | [K, ..._WildcardPathAsArray<V, MaxDepth, [...Depth, 1]>] : T extends Set<any> ? ['*'] | [number] : Record<string, any> extends T ? ['*'] | ['*', ..._WildcardPathAsArray<T[string], MaxDepth, [...Depth, 1]>] : {
|
|
13
|
-
[K in GetKeys<T>]: ['*'] | [
|
|
14
|
-
'*',
|
|
15
|
-
..._WildcardPathAsArray<T[T extends readonly any[] ? number : keyof T], MaxDepth, [
|
|
16
|
-
...Depth,
|
|
17
|
-
1
|
|
18
|
-
]>
|
|
19
|
-
] | [K] | [K, ..._WildcardPathAsArray<T[K], MaxDepth, [...Depth, 1]>];
|
|
20
|
-
}[GetKeys<T>] : never);
|
|
21
|
-
export type WildcardPathAsArray<T, MaxDepth extends number = 5> = _WildcardPathAsArray<T, MaxDepth, [
|
|
22
|
-
]>;
|
|
23
|
-
export type WildcardPathAsString<T, MaxDepth extends number = 5> = ArrayToStringPath<_WildcardPathAsArray<T, MaxDepth, []>>;
|
|
24
|
-
export type WildcardPath<T, MaxDepth extends number = 5> = WildcardPathAsString<T, MaxDepth> | WildcardPathAsArray<T, MaxDepth>;
|
|
25
|
-
export type WildcardValue<T, P> = true extends IsAny<T> | IsAny<P> ? any : true extends IsNever<T> | IsNever<P> ? never : P extends string ? WildcardValue<T, StringToArrayPath<P>> : P extends readonly [infer First extends KeyType, ...infer Rest extends KeyType[]] ? T extends Map<any, infer V> | Set<infer V> ? WildcardValue<V, Rest> | (First extends '*' ? never : undefined) : T extends Array_ ? First extends '*' ? WildcardValue<T[number], Rest> : any[] extends T ? WildcardValue<T[First & keyof T], Rest> | undefined : First extends keyof T ? WildcardValue<T[First], Rest> : undefined : T extends Object_ ? First extends '*' ? WildcardValue<T[keyof T], Rest> : Record<any, any> extends T ? WildcardValue<T[First], Rest> | undefined : WildcardValue<T[First], Rest> : never : T;
|
|
26
|
-
export type WildcardMatch<S, W> = S extends string ? WildcardMatch<StringToArrayPath<S>, W> : W extends string ? WildcardMatch<S, StringToArrayPath<W>> : [S, W] extends [readonly [], readonly []] ? true : [S, W] extends [
|
|
27
|
-
readonly [infer SFirst, ...infer SRest],
|
|
28
|
-
readonly [infer WFirst, ...infer WRest]
|
|
29
|
-
] ? [WFirst, WRest['length']] extends ['*' | SFirst, SRest['length']] ? WildcardMatch<SRest, WRest> : false : false;
|
|
30
|
-
export type Join<A extends string | number, B extends string | number> = A extends '' ? B : B extends '' ? A : `${A}.${B}`;
|
|
31
|
-
type _SettablePathAsArray<T, MaxDepth, Depth extends 1[]> = readonly [] | (true extends IsAny<T> ? readonly KeyType[] : undefined extends T ? T extends Map<any, any> | Set<any> ? never : T extends Object_ ? {
|
|
32
|
-
[K in GetKeys<T>]: Partial<T> extends Omit<T, K> ? readonly [K] | readonly [K, ..._SettablePathAsArray<T[K], MaxDepth, [...Depth, 1]>] : readonly [];
|
|
33
|
-
}[GetKeys<T>] : never : T extends never ? never : T extends Object_ ? Depth['length'] extends MaxDepth ? readonly string[] : T extends Map<infer K extends KeyType, infer V> ? readonly [K] | readonly [K, ..._SettablePathAsArray<V, MaxDepth, [...Depth, 1]>] : T extends Set<any> ? readonly [number] : {
|
|
34
|
-
[K in GetKeys<T>]: readonly [K] | readonly [K, ..._SettablePathAsArray<T[K], MaxDepth, [...Depth, 1]>];
|
|
35
|
-
}[GetKeys<T>] : never);
|
|
36
|
-
export type SettablePathAsArray<T, MaxDepth extends number = 5> = _SettablePathAsArray<T, MaxDepth, [
|
|
37
|
-
]>;
|
|
38
|
-
export type SettablePathAsString<T, MaxDepth extends number = 5> = ArrayToStringPath<SettablePathAsArray<T, MaxDepth>>;
|
|
39
|
-
export type SettablePath<T, MaxDepth extends number = 5> = SettablePathAsString<T, MaxDepth> | SettablePathAsArray<T, MaxDepth>;
|
|
40
|
-
export type SettableValue<T, P> = P extends readonly [] ? T : true extends IsAny<T> | IsAny<P> ? any : true extends IsNever<T> | IsNever<P> ? never : P extends string ? SettableValue<T, StringToArrayPath<P>> : P extends readonly [infer First extends KeyType, ...infer Rest extends readonly KeyType[]] ? T extends Map<any, infer V> | Set<infer V> ? SettableValue<V, Rest> : T extends Array_ ? SettableValue<T[First & keyof T], Rest> : T extends Object_ ? SettableValue<T[First], Rest> : never : never;
|
|
41
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare class PromiseCancelError extends Error {
|
|
2
|
-
constructor();
|
|
3
|
-
}
|
|
4
|
-
export declare class PromiseWithCancel<T> extends Promise<T> {
|
|
5
|
-
private abortController;
|
|
6
|
-
constructor(executor: (resolve: (value: T) => void, reject: (error: unknown) => void, signal: AbortSignal) => void);
|
|
7
|
-
cancel(reason?: any): void;
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type ErrorState, type PendingState, type ValueState } from './cacheState';
|
|
2
|
-
import { type MaybePromise } from './maybePromise';
|
|
3
|
-
export declare class PromiseWithState<T> extends Promise<T> {
|
|
4
|
-
state: ValueState<T> | ErrorState | PendingState;
|
|
5
|
-
static resolve(): PromiseWithState<void>;
|
|
6
|
-
static resolve<T>(value: MaybePromise<T>): PromiseWithState<T>;
|
|
7
|
-
static reject<T = never>(error: unknown): PromiseWithState<T>;
|
|
8
|
-
constructor(value: MaybePromise<T>, state?: ValueState<T> | ErrorState | PendingState);
|
|
9
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Constrain } from '../lib/constrain';
|
|
2
|
-
import type { KeyType, Path, SettablePath, SettableValue, Value } from './path';
|
|
3
|
-
export declare function castArrayPath(path: string | KeyType[]): KeyType[];
|
|
4
|
-
export declare function get<T, const P>(object: T, path: Constrain<P, Path<T>>): Value<T, P>;
|
|
5
|
-
export declare function set<T, const P>(object: T, path: Constrain<P, SettablePath<T>>, value: SettableValue<T, P>, rootPath?: string | readonly KeyType[]): T;
|
|
6
|
-
export declare function remove<T, const P>(object: T, path: Constrain<P, Path<T, true>>): T;
|
|
7
|
-
export declare function join(a: string, b: string): string;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { MaybePromise } from './maybePromise';
|
|
2
|
-
type Action<T> = () => MaybePromise<T>;
|
|
3
|
-
export interface Queue {
|
|
4
|
-
<T>(action: Action<T>, ref?: any): Promise<T>;
|
|
5
|
-
clear: () => void;
|
|
6
|
-
whenDone: () => Promise<void>;
|
|
7
|
-
size: number;
|
|
8
|
-
getRefs: () => any[];
|
|
9
|
-
}
|
|
10
|
-
export declare function queue(): Queue;
|
|
11
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Store } from '../core/store';
|
|
2
|
-
import type { OptionalProperties, OptionalPropertyOf } from './typeHelpers';
|
|
3
|
-
type Function_ = (...args: any) => any;
|
|
4
|
-
export declare const arrayMethods: {
|
|
5
|
-
[P in 'splice' | 'push' | 'pop' | 'shift' | 'unshift' | 'reverse' | 'sort']: <T extends Array<any>>(this: Store<T>, ...args: T[P] extends Function_ ? Parameters<T[P]> : never) => T[P] extends Function_ ? ReturnType<T[P]> : never;
|
|
6
|
-
};
|
|
7
|
-
export declare const recordMethods: {
|
|
8
|
-
delete<T extends Record<any, any>, K extends OptionalPropertyOf<T>>(this: Store<T>, key: K): void;
|
|
9
|
-
clear<T extends Record<any, any>>(this: OptionalProperties<T> extends T ? Store<T> : never): void;
|
|
10
|
-
};
|
|
11
|
-
export declare const mapMethods: {
|
|
12
|
-
delete<K, V>(this: Store<Map<K, V>>, key: K): boolean;
|
|
13
|
-
clear<K, V>(this: Store<Map<K, V>>): void;
|
|
14
|
-
};
|
|
15
|
-
export declare const setMethods: {
|
|
16
|
-
add<T>(this: Store<Set<T>>, value: T): void;
|
|
17
|
-
delete<T>(this: Store<Set<T>>, value: T): void;
|
|
18
|
-
clear<T>(this: Store<Set<T>>): void;
|
|
19
|
-
};
|
|
20
|
-
export {};
|
package/dist/types/lib/trie.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { KeyType } from '../lib/path';
|
|
2
|
-
declare class TrieNode {
|
|
3
|
-
children: Map<KeyType, TrieNode>;
|
|
4
|
-
isLeaf: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare class Trie {
|
|
7
|
-
root: TrieNode;
|
|
8
|
-
add(path: KeyType[]): void;
|
|
9
|
-
hasSubPath(path: KeyType[]): boolean;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type KeyType } from './path';
|
|
2
|
-
export type Object_ = Record<string | number | symbol, any>;
|
|
3
|
-
export type Array_ = readonly any[];
|
|
4
|
-
export type StringToNumber<T> = T extends `${infer K extends number}` ? K : never;
|
|
5
|
-
export type ArrayToStringPath<T> = T extends readonly [] ? '' : T extends readonly [infer First extends string | number, ...infer Rest] ? First extends `${string}.${string}` ? never : Rest extends readonly [] ? `${First}` : `${First}.${ArrayToStringPath<Rest>}` : T extends readonly KeyType[] ? string : never;
|
|
6
|
-
export type StringToArrayPath<T> = T extends '' ? readonly [] : T extends `${infer First}.${infer Rest}` ? readonly [First, ...StringToArrayPath<Rest>] : readonly [T];
|
|
7
|
-
export type OptionalPropertyOf<T> = Exclude<{
|
|
8
|
-
[K in keyof T]: string extends K ? K : number extends K ? K : symbol extends K ? K : T extends Record<K, T[K]> ? never : K;
|
|
9
|
-
}[keyof T], undefined>;
|
|
10
|
-
export type OptionalProperties<T> = Pick<T, OptionalPropertyOf<T>>;
|
|
11
|
-
export type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
12
|
-
export type IsNever<T> = [T] extends [never] ? true : false;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type UnwrapPromise<T> = T extends Promise<infer S> ? UnwrapPromise<S> : T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function findOrDefault<T>(array: T[], predicate: (item: T) => boolean, defaultValue: T | (() => T)): T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { mutativeMethods, type Mutation } from './mutativeMethods';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Store } from '../core/store';
|
|
2
|
-
import type { Constrain } from '../lib/constrain';
|
|
3
|
-
import { type Path, type Value } from '../lib/path';
|
|
4
|
-
import { type Draft } from 'mutative';
|
|
5
|
-
export type Mutation<T> = (draft: Draft<T>) => void;
|
|
6
|
-
declare function update<T>(this: Store<T>, mutation: Mutation<T>): void;
|
|
7
|
-
declare function update<T, const P>(this: Store<T>, path: Constrain<P, Path<T>>, mutation: Mutation<Value<T, P>>): void;
|
|
8
|
-
export declare const mutativeMethods: {
|
|
9
|
-
update: typeof update;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { patchMethods, type SubscribePatchOptions, type SyncMessage } from './patchMethods';
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Cancel, DisposableCancel, SubscribeOptions } from '../core/commonTypes';
|
|
2
|
-
import type { Store } from '../core/store';
|
|
3
|
-
import { type DiffOptions, type Patch } from '../lib/diff';
|
|
4
|
-
export interface SyncMessage {
|
|
5
|
-
fromVersion?: string;
|
|
6
|
-
toVersion: string;
|
|
7
|
-
patches: Patch[];
|
|
8
|
-
}
|
|
9
|
-
export interface HistoryEntry extends SyncMessage {
|
|
10
|
-
reversePatches: Patch[];
|
|
11
|
-
}
|
|
12
|
-
declare module '../core' {
|
|
13
|
-
interface Store<T> {
|
|
14
|
-
__patches?: {
|
|
15
|
-
value: T;
|
|
16
|
-
version: string;
|
|
17
|
-
history: HistoryEntry[];
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export interface SubscribePatchOptions extends SubscribeOptions, DiffOptions {
|
|
22
|
-
/** @default false */
|
|
23
|
-
runNow?: boolean;
|
|
24
|
-
/** try to start from a specific version and only receive patches after that.
|
|
25
|
-
* If the id is not found, it will start from the beginning */
|
|
26
|
-
startAt?: string;
|
|
27
|
-
}
|
|
28
|
-
export type InteropPatch = Patch | {
|
|
29
|
-
op: 'add' | 'replace' | 'remove';
|
|
30
|
-
value?: any;
|
|
31
|
-
};
|
|
32
|
-
export declare function subscribePatches<T>(this: Store<T>, listener: (this: {
|
|
33
|
-
cancel: Cancel;
|
|
34
|
-
}, patches: Patch[], reversePatches: Patch[], version: string, previousVersion: string | undefined) => void, options?: SubscribePatchOptions): DisposableCancel;
|
|
35
|
-
export declare function applyPatches<T>(this: Store<T>, patches: InteropPatch[]): void;
|
|
36
|
-
export declare function applyPatches<T>(this: Store<T>, ...patches: InteropPatch[]): void;
|
|
37
|
-
export declare function sync<T>(this: Store<T>, listener: (syncMessage: SyncMessage) => void, options?: Omit<SubscribePatchOptions, 'runNow'>): DisposableCancel;
|
|
38
|
-
export declare function acceptSync<T>(this: Store<T>, message: SyncMessage): void;
|
|
39
|
-
export declare const patchMethods: {
|
|
40
|
-
subscribePatches: typeof subscribePatches;
|
|
41
|
-
applyPatches: typeof applyPatches;
|
|
42
|
-
sync: typeof sync;
|
|
43
|
-
acceptSync: typeof acceptSync;
|
|
44
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type Cancel, type Duration, type Store } from '../core';
|
|
2
|
-
import type { KeyType, WildcardPath } from '../lib/path';
|
|
3
|
-
import { type PersistStorage, type PersistStorageWithListItems } from './persistStorage';
|
|
4
|
-
type PathOption<T> = WildcardPath<T> | {
|
|
5
|
-
path: WildcardPath<T>;
|
|
6
|
-
};
|
|
7
|
-
export interface PersistOptions<T> {
|
|
8
|
-
id: string;
|
|
9
|
-
storage: PersistStorage;
|
|
10
|
-
paths?: PathOption<T>[];
|
|
11
|
-
throttle?: Duration;
|
|
12
|
-
}
|
|
13
|
-
export declare class Persist<T> {
|
|
14
|
-
readonly store: Store<T>;
|
|
15
|
-
readonly options: PersistOptions<T>;
|
|
16
|
-
readonly storage: PersistStorageWithListItems;
|
|
17
|
-
readonly [Symbol.dispose]: Cancel;
|
|
18
|
-
readonly paths: {
|
|
19
|
-
path: KeyType[];
|
|
20
|
-
throttle?: number;
|
|
21
|
-
}[];
|
|
22
|
-
readonly initialized: Promise<void>;
|
|
23
|
-
private resolveInitialized?;
|
|
24
|
-
private channel;
|
|
25
|
-
private queue;
|
|
26
|
-
private handles;
|
|
27
|
-
private stopped;
|
|
28
|
-
private updateInProgress;
|
|
29
|
-
private prefix;
|
|
30
|
-
constructor(store: Store<T>, options: PersistOptions<T>);
|
|
31
|
-
private watchStore;
|
|
32
|
-
private watchStorage;
|
|
33
|
-
private buildKey;
|
|
34
|
-
private parseKey;
|
|
35
|
-
private load;
|
|
36
|
-
private save;
|
|
37
|
-
stop(): Promise<void>;
|
|
38
|
-
}
|
|
39
|
-
export declare function persist<T>(store: Store<T>, options: PersistOptions<T>): Persist<T>;
|
|
40
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface PersistStorageBase {
|
|
2
|
-
getItem: (key: string) => string | null | Promise<string | null>;
|
|
3
|
-
setItem: (key: string, value: string) => void | Promise<unknown>;
|
|
4
|
-
removeItem: (key: string) => void | Promise<unknown>;
|
|
5
|
-
}
|
|
6
|
-
export interface PersistStorageWithKeys extends PersistStorageBase {
|
|
7
|
-
keys: () => string[] | Promise<string[]>;
|
|
8
|
-
}
|
|
9
|
-
export interface PersistStorageWithLength extends PersistStorageBase {
|
|
10
|
-
length: number | (() => number | Promise<number>);
|
|
11
|
-
key: (keyIndex: number) => string | null | Promise<string | null>;
|
|
12
|
-
}
|
|
13
|
-
export interface PersistStorageWithListItems extends PersistStorageBase {
|
|
14
|
-
listItems: () => Map<string, string> | Promise<Map<string, string>>;
|
|
15
|
-
}
|
|
16
|
-
export type PersistStorage = PersistStorageWithKeys | PersistStorageWithLength | PersistStorageWithListItems;
|
|
17
|
-
export declare function normalizeStorage(storage: PersistStorage): PersistStorageWithListItems;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { type Store, type Update, type UrlStoreOptions } from '../../core';
|
|
2
|
-
import { type Path, type PathAsString, type Value, type WildcardPathAsString, type WildcardValue } from '../../lib/path';
|
|
3
|
-
import type { Object_ } from '../../lib/typeHelpers';
|
|
4
|
-
import { type Context, type FormEvent, type FunctionComponent, type HTMLProps, type ReactNode } from 'react';
|
|
5
|
-
import { type UseStoreOptions } from '../useStore';
|
|
6
|
-
import { type FormFieldComponent, type FormFieldPropsWithComponent, type FormFieldPropsWithRender } from './formField';
|
|
7
|
-
import { type ElementName, type FormForEachProps } from './formForEach';
|
|
8
|
-
import { type FormAutosaveOptions } from './useFormAutosave';
|
|
9
|
-
export type Transform<TDraft> = Path<TDraft> | '' extends infer TPath ? TPath extends TPath ? {
|
|
10
|
-
update: (value: Value<TDraft, TPath>, store: Store<TDraft>) => void | TDraft;
|
|
11
|
-
} & (TPath extends '' ? {
|
|
12
|
-
trigger?: '';
|
|
13
|
-
} : {
|
|
14
|
-
trigger: TPath;
|
|
15
|
-
}) : never : never;
|
|
16
|
-
export interface FormOptions<TDraft, TOriginal> {
|
|
17
|
-
defaultValue: TDraft;
|
|
18
|
-
validations?: Validations<TDraft, TOriginal>;
|
|
19
|
-
localizeError?: (error: string, field: string) => string | undefined;
|
|
20
|
-
urlState?: boolean | UrlStoreOptions<TDraft>;
|
|
21
|
-
autoSave?: FormAutosaveOptions<TDraft, TOriginal>;
|
|
22
|
-
transform?: Transform<TDraft>[];
|
|
23
|
-
validatedClass?: string;
|
|
24
|
-
}
|
|
25
|
-
export type Validations<TDraft, TOriginal> = {
|
|
26
|
-
[TPath in WildcardPathAsString<TDraft>]?: Record<string, Validation<TDraft, TOriginal, TPath>>;
|
|
27
|
-
} & Record<string, Record<string, Validation<TDraft, TOriginal, any>>>;
|
|
28
|
-
export type Validation<TDraft, TOriginal, TPath> = (value: WildcardValue<TDraft, TPath>, context: {
|
|
29
|
-
draft: TDraft;
|
|
30
|
-
original: TOriginal;
|
|
31
|
-
field: PathAsString<TDraft> | '';
|
|
32
|
-
}) => boolean;
|
|
33
|
-
export type Field<TDraft, TOriginal, TPath extends string> = {
|
|
34
|
-
originalValue: Value<TOriginal, TPath> | undefined;
|
|
35
|
-
value: Value<TDraft, TPath>;
|
|
36
|
-
setValue: (value: Update<Value<TDraft, TPath>>) => void;
|
|
37
|
-
hasChange: boolean;
|
|
38
|
-
errors: string[];
|
|
39
|
-
} & (Value<TDraft, TPath> extends Object_ ? FieldHelperMethods<TDraft, TPath> : {});
|
|
40
|
-
export type FieldHelperMethods<TDraft, TPath extends string> = {
|
|
41
|
-
names: ElementName<TDraft, TPath>[];
|
|
42
|
-
add: NonNullable<Value<TDraft, TPath>> extends readonly (infer T)[] ? (element: T) => void : NonNullable<Value<TDraft, TPath>> extends Record<infer K, infer V> ? (key: K, value: V) => void : never;
|
|
43
|
-
remove: Value<TDraft, TPath> extends readonly any[] ? (index: number) => void : (key: string) => void;
|
|
44
|
-
};
|
|
45
|
-
export interface FormState<TDraft> {
|
|
46
|
-
draft: TDraft | undefined;
|
|
47
|
-
hasTriggeredValidations: boolean;
|
|
48
|
-
saveScheduled: boolean;
|
|
49
|
-
saveInProgress: boolean;
|
|
50
|
-
}
|
|
51
|
-
export interface FormDerivedState<TDraft> {
|
|
52
|
-
draft: TDraft;
|
|
53
|
-
hasTriggeredValidations: boolean;
|
|
54
|
-
saveScheduled: boolean;
|
|
55
|
-
saveInProgress: boolean;
|
|
56
|
-
hasChanges: boolean;
|
|
57
|
-
errors: Map<string, string[]>;
|
|
58
|
-
isValid: boolean;
|
|
59
|
-
}
|
|
60
|
-
export interface FormContext<TDraft, TOriginal> {
|
|
61
|
-
formState: Store<FormState<TDraft>>;
|
|
62
|
-
options: FormOptions<TDraft, TOriginal>;
|
|
63
|
-
original: TOriginal | undefined;
|
|
64
|
-
getField: <TPath extends string>(path: TPath) => Field<TDraft, TOriginal, TPath>;
|
|
65
|
-
getDraft: () => TDraft;
|
|
66
|
-
hasTriggeredValidations: () => boolean;
|
|
67
|
-
saveScheduled: () => boolean;
|
|
68
|
-
saveInProgress: () => boolean;
|
|
69
|
-
hasChanges: () => boolean;
|
|
70
|
-
getErrors: () => Map<string, string[]>;
|
|
71
|
-
isValid: () => boolean;
|
|
72
|
-
validate: () => boolean;
|
|
73
|
-
reset: () => void;
|
|
74
|
-
}
|
|
75
|
-
export interface FormInstance<TDraft, TOriginal> extends FormDerivedState<TDraft>, Pick<FormContext<TDraft, TOriginal>, 'options' | 'original' | 'getField' | 'validate' | 'reset'> {
|
|
76
|
-
}
|
|
77
|
-
export declare function getDerivedState<TDraft>(instance: FormContext<TDraft, any>): FormDerivedState<TDraft>;
|
|
78
|
-
export declare class Form<TDraft, TOriginal extends TDraft = TDraft> {
|
|
79
|
-
readonly options: FormOptions<TDraft, TOriginal>;
|
|
80
|
-
context: Context<FormContext<TDraft, TOriginal> | null>;
|
|
81
|
-
constructor(options: FormOptions<TDraft, TOriginal>);
|
|
82
|
-
useForm(): FormContext<TDraft, TOriginal>;
|
|
83
|
-
useFormState<S>(selector: (state: FormInstance<TDraft, TOriginal>) => S, useStoreOptions?: UseStoreOptions<S>): S;
|
|
84
|
-
useField<TPath extends string>(path: TPath, useStoreOptions?: UseStoreOptions<any>): Field<TDraft, TOriginal, TPath>;
|
|
85
|
-
Form({ original, defaultValue, validations, localizeError, urlState, autoSave, transform, validatedClass, ...formProps }: {
|
|
86
|
-
original?: TOriginal;
|
|
87
|
-
onSubmit?: (event: FormEvent<HTMLFormElement>, form: FormInstance<TDraft, TOriginal>) => void;
|
|
88
|
-
} & Partial<FormOptions<TDraft, TOriginal>> & Omit<HTMLProps<HTMLFormElement>, 'defaultValue' | 'autoSave' | 'onSubmit'>): JSX.Element;
|
|
89
|
-
FormState<S>({ selector, children, }: {
|
|
90
|
-
selector: (form: FormInstance<TDraft, TOriginal>) => S;
|
|
91
|
-
children: (selectedState: S) => ReactNode;
|
|
92
|
-
}): JSX.Element;
|
|
93
|
-
Field<const TPath extends string>(props: FormFieldPropsWithRender<TDraft, TOriginal, TPath>): JSX.Element;
|
|
94
|
-
Field<const TPath extends string, const TComponent extends FormFieldComponent = 'input'>(props: FormFieldPropsWithComponent<TDraft, TOriginal, TPath, TComponent>): JSX.Element;
|
|
95
|
-
ForEach<const TPath extends string>(props: FormForEachProps<TDraft, TPath>): JSX.Element;
|
|
96
|
-
withForm<TProps extends Record<string, unknown>>(Component: React.ComponentType<TProps>, formProps?: Parameters<this['Form']>[0]): FunctionComponent<TProps>;
|
|
97
|
-
}
|
|
98
|
-
export declare function createForm<TDraft, TOriginal extends TDraft = TDraft>(options: FormOptions<TDraft, TOriginal>): Form<TDraft, TOriginal>;
|