import type { ValidationRule } from '../../../types/validation.js';
export interface UseValidationRulesOptions {
    api_base_url?: string;
    table_name?: string;
    scope_id?: string | null;
    /**
     * When true AND scope_id is set, fetch globals (scope_id IS NULL) and
     * overrides (scope_id = scope_id) in parallel and merge by rule_id
     * (override wins). Each rule in the returned list is tagged with an
     * `origin` discriminator. Default: false (single-tier behaviour).
     */
    include_globals?: boolean;
    /**
     * Required when include_globals is true AND scope_id is set.
     * Called when the user clicks "Override default" on a global rule.
     * Consumer POSTs to its own clone-to-override endpoint and returns
     * the newly-created override row (with full ValidationRule shape).
     */
    on_clone_to_override?: (global_rule: ValidationRule) => Promise<ValidationRule | null>;
}
export interface UseValidationRulesReturn {
    /** All loaded rules */
    rules: ValidationRule[];
    /** Loading state */
    loading: boolean;
    /** Error message (if any) */
    error: string | null;
    /** Distinct document types from loaded rules */
    document_types: string[];
    /** Fetch rules from the server */
    fetch_rules: (filter?: {
        document_type?: string;
    }) => Promise<void>;
    /** Create a new rule. rule_id is the human-friendly identifier. */
    create_rule: (rule: Omit<ValidationRule, 'id' | 'created_at' | 'changed_at'>) => Promise<ValidationRule | null>;
    /** Update an existing rule */
    update_rule: (id: string, updates: Partial<ValidationRule>) => Promise<ValidationRule | null>;
    /** Delete a rule */
    delete_rule: (id: string) => Promise<boolean>;
    /** Check if a rule_id is unique among loaded rules. Optionally exclude a specific rule's UUID. */
    is_rule_id_unique: (rule_id: string, exclude_uuid?: string) => boolean;
    /** Clone a global rule into an override at the current scope. Returns the new rule, or null on failure. */
    clone_to_override: (global_rule: ValidationRule) => Promise<ValidationRule | null>;
    /** Whether the clone-to-override callback is supplied (UI uses this to enable/disable the CTA). */
    can_clone_to_override: boolean;
}
export declare function use_validation_rules(options?: UseValidationRulesOptions): UseValidationRulesReturn;
//# sourceMappingURL=use_validation_rules.d.ts.map