UNPKG

state-management-utilities

Version:
28 lines (27 loc) 1.28 kB
import type { HydratedEntry } from "./center"; import type { TypeStateManagerConfigs } from "./state-manager"; import { StateManager } from "./state-manager"; export declare class StateManagerStore<DataType extends Record<string, any>, Entities extends { [Key in keyof Required<DataType>]: StateManager<DataType[Key]>; }> { protected readonly _uid: string; protected readonly _config: StateManagerStoreConfigs<DataType>; protected _initialValues: { [Key in keyof Required<DataType>]: DataType[Key]; }; protected _KEYS: (keyof DataType)[]; protected _initializeEntity<Key extends keyof DataType>(initialValue: DataType[Key], config: TypeStateManagerConfigs<DataType[Key]>): any; readonly entities: Entities; constructor(initialValues: { [Key in keyof Required<DataType>]: DataType[Key]; }, _uid?: string, _config?: StateManagerStoreConfigs<DataType>); set value(value: DataType); get value(): DataType; reset(): void; get initialValues(): { [Key in keyof Required<DataType>]: DataType[Key]; }; fulfill(): Promise<this>; hydrate(value: DataType): HydratedEntry; } export type StateManagerStoreConfigs<DataType> = { [Key in keyof DataType]?: Omit<TypeStateManagerConfigs<DataType[Key]>, "uid">; };