Viewing File: /home/ubuntu/route-and-root-frontend-base/node_modules/zustand/context.d.ts
import type { ReactNode } from 'react';
import type { StoreApi } from 'zustand';
declare type UseContextStore<S extends StoreApi<unknown>> = {
(): ExtractState<S>;
<U>(selector: (state: ExtractState<S>) => U, equalityFn?: (a: U, b: U) => boolean): U;
};
declare type ExtractState<S> = S extends {
getState: () => infer T;
} ? T : never;
declare type WithoutCallSignature<T> = {
[K in keyof T]: T[K];
};
declare function createContext<S extends StoreApi<unknown>>(): {
Provider: ({ createStore, children, }: {
createStore: () => S;
children: ReactNode;
}) => import("react").FunctionComponentElement<import("react").ProviderProps<S | undefined>>;
useStore: UseContextStore<S>;
useStoreApi: () => WithoutCallSignature<S>;
};
export default createContext;
Back to Directory
File Manager