type SetStateInternal = { _(partial: T | Partial | { _(state: T): T | Partial; }['_'], replace?: boolean | undefined): void; }['_']; export interface StoreApi { setState: SetStateInternal; getState: () => T; subscribe: (listener: (state: T, prevState: T) => void) => () => void; /** * @deprecated Use `unsubscribe` returned by `subscribe` */ destroy: () => void; } type Get = K extends keyof T ? T[K] : F; export type Mutate = number extends Ms['length' & keyof Ms] ? S : Ms extends [] ? S : Ms extends [[infer Mi, infer Ma], ...infer Mrs] ? Mutate[Mi & StoreMutatorIdentifier], Mrs> : never; export type StateCreator = ((setState: Get, Mis>, 'setState', never>, getState: Get, Mis>, 'getState', never>, store: Mutate, Mis>) => U) & { $$storeMutators?: Mos; }; export interface StoreMutators { } export type StoreMutatorIdentifier = keyof StoreMutators; type CreateStore = { (initializer: StateCreator): Mutate, Mos>; (): (initializer: StateCreator) => Mutate, Mos>; }; export declare const createStore: CreateStore; /** * @deprecated Use `import { createStore } from 'zustand/vanilla'` */ declare const _default: CreateStore; export default _default; /** * @deprecated Use `unknown` instead of `State` */ export type State = unknown; /** * @deprecated Use `Partial | ((s: T) => Partial)` instead of `PartialState` */ export type PartialState = Partial | ((state: T) => Partial); /** * @deprecated Use `(s: T) => U` instead of `StateSelector` */ export type StateSelector = (state: T) => U; /** * @deprecated Use `(a: T, b: T) => boolean` instead of `EqualityChecker` */ export type EqualityChecker = (state: T, newState: T) => boolean; /** * @deprecated Use `(state: T, previousState: T) => void` instead of `StateListener` */ export type StateListener = (state: T, previousState: T) => void; /** * @deprecated Use `(slice: T, previousSlice: T) => void` instead of `StateSliceListener`. */ export type StateSliceListener = (slice: T, previousSlice: T) => void; /** * @deprecated Use `(listener: (state: T) => void) => void` instead of `Subscribe`. */ export type Subscribe = { (listener: (state: T, previousState: T) => void): () => void; }; /** * @deprecated You might be looking for `StateCreator`, if not then * use `StoreApi['setState']` instead of `SetState`. */ export type SetState = { _(partial: T | Partial | { _(state: T): T | Partial; }['_'], replace?: boolean | undefined): void; }['_']; /** * @deprecated You might be looking for `StateCreator`, if not then * use `StoreApi['getState']` instead of `GetState`. */ export type GetState = () => T; /** * @deprecated Use `StoreApi['destroy']` instead of `Destroy`. */ export type Destroy = () => void;