import { type Patch, type Producer } from "immer"; export type PatchHandler = (patches: Patch[]) => void; export type PatchHandlerWithVersion = (patches: Patch[], version: number) => void; export declare class PatchedStateManager { private _state; private _patchHandlers; constructor(initialState?: TState); /** * Subscribe to state patches/updates. * @param handler - Function called with an array of state patches * @returns Unsubscribe function */ onPatch(handler: PatchHandler): () => void; /** * Update the state using an Immer producer function. * Notifies all subscribed patch handlers with the generated patches. * @param producer - Immer producer function to modify the state * @returns The updated state */ updateState(producer: Producer): Readonly; get state(): Readonly; } export type { Patch } from "immer"; //# sourceMappingURL=state-patcher.d.ts.map