UNPKG

react-native-shared-state

Version:

Create shared states that can be connected to multiple react native components, allowing for simple global state management.

28 lines (27 loc) 926 B
export declare type Element = { [key: string]: any; }; export declare type State = { [key: string]: any; }; export declare type Map<E extends Element> = { [key: string]: E; }; export declare type StorageOptions = { encryptionKey?: string; replacer?: (key: string, value: any) => any; reviver?: (key: string, value: any) => any; saveOnBackground?: boolean; storeName: string; }; export declare type UpdateKey<State> = keyof State; export declare type UpdateKeys<State> = UpdateKey<State> | UpdateKey<State>[]; export declare type OrganiseFunction<E extends Element> = { filter?: (element: E) => boolean; sort?: (a: E, b: E) => number; }; export declare type OrganiserName = string; export declare type OrganiseFunctions<E extends Element, O extends OrganiserName> = { [Key in O]: OrganiseFunction<E>; }; export declare type LazyGetFunction<D> = (page: number) => D[] | Promise<D[]>;