UNPKG

state-management-utilities

Version:
18 lines (17 loc) 1.01 kB
import type { TypeStateManagerConfigs } from "../state-manager"; import { StoreManager, StoreManagerConfigs } from "../store"; import { ReactStateManager } from "./state-manager"; export declare class ReactStoreManager<DataType extends Record<string, any>> extends StoreManager<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?: StoreManagerConfigs<DataType>): ReactStoreManager<DataType>;