import { ICompleteForm, MetaData } from '@mesalvo/ts-definitions';
import { default as React } from 'react';
import { AutoSaveConfig } from '../../hooks';
import { FormContextProps } from './types';
/**
 * Base props shared by all DynamicForm configurations
 */
interface BaseDynamicFormProps<M extends MetaData = MetaData> extends FormContextProps<M> {
    form: ICompleteForm;
    onEdit?: () => void;
    hideTitle?: boolean;
    renderActions?: (context: {
        isEditing: boolean;
        onEdit?: () => void;
        onSave?: (e?: React.SyntheticEvent) => void;
        isSaving?: boolean;
        lastSaved?: Date | null;
    }) => React.ReactNode;
}
/**
 * Props when autoSave is enabled - onSave is required, hideEditControls/isEditing are redundant
 */
interface AutoSaveEnabledProps<M extends MetaData = MetaData> extends BaseDynamicFormProps<M> {
    /**
     * Auto-save configuration. When enabled, hides edit/save buttons and auto-saves changes.
     */
    autoSave: Exclude<AutoSaveConfig, false>;
    /**
     * Required when autoSave is enabled. Called automatically when form data changes.
     */
    onSave: (formData?: any) => void | Promise<void>;
    /**
     * @deprecated Redundant when autoSave is enabled. Auto-save automatically hides edit controls.
     */
    hideEditControls?: never;
    /**
     * If true, hides the save status feedback indicators.
     * Use this when you want to display status externally (e.g., in a header).
     * @default false
     */
    hideFeedback?: boolean;
}
/**
 * Props when autoSave is disabled or not provided
 */
interface AutoSaveDisabledProps<M extends MetaData = MetaData> extends BaseDynamicFormProps<M> {
    /**
     * Auto-save is disabled.
     */
    autoSave?: false;
    /**
     * Optional save handler.
     */
    onSave?: (formData?: any) => void | Promise<void>;
    /**
     * If true, hides the edit/save buttons and mode badge.
     * Use this when you want to handle save logic externally (e.g., in a footer).
     * @default false
     */
    hideEditControls?: boolean;
    /**
     * If true, hides the save status feedback indicators.
     * Use this when you want to display status externally (e.g., in a header).
     * @default false
     */
    hideFeedback?: boolean;
}
/**
 * Props for DynamicForm - uses discriminated union based on autoSave
 */
export type DynamicFormProps<M extends MetaData = MetaData> = AutoSaveEnabledProps<M> | AutoSaveDisabledProps<M>;
declare const MemoizedDynamicForm: React.MemoExoticComponent<(<M extends MetaData>({ form, onEdit, onSave, renderActions, autoSave, hideEditControls, hideFeedback, hideTitle, ...contextProps }: DynamicFormProps<M>) => import("react/jsx-runtime").JSX.Element)>;
export default MemoizedDynamicForm;
export { MemoizedDynamicForm as DynamicForm };
//# sourceMappingURL=DynamicForm.d.ts.map