import { Action, ActionState } from "@/types";
export interface UseActionOptions {
    onSuccess?: (state: ActionState & {
        success: true;
    }) => void | Promise<void>;
    onError?: (state: ActionState & {
        success: false;
    }) => void | Promise<void>;
}
export declare function useAction<T = unknown>(action: Action<T>, options?: UseActionOptions): {
    dispatch: (data?: T) => void;
    state: ActionState | undefined;
    isPending: boolean;
};
//# sourceMappingURL=index.d.ts.map