import { Draft } from 'immer'; import { StateCreator, StoreMutatorIdentifier } from '../vanilla'; type Immer = (initializer: StateCreator) => StateCreator; declare module '../vanilla' { interface StoreMutators { ['zustand/immer']: WithImmer; } } type Write = Pick> & 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 {};