import { Action } from '@judo/actions'; import { ReactNode } from 'react'; /** * Dispatch function type for actions. */ export type DispatchFn = (action: Action) => Promise; /** * Dispatch context type. */ export interface DispatchContextType { /** Dispatch an action */ dispatch: DispatchFn; } /** * Hook to access dispatch context. * * @returns DispatchContextType * @throws Error if used outside DispatchProvider */ export declare function useDispatch(): DispatchContextType; /** * Hook to access dispatch context (optional). * * @returns DispatchContextType | null */ export declare function useDispatchOptional(): DispatchContextType | null; /** * Props for DispatchProvider. */ export interface DispatchProviderProps { children: ReactNode; dispatch: DispatchFn; } /** * Provider for dispatch context. * Provides the dispatch function to all child components. */ export declare function DispatchProvider({ children, dispatch }: DispatchProviderProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=dispatch-context.d.ts.map