@lehnihon/bit-form 2.2.7 → 2.2.8
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 +6 -6
- package/dist/angular/index.cjs +1 -1
- package/dist/angular/index.cjs.map +1 -1
- package/dist/angular/index.d.cts +10 -8
- package/dist/angular/index.d.ts +10 -8
- package/dist/angular/index.js +1 -1
- package/dist/angular/index.js.map +1 -1
- package/dist/{array-controller-DtkmcnUr.d.ts → array-controller-B5bfXV1W.d.cts} +4 -4
- package/dist/{array-controller-C1A5VKYd.d.cts → array-controller-Cx-DMH7Y.d.ts} +4 -4
- package/dist/bus-B2VEKrPI.d.ts +19 -0
- package/dist/bus-ZLQeq4Vr.d.cts +19 -0
- package/dist/chunk-5NA2TFPG.js +1 -0
- package/dist/chunk-5NA2TFPG.js.map +1 -0
- package/dist/chunk-63OJBMKK.js +2 -0
- package/dist/chunk-63OJBMKK.js.map +1 -0
- package/dist/chunk-BSGJ3T5S.cjs +2 -0
- package/dist/chunk-BSGJ3T5S.cjs.map +1 -0
- package/dist/chunk-CPP7ELA5.js +2 -0
- package/dist/chunk-CPP7ELA5.js.map +1 -0
- package/dist/chunk-D7JQWF6V.cjs +2 -0
- package/dist/chunk-D7JQWF6V.cjs.map +1 -0
- package/dist/chunk-E2NZR44P.js +2 -0
- package/dist/chunk-E2NZR44P.js.map +1 -0
- package/dist/chunk-EQ55DKX2.js +2 -0
- package/dist/chunk-EQ55DKX2.js.map +1 -0
- package/dist/chunk-JC4R5WCC.js +2 -0
- package/dist/chunk-JC4R5WCC.js.map +1 -0
- package/dist/chunk-M6WBNHIT.cjs +2 -0
- package/dist/chunk-M6WBNHIT.cjs.map +1 -0
- package/dist/chunk-MFSQATNZ.cjs +2 -0
- package/dist/chunk-MFSQATNZ.cjs.map +1 -0
- package/dist/chunk-MFTWAFMG.cjs +2 -0
- package/dist/chunk-MFTWAFMG.cjs.map +1 -0
- package/dist/chunk-P2YWYBWG.cjs +2 -0
- package/dist/chunk-P2YWYBWG.cjs.map +1 -0
- package/dist/chunk-RD73EBSN.js +2 -0
- package/dist/chunk-RD73EBSN.js.map +1 -0
- package/dist/chunk-T2JRSWQU.cjs +2 -0
- package/dist/chunk-T2JRSWQU.cjs.map +1 -0
- package/dist/chunk-UQ3DSUWC.js +2 -0
- package/dist/chunk-UQ3DSUWC.js.map +1 -0
- package/dist/chunk-VZHG372Q.cjs +2 -0
- package/dist/chunk-VZHG372Q.cjs.map +1 -0
- package/dist/chunk-W2E5UIXT.js +2 -0
- package/dist/chunk-W2E5UIXT.js.map +1 -0
- package/dist/chunk-W5CLDRRE.cjs +1 -0
- package/dist/chunk-W5CLDRRE.cjs.map +1 -0
- package/dist/core/bindings.cjs +2 -0
- package/dist/core/bindings.cjs.map +1 -0
- package/dist/core/bindings.d.cts +81 -0
- package/dist/core/bindings.d.ts +81 -0
- package/dist/core/bindings.js +2 -0
- package/dist/core/bindings.js.map +1 -0
- package/dist/core/status.cjs +2 -0
- package/dist/core/status.cjs.map +1 -0
- package/dist/core/status.d.cts +44 -0
- package/dist/core/status.d.ts +44 -0
- package/dist/core/status.js +2 -0
- package/dist/core/status.js.map +1 -0
- package/dist/core/store.cjs +2 -0
- package/dist/core/store.cjs.map +1 -0
- package/dist/core/store.d.cts +84 -0
- package/dist/core/store.d.ts +84 -0
- package/dist/core/store.js +2 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/utils.cjs +2 -0
- package/dist/core/utils.cjs.map +1 -0
- package/dist/core/utils.d.cts +81 -0
- package/dist/core/utils.d.ts +81 -0
- package/dist/core/utils.js +2 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +14 -122
- package/dist/core.d.ts +14 -122
- package/dist/core.js +1 -1
- package/dist/devtools/bridge.cjs +1 -1
- package/dist/devtools/bridge.cjs.map +1 -1
- package/dist/devtools/bridge.d.cts +3 -2
- package/dist/devtools/bridge.d.ts +3 -2
- package/dist/devtools/bridge.js +1 -1
- package/dist/devtools/index.cjs +2 -2
- package/dist/devtools/index.cjs.map +1 -1
- package/dist/devtools/index.d.cts +3 -2
- package/dist/devtools/index.d.ts +3 -2
- package/dist/devtools/index.js +1 -1
- package/dist/devtools/index.js.map +1 -1
- package/dist/{field-binding-X5TkvfUt.d.cts → field-binding-B_OX3bjp.d.cts} +1 -1
- package/dist/{field-binding-Bi1g-D8X.d.ts → field-binding-MX6jVQbT.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -85
- package/dist/index.d.ts +8 -85
- package/dist/index.js +1 -1
- package/dist/mask.d.cts +2 -2
- package/dist/mask.d.ts +2 -2
- package/dist/meta-types-Bzmm21TP.d.cts +18 -0
- package/dist/meta-types-Bzmm21TP.d.ts +18 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +11 -9
- package/dist/react/index.d.ts +11 -9
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react-native/index.cjs +1 -1
- package/dist/react-native/index.cjs.map +1 -1
- package/dist/react-native/index.d.cts +9 -7
- package/dist/react-native/index.d.ts +9 -7
- package/dist/react-native/index.js +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/resolvers/index.cjs +1 -1
- package/dist/resolvers/index.cjs.map +1 -1
- package/dist/resolvers/index.d.cts +3 -2
- package/dist/resolvers/index.d.ts +3 -2
- package/dist/resolvers/index.js +1 -1
- package/dist/resolvers/joi.d.cts +3 -2
- package/dist/resolvers/joi.d.ts +3 -2
- package/dist/resolvers/yup.d.cts +3 -2
- package/dist/resolvers/yup.d.ts +3 -2
- package/dist/resolvers/zod.d.cts +3 -2
- package/dist/resolvers/zod.d.ts +3 -2
- package/dist/store-api-types-D-ZHxzRy.d.cts +161 -0
- package/dist/store-api-types-DPi30jQF.d.ts +161 -0
- package/dist/{bus-DgilLszS.d.ts → types-CG5nYeRk.d.ts} +76 -45
- package/dist/{bus-rcUiufS7.d.cts → types-D6LhF5GC.d.cts} +76 -45
- package/dist/{types-CUXh7PqD.d.cts → types-D8DgIUhJ.d.cts} +1 -1
- package/dist/{types-CUXh7PqD.d.ts → types-D8DgIUhJ.d.ts} +1 -1
- package/dist/{upload-EXnJLq8k.d.cts → upload-C2mpfhp1.d.cts} +1 -1
- package/dist/{upload-EXnJLq8k.d.ts → upload-C2mpfhp1.d.ts} +1 -1
- package/dist/{use-bit-persist-CIKFwtdM.d.cts → use-bit-persist-BTwy8kvA.d.ts} +8 -6
- package/dist/{use-bit-persist-Bc06fmqZ.d.ts → use-bit-persist-C2LHNTVv.d.cts} +8 -6
- package/dist/utils.cjs +2 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +6 -0
- package/dist/utils.d.ts +6 -0
- package/dist/utils.js +2 -0
- package/dist/utils.js.map +1 -0
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.cts +9 -7
- package/dist/vue/index.d.ts +9 -7
- package/dist/vue/index.js +1 -1
- package/dist/vue/index.js.map +1 -1
- package/package.json +32 -10
- package/dist/chunk-DIEE6LUO.js +0 -2
- package/dist/chunk-DIEE6LUO.js.map +0 -1
- package/dist/chunk-FUUQB4DV.cjs +0 -2
- package/dist/chunk-FUUQB4DV.cjs.map +0 -1
- package/dist/chunk-KWLLYQOL.cjs +0 -2
- package/dist/chunk-KWLLYQOL.cjs.map +0 -1
- package/dist/chunk-LIYZPSWM.js +0 -2
- package/dist/chunk-LIYZPSWM.js.map +0 -1
- package/dist/chunk-QAL6J5GQ.cjs +0 -2
- package/dist/chunk-QAL6J5GQ.cjs.map +0 -1
- package/dist/chunk-SA47B5OP.js +0 -2
- package/dist/chunk-SA47B5OP.js.map +0 -1
- package/dist/store-api-types-9ipdute1.d.ts +0 -187
- package/dist/store-api-types-B6_bPoVI.d.cts +0 -187
package/dist/resolvers/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as o}from"../chunk-M2XR4C7T.js";import{a as r}from"../chunk-GDRNKTHO.js";import{a as e}from"../chunk-FGJB4DHQ.js";import"../chunk-GUU6EXFN.js";import"../chunk-FQLJOSF7.js";export{e as joiResolver,r as yupResolver,o as zodResolver};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/resolvers/joi.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ObjectSchema } from 'joi';
|
|
2
|
-
import {
|
|
2
|
+
import { k as BitErrors } from '../types-D6LhF5GC.cjs';
|
|
3
|
+
import '../bus-ZLQeq4Vr.cjs';
|
|
3
4
|
import { BitJoiResolverConfig, BitResolverScopeOptions } from './types.cjs';
|
|
4
|
-
import '../types-
|
|
5
|
+
import '../types-D8DgIUhJ.cjs';
|
|
5
6
|
|
|
6
7
|
declare const joiResolver: <T extends object>(schema: ObjectSchema<T>, config?: BitJoiResolverConfig) => (values: T, options?: BitResolverScopeOptions) => Promise<BitErrors<T>>;
|
|
7
8
|
|
package/dist/resolvers/joi.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ObjectSchema } from 'joi';
|
|
2
|
-
import {
|
|
2
|
+
import { k as BitErrors } from '../types-CG5nYeRk.js';
|
|
3
|
+
import '../bus-B2VEKrPI.js';
|
|
3
4
|
import { BitJoiResolverConfig, BitResolverScopeOptions } from './types.js';
|
|
4
|
-
import '../types-
|
|
5
|
+
import '../types-D8DgIUhJ.js';
|
|
5
6
|
|
|
6
7
|
declare const joiResolver: <T extends object>(schema: ObjectSchema<T>, config?: BitJoiResolverConfig) => (values: T, options?: BitResolverScopeOptions) => Promise<BitErrors<T>>;
|
|
7
8
|
|
package/dist/resolvers/yup.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Schema } from 'yup';
|
|
2
|
-
import {
|
|
2
|
+
import { k as BitErrors } from '../types-D6LhF5GC.cjs';
|
|
3
|
+
import '../bus-ZLQeq4Vr.cjs';
|
|
3
4
|
import { BitYupResolverConfig, BitResolverScopeOptions } from './types.cjs';
|
|
4
|
-
import '../types-
|
|
5
|
+
import '../types-D8DgIUhJ.cjs';
|
|
5
6
|
|
|
6
7
|
declare const yupResolver: <T extends object>(schema: Schema<T>, config?: BitYupResolverConfig) => (values: T, options?: BitResolverScopeOptions) => Promise<BitErrors<T>>;
|
|
7
8
|
|
package/dist/resolvers/yup.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Schema } from 'yup';
|
|
2
|
-
import {
|
|
2
|
+
import { k as BitErrors } from '../types-CG5nYeRk.js';
|
|
3
|
+
import '../bus-B2VEKrPI.js';
|
|
3
4
|
import { BitYupResolverConfig, BitResolverScopeOptions } from './types.js';
|
|
4
|
-
import '../types-
|
|
5
|
+
import '../types-D8DgIUhJ.js';
|
|
5
6
|
|
|
6
7
|
declare const yupResolver: <T extends object>(schema: Schema<T>, config?: BitYupResolverConfig) => (values: T, options?: BitResolverScopeOptions) => Promise<BitErrors<T>>;
|
|
7
8
|
|
package/dist/resolvers/zod.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ZodSchema } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { k as BitErrors } from '../types-D6LhF5GC.cjs';
|
|
3
|
+
import '../bus-ZLQeq4Vr.cjs';
|
|
3
4
|
import { BitZodResolverConfig, BitResolverScopeOptions } from './types.cjs';
|
|
4
|
-
import '../types-
|
|
5
|
+
import '../types-D8DgIUhJ.cjs';
|
|
5
6
|
|
|
6
7
|
declare const zodResolver: <T extends object>(schema: ZodSchema<T>, _config?: BitZodResolverConfig) => (values: T, options?: BitResolverScopeOptions) => Promise<BitErrors<T>>;
|
|
7
8
|
|
package/dist/resolvers/zod.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ZodSchema } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { k as BitErrors } from '../types-CG5nYeRk.js';
|
|
3
|
+
import '../bus-B2VEKrPI.js';
|
|
3
4
|
import { BitZodResolverConfig, BitResolverScopeOptions } from './types.js';
|
|
4
|
-
import '../types-
|
|
5
|
+
import '../types-D8DgIUhJ.js';
|
|
5
6
|
|
|
6
7
|
declare const zodResolver: <T extends object>(schema: ZodSchema<T>, _config?: BitZodResolverConfig) => (values: T, options?: BitResolverScopeOptions) => Promise<BitErrors<T>>;
|
|
7
8
|
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { G as BitState, j as BitConfig, N as ValidatorFn, o as BitFieldDefinition, M as DevToolsOptions, O as BitPersistResolvedConfig, P as BitIdFactory, A as BitPlugin, F as BitScheduler, r as BitFormGlobal, u as BitPath, p as BitFieldState, v as BitPathValue, x as BitPersistMetadata, S as ScopeStatus, L as DeepPartial, k as BitErrors, H as BitSubmitResult, c as BitArrayPath, b as BitArrayItem } from './types-D6LhF5GC.cjs';
|
|
2
|
+
import { B as BitMask } from './types-D8DgIUhJ.cjs';
|
|
3
|
+
import { a as BitHistoryMetadata, B as BitFormMeta, b as BitValidationOptions } from './meta-types-Bzmm21TP.cjs';
|
|
4
|
+
|
|
5
|
+
type BitSelector<T extends object, TSlice> = (state: Readonly<BitState<T>>) => TSlice;
|
|
6
|
+
type BitEqualityFn<TValue> = (previous: TValue, next: TValue) => boolean;
|
|
7
|
+
interface BitScopedSelectorSubscriptionOptions<TValue> {
|
|
8
|
+
mode?: "scoped";
|
|
9
|
+
paths: string[];
|
|
10
|
+
equalityFn?: BitEqualityFn<TValue>;
|
|
11
|
+
emitImmediately?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface BitTrackedSelectorSubscriptionOptions<TValue> {
|
|
14
|
+
mode: "tracked";
|
|
15
|
+
equalityFn?: BitEqualityFn<TValue>;
|
|
16
|
+
emitImmediately?: boolean;
|
|
17
|
+
}
|
|
18
|
+
type BitSelectorSubscriptionOptions<TValue> = BitScopedSelectorSubscriptionOptions<TValue> | BitTrackedSelectorSubscriptionOptions<TValue>;
|
|
19
|
+
|
|
20
|
+
interface BitValidationTriggerOptions {
|
|
21
|
+
forceDebounce?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface BitStoreIdentityApi<T extends object = Record<string, unknown>> {
|
|
25
|
+
readonly storeId: string;
|
|
26
|
+
readonly config: Readonly<BitFrameworkConfig<T>>;
|
|
27
|
+
}
|
|
28
|
+
interface BitFrameworkConfig<T extends object = Record<string, unknown>> extends BitConfig<T> {
|
|
29
|
+
initialValues: T;
|
|
30
|
+
resolver?: ValidatorFn<T>;
|
|
31
|
+
validationDelay: number;
|
|
32
|
+
history: {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
limit: number;
|
|
35
|
+
};
|
|
36
|
+
masks?: Record<string, BitMask>;
|
|
37
|
+
fields?: Record<string, BitFieldDefinition<T>>;
|
|
38
|
+
devTools?: boolean | DevToolsOptions;
|
|
39
|
+
persist: BitPersistResolvedConfig<T>;
|
|
40
|
+
idFactory: BitIdFactory;
|
|
41
|
+
plugins: BitPlugin<T>[];
|
|
42
|
+
scheduler?: BitScheduler;
|
|
43
|
+
subscriptionCacheSize?: number;
|
|
44
|
+
bus?: BitFormGlobal;
|
|
45
|
+
onUnhandledError: (error: unknown, source: "submit" | "validation" | "persist") => void;
|
|
46
|
+
}
|
|
47
|
+
interface BitFormReadApi<T extends object = Record<string, unknown>> {
|
|
48
|
+
getState(): Readonly<BitState<T>>;
|
|
49
|
+
getFieldConfig(path: string): BitFieldDefinition<T> | undefined;
|
|
50
|
+
getFieldState<P extends BitPath<T>>(path: P): Readonly<BitFieldState<T, BitPathValue<T, P>>>;
|
|
51
|
+
isHidden<P extends BitPath<T>>(path: P): boolean;
|
|
52
|
+
isRequired<P extends BitPath<T>>(path: P): boolean;
|
|
53
|
+
isFieldDirty(path: string): boolean;
|
|
54
|
+
isFieldValidating(path: string): boolean;
|
|
55
|
+
getDirtyValues(): Partial<T>;
|
|
56
|
+
getPersistMetadata(): BitPersistMetadata;
|
|
57
|
+
getHistoryMetadata(): BitHistoryMetadata;
|
|
58
|
+
getScopeStatus(scopeName: string): ScopeStatus;
|
|
59
|
+
getScopeErrors(scopeName: string): Record<string, string>;
|
|
60
|
+
getScopeFields(scopeName: string): string[];
|
|
61
|
+
}
|
|
62
|
+
interface BitFormObserveApi<T extends object = Record<string, unknown>> {
|
|
63
|
+
subscribe(listener: () => void): () => void;
|
|
64
|
+
subscribePersistMeta(listener: (meta: BitPersistMetadata) => void): () => void;
|
|
65
|
+
subscribeHistoryMeta(listener: (meta: BitHistoryMetadata) => void): () => void;
|
|
66
|
+
subscribeScopeStatus(scopeName: string, listener: (status: ScopeStatus) => void): () => void;
|
|
67
|
+
}
|
|
68
|
+
interface BitFormWriteApi<T extends object = Record<string, unknown>> {
|
|
69
|
+
setField<P extends BitPath<T>>(path: P, value: BitPathValue<T, P>): void;
|
|
70
|
+
blurField<P extends BitPath<T>>(path: P): void;
|
|
71
|
+
markFieldsTouched(paths: string[]): void;
|
|
72
|
+
setValues(values: T | DeepPartial<T>, options?: {
|
|
73
|
+
partial?: boolean;
|
|
74
|
+
rebase?: boolean;
|
|
75
|
+
}): void;
|
|
76
|
+
setError(path: string, message: string | undefined): void;
|
|
77
|
+
setErrors(errors: BitErrors<T>): void;
|
|
78
|
+
setServerErrors(serverErrors: Record<string, string[] | string>): void;
|
|
79
|
+
validate(options?: BitValidationOptions): Promise<boolean>;
|
|
80
|
+
triggerValidation(scopeFields?: string[], options?: BitValidationTriggerOptions): void;
|
|
81
|
+
reset(): void;
|
|
82
|
+
transaction<TResult>(callback: () => TResult): TResult;
|
|
83
|
+
submit(onSuccess: (values: T, dirtyValues?: Partial<T>) => void | Promise<void>): Promise<BitSubmitResult>;
|
|
84
|
+
}
|
|
85
|
+
interface BitStoreLifecycleApi {
|
|
86
|
+
cleanup(): void;
|
|
87
|
+
}
|
|
88
|
+
interface BitStorePersistFeatureApi {
|
|
89
|
+
getPersistMetadata(): BitPersistMetadata;
|
|
90
|
+
restorePersisted(): Promise<boolean>;
|
|
91
|
+
forceSave(): Promise<void>;
|
|
92
|
+
clearPersisted(): Promise<void>;
|
|
93
|
+
}
|
|
94
|
+
interface BitStoreRegistrationFeatureApi<T extends object = Record<string, unknown>> {
|
|
95
|
+
registerField(path: string, config: BitFieldDefinition<T>): void;
|
|
96
|
+
unregisterField(path: string): void;
|
|
97
|
+
unregisterPrefix(prefix: string): void;
|
|
98
|
+
}
|
|
99
|
+
interface BitStoreArrayFeatureApi<T extends object = Record<string, unknown>> {
|
|
100
|
+
pushItem<P extends BitArrayPath<T>>(path: P, value: BitArrayItem<BitPathValue<T, P>>): void;
|
|
101
|
+
prependItem<P extends BitArrayPath<T>>(path: P, value: BitArrayItem<BitPathValue<T, P>>): void;
|
|
102
|
+
insertItem<P extends BitArrayPath<T>>(path: P, index: number, value: BitArrayItem<BitPathValue<T, P>>): void;
|
|
103
|
+
removeItem<P extends BitArrayPath<T>>(path: P, index: number): void;
|
|
104
|
+
moveItem<P extends BitArrayPath<T>>(path: P, from: number, to: number): void;
|
|
105
|
+
swapItems<P extends BitArrayPath<T>>(path: P, indexA: number, indexB: number): void;
|
|
106
|
+
replaceItems<P extends BitArrayPath<T>>(path: P, items: BitArrayItem<BitPathValue<T, P>>[]): void;
|
|
107
|
+
clearItems<P extends BitArrayPath<T>>(path: P): void;
|
|
108
|
+
}
|
|
109
|
+
interface BitStoreHistoryFeatureApi {
|
|
110
|
+
readonly canUndo: boolean;
|
|
111
|
+
readonly canRedo: boolean;
|
|
112
|
+
undo(): void;
|
|
113
|
+
redo(): void;
|
|
114
|
+
}
|
|
115
|
+
interface BitStoreStateFlagsApi {
|
|
116
|
+
readonly isValid: boolean;
|
|
117
|
+
readonly isSubmitting: boolean;
|
|
118
|
+
readonly isDirty: boolean;
|
|
119
|
+
}
|
|
120
|
+
interface BitFormMetaBindingApi<T extends object = Record<string, unknown>> {
|
|
121
|
+
getState(): Readonly<BitState<T>>;
|
|
122
|
+
subscribeFormMeta(listener: (meta: BitFormMeta) => void): () => void;
|
|
123
|
+
}
|
|
124
|
+
interface BitStoreSelectorBindingApi<T extends object = Record<string, unknown>> {
|
|
125
|
+
subscribe(listener: () => void): () => void;
|
|
126
|
+
subscribePath<P extends BitPath<T>>(path: P, listener: (value: BitPathValue<T, P>) => void, options?: BitScopedSelectorSubscriptionOptions<BitPathValue<T, P>>): () => void;
|
|
127
|
+
subscribeSelector<TSlice>(selector: BitSelector<T, TSlice>, listener: (slice: TSlice) => void, options: BitSelectorSubscriptionOptions<TSlice>): () => void;
|
|
128
|
+
}
|
|
129
|
+
interface BitFieldBindingApi<T extends object = Record<string, unknown>> {
|
|
130
|
+
getFieldState<P extends BitPath<T>>(path: P): Readonly<BitFieldState<T, BitPathValue<T, P>>>;
|
|
131
|
+
subscribeFieldState<P extends BitPath<T>>(path: P, listener: (state: Readonly<BitFieldState<T, BitPathValue<T, P>>>) => void): () => void;
|
|
132
|
+
setField<P extends BitPath<T>>(path: P, value: BitPathValue<T, P>): void;
|
|
133
|
+
blurField<P extends BitPath<T>>(path: P): void;
|
|
134
|
+
resolveMask(path: string): BitMask | undefined;
|
|
135
|
+
unregisterField(path: string): void;
|
|
136
|
+
}
|
|
137
|
+
interface BitStoreFeatureApi<T extends object = Record<string, unknown>> extends BitStoreLifecycleApi, BitStorePersistFeatureApi, BitStoreRegistrationFeatureApi<T>, BitStoreArrayFeatureApi<T>, BitStoreHistoryFeatureApi {
|
|
138
|
+
hasValidationsInProgress(scopeFields?: string[]): boolean;
|
|
139
|
+
resolveMask(path: string): BitMask | undefined;
|
|
140
|
+
createArrayItemId(path: string, index?: number): string;
|
|
141
|
+
}
|
|
142
|
+
interface BitStoreReadSliceApi<T extends object = Record<string, unknown>> extends BitStoreIdentityApi<T>, BitStoreStateFlagsApi, BitFormReadApi<T> {
|
|
143
|
+
}
|
|
144
|
+
interface BitStoreObserveSliceApi<T extends object = Record<string, unknown>> extends BitFormObserveApi<T>, BitFormMetaBindingApi<T>, BitStoreSelectorBindingApi<T>, Pick<BitFieldBindingApi<T>, "subscribeFieldState"> {
|
|
145
|
+
}
|
|
146
|
+
interface BitStoreWriteSliceApi<T extends object = Record<string, unknown>> extends BitFormWriteApi<T> {
|
|
147
|
+
}
|
|
148
|
+
interface BitStoreNamespacesApi<T extends object = Record<string, unknown>> {
|
|
149
|
+
readonly read: BitStoreReadSliceApi<T>;
|
|
150
|
+
readonly observe: BitStoreObserveSliceApi<T>;
|
|
151
|
+
readonly write: BitStoreWriteSliceApi<T>;
|
|
152
|
+
readonly feature: BitStoreFeatureApi<T>;
|
|
153
|
+
}
|
|
154
|
+
interface BitStoreApi<T extends object = Record<string, unknown>> extends BitStoreNamespacesApi<T> {
|
|
155
|
+
}
|
|
156
|
+
interface BitStoreHooksApi<T extends object = Record<string, unknown>> extends BitStoreApi<T> {
|
|
157
|
+
}
|
|
158
|
+
interface BitFrameworkStoreApi<T extends object = Record<string, unknown>> extends BitStoreApi<T> {
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type { BitEqualityFn as B, BitFrameworkConfig as a, BitFrameworkStoreApi as b, BitSelector as c, BitSelectorSubscriptionOptions as d, BitStoreApi as e, BitStoreHooksApi as f, BitStoreFeatureApi as g, BitStoreObserveSliceApi as h, BitStoreReadSliceApi as i, BitStoreWriteSliceApi as j };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { G as BitState, j as BitConfig, N as ValidatorFn, o as BitFieldDefinition, M as DevToolsOptions, O as BitPersistResolvedConfig, P as BitIdFactory, A as BitPlugin, F as BitScheduler, r as BitFormGlobal, u as BitPath, p as BitFieldState, v as BitPathValue, x as BitPersistMetadata, S as ScopeStatus, L as DeepPartial, k as BitErrors, H as BitSubmitResult, c as BitArrayPath, b as BitArrayItem } from './types-CG5nYeRk.js';
|
|
2
|
+
import { B as BitMask } from './types-D8DgIUhJ.js';
|
|
3
|
+
import { a as BitHistoryMetadata, B as BitFormMeta, b as BitValidationOptions } from './meta-types-Bzmm21TP.js';
|
|
4
|
+
|
|
5
|
+
type BitSelector<T extends object, TSlice> = (state: Readonly<BitState<T>>) => TSlice;
|
|
6
|
+
type BitEqualityFn<TValue> = (previous: TValue, next: TValue) => boolean;
|
|
7
|
+
interface BitScopedSelectorSubscriptionOptions<TValue> {
|
|
8
|
+
mode?: "scoped";
|
|
9
|
+
paths: string[];
|
|
10
|
+
equalityFn?: BitEqualityFn<TValue>;
|
|
11
|
+
emitImmediately?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface BitTrackedSelectorSubscriptionOptions<TValue> {
|
|
14
|
+
mode: "tracked";
|
|
15
|
+
equalityFn?: BitEqualityFn<TValue>;
|
|
16
|
+
emitImmediately?: boolean;
|
|
17
|
+
}
|
|
18
|
+
type BitSelectorSubscriptionOptions<TValue> = BitScopedSelectorSubscriptionOptions<TValue> | BitTrackedSelectorSubscriptionOptions<TValue>;
|
|
19
|
+
|
|
20
|
+
interface BitValidationTriggerOptions {
|
|
21
|
+
forceDebounce?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface BitStoreIdentityApi<T extends object = Record<string, unknown>> {
|
|
25
|
+
readonly storeId: string;
|
|
26
|
+
readonly config: Readonly<BitFrameworkConfig<T>>;
|
|
27
|
+
}
|
|
28
|
+
interface BitFrameworkConfig<T extends object = Record<string, unknown>> extends BitConfig<T> {
|
|
29
|
+
initialValues: T;
|
|
30
|
+
resolver?: ValidatorFn<T>;
|
|
31
|
+
validationDelay: number;
|
|
32
|
+
history: {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
limit: number;
|
|
35
|
+
};
|
|
36
|
+
masks?: Record<string, BitMask>;
|
|
37
|
+
fields?: Record<string, BitFieldDefinition<T>>;
|
|
38
|
+
devTools?: boolean | DevToolsOptions;
|
|
39
|
+
persist: BitPersistResolvedConfig<T>;
|
|
40
|
+
idFactory: BitIdFactory;
|
|
41
|
+
plugins: BitPlugin<T>[];
|
|
42
|
+
scheduler?: BitScheduler;
|
|
43
|
+
subscriptionCacheSize?: number;
|
|
44
|
+
bus?: BitFormGlobal;
|
|
45
|
+
onUnhandledError: (error: unknown, source: "submit" | "validation" | "persist") => void;
|
|
46
|
+
}
|
|
47
|
+
interface BitFormReadApi<T extends object = Record<string, unknown>> {
|
|
48
|
+
getState(): Readonly<BitState<T>>;
|
|
49
|
+
getFieldConfig(path: string): BitFieldDefinition<T> | undefined;
|
|
50
|
+
getFieldState<P extends BitPath<T>>(path: P): Readonly<BitFieldState<T, BitPathValue<T, P>>>;
|
|
51
|
+
isHidden<P extends BitPath<T>>(path: P): boolean;
|
|
52
|
+
isRequired<P extends BitPath<T>>(path: P): boolean;
|
|
53
|
+
isFieldDirty(path: string): boolean;
|
|
54
|
+
isFieldValidating(path: string): boolean;
|
|
55
|
+
getDirtyValues(): Partial<T>;
|
|
56
|
+
getPersistMetadata(): BitPersistMetadata;
|
|
57
|
+
getHistoryMetadata(): BitHistoryMetadata;
|
|
58
|
+
getScopeStatus(scopeName: string): ScopeStatus;
|
|
59
|
+
getScopeErrors(scopeName: string): Record<string, string>;
|
|
60
|
+
getScopeFields(scopeName: string): string[];
|
|
61
|
+
}
|
|
62
|
+
interface BitFormObserveApi<T extends object = Record<string, unknown>> {
|
|
63
|
+
subscribe(listener: () => void): () => void;
|
|
64
|
+
subscribePersistMeta(listener: (meta: BitPersistMetadata) => void): () => void;
|
|
65
|
+
subscribeHistoryMeta(listener: (meta: BitHistoryMetadata) => void): () => void;
|
|
66
|
+
subscribeScopeStatus(scopeName: string, listener: (status: ScopeStatus) => void): () => void;
|
|
67
|
+
}
|
|
68
|
+
interface BitFormWriteApi<T extends object = Record<string, unknown>> {
|
|
69
|
+
setField<P extends BitPath<T>>(path: P, value: BitPathValue<T, P>): void;
|
|
70
|
+
blurField<P extends BitPath<T>>(path: P): void;
|
|
71
|
+
markFieldsTouched(paths: string[]): void;
|
|
72
|
+
setValues(values: T | DeepPartial<T>, options?: {
|
|
73
|
+
partial?: boolean;
|
|
74
|
+
rebase?: boolean;
|
|
75
|
+
}): void;
|
|
76
|
+
setError(path: string, message: string | undefined): void;
|
|
77
|
+
setErrors(errors: BitErrors<T>): void;
|
|
78
|
+
setServerErrors(serverErrors: Record<string, string[] | string>): void;
|
|
79
|
+
validate(options?: BitValidationOptions): Promise<boolean>;
|
|
80
|
+
triggerValidation(scopeFields?: string[], options?: BitValidationTriggerOptions): void;
|
|
81
|
+
reset(): void;
|
|
82
|
+
transaction<TResult>(callback: () => TResult): TResult;
|
|
83
|
+
submit(onSuccess: (values: T, dirtyValues?: Partial<T>) => void | Promise<void>): Promise<BitSubmitResult>;
|
|
84
|
+
}
|
|
85
|
+
interface BitStoreLifecycleApi {
|
|
86
|
+
cleanup(): void;
|
|
87
|
+
}
|
|
88
|
+
interface BitStorePersistFeatureApi {
|
|
89
|
+
getPersistMetadata(): BitPersistMetadata;
|
|
90
|
+
restorePersisted(): Promise<boolean>;
|
|
91
|
+
forceSave(): Promise<void>;
|
|
92
|
+
clearPersisted(): Promise<void>;
|
|
93
|
+
}
|
|
94
|
+
interface BitStoreRegistrationFeatureApi<T extends object = Record<string, unknown>> {
|
|
95
|
+
registerField(path: string, config: BitFieldDefinition<T>): void;
|
|
96
|
+
unregisterField(path: string): void;
|
|
97
|
+
unregisterPrefix(prefix: string): void;
|
|
98
|
+
}
|
|
99
|
+
interface BitStoreArrayFeatureApi<T extends object = Record<string, unknown>> {
|
|
100
|
+
pushItem<P extends BitArrayPath<T>>(path: P, value: BitArrayItem<BitPathValue<T, P>>): void;
|
|
101
|
+
prependItem<P extends BitArrayPath<T>>(path: P, value: BitArrayItem<BitPathValue<T, P>>): void;
|
|
102
|
+
insertItem<P extends BitArrayPath<T>>(path: P, index: number, value: BitArrayItem<BitPathValue<T, P>>): void;
|
|
103
|
+
removeItem<P extends BitArrayPath<T>>(path: P, index: number): void;
|
|
104
|
+
moveItem<P extends BitArrayPath<T>>(path: P, from: number, to: number): void;
|
|
105
|
+
swapItems<P extends BitArrayPath<T>>(path: P, indexA: number, indexB: number): void;
|
|
106
|
+
replaceItems<P extends BitArrayPath<T>>(path: P, items: BitArrayItem<BitPathValue<T, P>>[]): void;
|
|
107
|
+
clearItems<P extends BitArrayPath<T>>(path: P): void;
|
|
108
|
+
}
|
|
109
|
+
interface BitStoreHistoryFeatureApi {
|
|
110
|
+
readonly canUndo: boolean;
|
|
111
|
+
readonly canRedo: boolean;
|
|
112
|
+
undo(): void;
|
|
113
|
+
redo(): void;
|
|
114
|
+
}
|
|
115
|
+
interface BitStoreStateFlagsApi {
|
|
116
|
+
readonly isValid: boolean;
|
|
117
|
+
readonly isSubmitting: boolean;
|
|
118
|
+
readonly isDirty: boolean;
|
|
119
|
+
}
|
|
120
|
+
interface BitFormMetaBindingApi<T extends object = Record<string, unknown>> {
|
|
121
|
+
getState(): Readonly<BitState<T>>;
|
|
122
|
+
subscribeFormMeta(listener: (meta: BitFormMeta) => void): () => void;
|
|
123
|
+
}
|
|
124
|
+
interface BitStoreSelectorBindingApi<T extends object = Record<string, unknown>> {
|
|
125
|
+
subscribe(listener: () => void): () => void;
|
|
126
|
+
subscribePath<P extends BitPath<T>>(path: P, listener: (value: BitPathValue<T, P>) => void, options?: BitScopedSelectorSubscriptionOptions<BitPathValue<T, P>>): () => void;
|
|
127
|
+
subscribeSelector<TSlice>(selector: BitSelector<T, TSlice>, listener: (slice: TSlice) => void, options: BitSelectorSubscriptionOptions<TSlice>): () => void;
|
|
128
|
+
}
|
|
129
|
+
interface BitFieldBindingApi<T extends object = Record<string, unknown>> {
|
|
130
|
+
getFieldState<P extends BitPath<T>>(path: P): Readonly<BitFieldState<T, BitPathValue<T, P>>>;
|
|
131
|
+
subscribeFieldState<P extends BitPath<T>>(path: P, listener: (state: Readonly<BitFieldState<T, BitPathValue<T, P>>>) => void): () => void;
|
|
132
|
+
setField<P extends BitPath<T>>(path: P, value: BitPathValue<T, P>): void;
|
|
133
|
+
blurField<P extends BitPath<T>>(path: P): void;
|
|
134
|
+
resolveMask(path: string): BitMask | undefined;
|
|
135
|
+
unregisterField(path: string): void;
|
|
136
|
+
}
|
|
137
|
+
interface BitStoreFeatureApi<T extends object = Record<string, unknown>> extends BitStoreLifecycleApi, BitStorePersistFeatureApi, BitStoreRegistrationFeatureApi<T>, BitStoreArrayFeatureApi<T>, BitStoreHistoryFeatureApi {
|
|
138
|
+
hasValidationsInProgress(scopeFields?: string[]): boolean;
|
|
139
|
+
resolveMask(path: string): BitMask | undefined;
|
|
140
|
+
createArrayItemId(path: string, index?: number): string;
|
|
141
|
+
}
|
|
142
|
+
interface BitStoreReadSliceApi<T extends object = Record<string, unknown>> extends BitStoreIdentityApi<T>, BitStoreStateFlagsApi, BitFormReadApi<T> {
|
|
143
|
+
}
|
|
144
|
+
interface BitStoreObserveSliceApi<T extends object = Record<string, unknown>> extends BitFormObserveApi<T>, BitFormMetaBindingApi<T>, BitStoreSelectorBindingApi<T>, Pick<BitFieldBindingApi<T>, "subscribeFieldState"> {
|
|
145
|
+
}
|
|
146
|
+
interface BitStoreWriteSliceApi<T extends object = Record<string, unknown>> extends BitFormWriteApi<T> {
|
|
147
|
+
}
|
|
148
|
+
interface BitStoreNamespacesApi<T extends object = Record<string, unknown>> {
|
|
149
|
+
readonly read: BitStoreReadSliceApi<T>;
|
|
150
|
+
readonly observe: BitStoreObserveSliceApi<T>;
|
|
151
|
+
readonly write: BitStoreWriteSliceApi<T>;
|
|
152
|
+
readonly feature: BitStoreFeatureApi<T>;
|
|
153
|
+
}
|
|
154
|
+
interface BitStoreApi<T extends object = Record<string, unknown>> extends BitStoreNamespacesApi<T> {
|
|
155
|
+
}
|
|
156
|
+
interface BitStoreHooksApi<T extends object = Record<string, unknown>> extends BitStoreApi<T> {
|
|
157
|
+
}
|
|
158
|
+
interface BitFrameworkStoreApi<T extends object = Record<string, unknown>> extends BitStoreApi<T> {
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type { BitEqualityFn as B, BitFrameworkConfig as a, BitFrameworkStoreApi as b, BitSelector as c, BitSelectorSubscriptionOptions as d, BitStoreApi as e, BitStoreHooksApi as f, BitStoreFeatureApi as g, BitStoreObserveSliceApi as h, BitStoreReadSliceApi as i, BitStoreWriteSliceApi as j };
|