cogsbox-state 0.5.147 → 0.5.148

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.
@@ -1,6 +1,5 @@
1
1
  import { GenericObject } from './utility.js';
2
- import { UseMutationResult } from '@tanstack/react-query';
3
- import { ZodArray, ZodObject, ZodRawShape } from 'zod';
2
+ import { z } from 'zod';
4
3
  import { ComponentsType } from './store.js';
5
4
 
6
5
  type Prettify<T> = {
@@ -60,6 +59,7 @@ export type ArrayEndType<TShape extends unknown> = {
60
59
  uniqueInsert: (payload: UpdateArg<InferArrayElement<TShape>>, fields?: (keyof InferArrayElement<TShape>)[], onMatch?: (existingItem: any) => any) => void;
61
60
  stateFilter: (callbackfn: (value: InferArrayElement<TShape>, index: number) => void) => ArrayEndType<TShape>;
62
61
  getSelected: () => StateObject<InferArrayElement<TShape>> | undefined;
62
+ clearSelected: () => void;
63
63
  getSelectedIndex: () => number;
64
64
  last: () => StateObject<InferArrayElement<TShape>> | undefined;
65
65
  } & EndType<TShape> & {
@@ -177,7 +177,7 @@ export type CogsCookiesType<T extends string[] = string[]> = CookieType<ArrayToO
177
177
  export type ReactivityType = "none" | "component" | "deps" | "all";
178
178
  type ValidationOptionsType = {
179
179
  key?: string;
180
- zodSchema?: ZodObject<ZodRawShape> | ZodArray<ZodObject<ZodRawShape>>;
180
+ zodSchema?: z.ZodTypeAny;
181
181
  onBlur?: boolean;
182
182
  };
183
183
  export type OptionsType<T extends unknown = unknown> = {
@@ -225,7 +225,6 @@ export type ServerSyncType<T> = {
225
225
  state: T;
226
226
  }) => void;
227
227
  debounce?: number;
228
- mutation: UseMutationResult<any, unknown, any, unknown>;
229
228
  snapshot?: {
230
229
  name: (({ state }: {
231
230
  state: T;