import type { ActionState, FieldErrors } from "../types";
export type SafeActionType<TInput, TOutput> = (data: TInput) => Promise<ActionState<TInput, TOutput>>;
export type UseActionOptions<TOutput> = {
    retries?: number;
    onStart?: () => void;
    onSuccess?: (data?: TOutput) => void;
    onError?: (error: string) => void;
    onComplete?: () => void;
    toastMessages?: {
        loading: string;
        success: string;
    };
};
export declare const useSafeAction: <TInput, TOutput>(serverAction: SafeActionType<TInput, TOutput>, options?: UseActionOptions<TOutput>) => {
    clientAction: (input: TInput) => Promise<void>;
    abortAction: () => void | undefined;
    error: string | undefined;
    data: TOutput | undefined;
    isPending: boolean;
    fieldErrors: FieldErrors<TInput> | undefined;
    setFieldErrors: import("react").Dispatch<import("react").SetStateAction<FieldErrors<TInput> | undefined>>;
};
