UNPKG

state-management-utilities

Version:
18 lines (17 loc) 1.04 kB
import type { TypeStateManagerConfigs } from "../state-manager"; import { StateManagerStore, StateManagerStoreConfigs } from "../store"; import { ReactStateManager } from "./state-manager"; export declare class ReactStateManagerStore<DataType extends Record<string, any>> extends StateManagerStore<DataType, { [Key in keyof Required<DataType>]: ReactStateManager<DataType[Key]>; }> { protected _initializeEntity<Key extends keyof DataType>(initialValue: DataType[Key], config: TypeStateManagerConfigs<DataType[Key]>): ReactStateManager<DataType[Key]>; protected _hooks: Readonly<{ useState: () => [state: DataType, setState: (newValue: DataType) => void]; }>; get hooks(): Readonly<{ useState: () => [state: DataType, setState: (newValue: DataType) => void]; }>; } export declare function store<DataType extends Record<string, any>>(initialValues: { [Key in keyof Required<DataType>]: DataType[Key]; }, uid?: string, config?: StateManagerStoreConfigs<DataType>): ReactStateManagerStore<DataType>;