mt-flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
32 lines (31 loc) • 1.67 kB
TypeScript
import React from 'react';
import { StateCreator } from 'zustand';
import { DashConfig } from '../validations/dash';
export interface DashInitState {
}
export interface DashSlice<T = any> extends DashInitState {
isOpenNavSheet?: boolean;
isLoadingDashConfig: boolean;
dashConfig?: DashConfig;
loadDashConfig: () => Promise<void>;
setOpenNavSheet: (arg: boolean) => void;
}
type DashSliceType = ReturnType<typeof createDashSlice>;
export declare const createDashSlice: StateCreator<DashSlice, [], [], DashSlice>;
export type DashStoreType = ReturnType<typeof createDashStore>;
export declare const createDashStore: (initProps?: Partial<DashInitState>) => import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<DashSlice<any>>, "persist"> & {
persist: {
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<DashSlice<any>, DashSlice<any>>>) => void;
clearStorage: () => void;
rehydrate: () => void | Promise<void>;
hasHydrated: () => boolean;
onHydrate: (fn: (state: DashSlice<any>) => void) => () => void;
onFinishHydration: (fn: (state: DashSlice<any>) => void) => () => void;
getOptions: () => Partial<import("zustand/middleware").PersistOptions<DashSlice<any>, DashSlice<any>>>;
};
}>;
type DashProviderProps = React.PropsWithChildren<Partial<DashInitState>>;
export declare function DashProvider({ children, ...props }: DashProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useDashStore<T>(): ReturnType<typeof createDashStore>;
export declare function useDashStore<T>(selector: (state: DashSliceType) => T): T;
export {};