import type { Draft } from 'immer'; import type { StateCreator, StoreMutatorIdentifier } from '../vanilla.mjs'; type Immer = (initializer: StateCreator) => StateCreator; declare module '../vanilla.mjs' { interface StoreMutators { ['zustand/immer']: WithImmer; } } type Write = Omit & U; type SkipTwo = T extends { length: 0; } ? [] : T extends { length: 1; } ? [] : T extends { length: 0 | 1; } ? [] : T extends [unknown, unknown, ...infer A] ? A : T extends [unknown, unknown?, ...infer A] ? A : T extends [unknown?, unknown?, ...infer A] ? A : never; type WithImmer = Write>; type StoreImmer = S extends { getState: () => infer T; setState: infer SetState; } ? SetState extends (...a: infer A) => infer Sr ? { setState(nextStateOrUpdater: T | Partial | ((state: Draft) => void), shouldReplace?: boolean | undefined, ...a: SkipTwo): Sr; } : never : never; export declare const immer: Immer; export {};