UNPKG

react-smart-state

Version:

Next generation local and global state management

30 lines (29 loc) 1.26 kB
import { StateKeyTypeGenerator } from "./types"; import { CustomError } from "./objects"; export declare const reactEffect: any; export declare const reactRef: any; export declare const reactState: any; export declare function updater(): { value: any; refresh: () => void; }; export declare function SmartStateError(err: unknown, extraInfo?: { code?: string; details?: any; }): CustomError; export declare const clone: (o: any) => any; export declare const isSame: (a: any, b: any) => boolean; export declare const newId: (inc?: string) => string; export declare function isPromise(obj: any): obj is Promise<any>; export declare const sleep: (ms: number) => Promise<unknown>; export declare function getItem(item: any): any; export declare function refCondition<T>(fn: () => T): { value: T; setValue: (value: T) => T; }; export declare const toObject: (nested?: boolean, ...keys: string[]) => StateKeyTypeGenerator; export declare function getPrototypeChain(obj: any): any[]; export declare const keys: (item: any, prototype: any) => string[]; export declare const getValueByPath: (value: any, path: string) => any; export declare const isArray: (item: any) => boolean; export declare const valid: (item: any, validArray?: boolean) => any;