cogsbox-state 0.5.12 → 0.5.13
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/CogsState.d.ts +3 -6
- package/dist/CogsState.jsx +318 -307
- package/dist/CogsState.jsx.map +1 -1
- package/dist/index.js +19 -18
- package/dist/utility.js.map +1 -1
- package/package.json +1 -2
package/dist/CogsState.d.ts
CHANGED
|
@@ -253,10 +253,6 @@ export type InitialStateInnerType<T extends unknown = unknown> = {
|
|
|
253
253
|
export type InitialStateType<T> = {
|
|
254
254
|
[key: string]: InitialStateInnerType<T>;
|
|
255
255
|
};
|
|
256
|
-
export type FunctionsToPassDownType = {
|
|
257
|
-
getValidationErrors: (pathArray: string) => string[];
|
|
258
|
-
removeValidationError: (path: string) => void;
|
|
259
|
-
};
|
|
260
256
|
export type AllStateTypes<T extends unknown> = Record<string, T>;
|
|
261
257
|
export type CogsInitialState<T> = {
|
|
262
258
|
initialState: T;
|
|
@@ -265,8 +261,9 @@ export type CogsInitialState<T> = {
|
|
|
265
261
|
export type TransformedStateType<T> = {
|
|
266
262
|
[P in keyof T]: T[P] extends CogsInitialState<infer U> ? U : T[P];
|
|
267
263
|
};
|
|
268
|
-
export declare
|
|
269
|
-
|
|
264
|
+
export declare function addStateOptions<T extends unknown>(initialState: T, { formElements }: OptionsType<T>): T;
|
|
265
|
+
export declare const createCogsState: <State extends Record<string, unknown>>(initialState: State, opt?: {
|
|
266
|
+
formElements?: FormsElementsType;
|
|
270
267
|
}) => {
|
|
271
268
|
useCogsState: <StateKey extends keyof State>(stateKey: StateKey, options?: OptionsType<TransformedStateType<State>[StateKey]>) => StateObject<TransformedStateType<State>[StateKey]>;
|
|
272
269
|
setCogsOptions: <StateKey extends keyof State>(stateKey: StateKey, options: OptionsType<TransformedStateType<State>[StateKey]>) => void;
|