Viewing File: /home/ubuntu/misabloom-frontend-base/node_modules/zustand/react.d.ts

import type { Mutate, StateCreator, StoreApi, StoreMutatorIdentifier } from './vanilla';
declare type ExtractState<S> = S extends {
    getState: () => infer T;
} ? T : never;
declare type WithReact<S extends StoreApi<unknown>> = S & {
    getServerState?: () => ExtractState<S>;
};
export declare function useStore<S extends WithReact<StoreApi<unknown>>>(api: S): ExtractState<S>;
export declare function useStore<S extends WithReact<StoreApi<unknown>>, U>(api: S, selector: (state: ExtractState<S>) => U, equalityFn?: (a: U, b: U) => boolean): U;
export declare type UseBoundStore<S extends WithReact<StoreApi<unknown>>> = {
    (): ExtractState<S>;
    <U>(selector: (state: ExtractState<S>) => U, equals?: (a: U, b: U) => boolean): U;
} & S;
declare type Create = {
    <T, Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>): UseBoundStore<Mutate<StoreApi<T>, Mos>>;
    <T>(): <Mos extends [StoreMutatorIdentifier, unknown][] = []>(initializer: StateCreator<T, [], Mos>) => UseBoundStore<Mutate<StoreApi<T>, Mos>>;
    <S extends StoreApi<unknown>>(store: S): UseBoundStore<S>;
};
declare const create: Create;
export default create;
Back to Directory File Manager