/**
 * Auto-save configuration
 */
export type AutoSaveConfig = boolean | {
    enabled: true;
    debounceMs?: number;
    onSaveStart?: () => void;
    onSaveSuccess?: () => void;
    onSaveError?: (error: any) => void;
};
/**
 * Options for useAutoSave hook
 */
export interface UseAutoSaveOptions<T> {
    /**
     * The data to auto-save
     */
    data: T;
    /**
     * Auto-save configuration
     */
    autoSave?: AutoSaveConfig;
    /**
     * Function to call to save the data
     */
    onSave?: (data: T) => void | Promise<void>;
    /**
     * Optional identifier to track when a completely new dataset is loaded
     * When this changes, the lastSaved state will be reset
     */
    dataId?: string | number;
}
/**
 * Return type for useAutoSave hook
 */
export interface UseAutoSaveReturn {
    isSaving: boolean;
    lastSaved: Date | null;
    saveError: Error | null;
}
/**
 * @name useAutoSave
 * @description Hook to automatically save data after a debounce period
 * @param options Configuration options
 * @returns Object with saving state, last saved time, and error state
 * @example
 * const { isSaving, lastSaved, saveError } = useAutoSave({
 *   data: formData,
 *   autoSave: true,
 *   onSave: async (data) => await saveToServer(data)
 * });
 *
 * @example
 * const { isSaving, lastSaved, saveError } = useAutoSave({
 *   data: formData,
 *   autoSave: {
 *     enabled: true,
 *     debounceMs: 3000,
 *     onSaveStart: () => console.log('Saving...'),
 *     onSaveSuccess: () => console.log('Saved!'),
 *     onSaveError: (error) => console.error('Save failed', error)
 *   },
 *   onSave: async (data) => await saveToServer(data)
 * });
 */
export declare function useAutoSave<T>({ data, autoSave, onSave, dataId, }: UseAutoSaveOptions<T>): UseAutoSaveReturn;
//# sourceMappingURL=use-auto-save.d.ts.map