/**
 * FileManagerCallbacks - Callback interface for hazo_files integration.
 *
 * Consuming apps implement these callbacks (typically via API routes) to
 * bridge client-side React components with server-side hazo_files logic.
 */
import type { FormFileAttachment, FileStatus } from './file_attachment.js';
import type { ClarificationItem, ClarificationCallbacks } from './clarification.js';
/**
 * Configuration for LLM-based content tagging at upload time.
 * Mirrors hazo_files ContentTagConfig — when enabled, the LLM classifies
 * the uploaded document and writes the result to content_tag.
 */
export interface ContentTagConfig {
    /** Whether to enable LLM-based content tagging */
    content_tag_set_by_llm: boolean;
    /** Prompt area for hazo_llm_api lookup */
    content_tag_prompt_area: string;
    /** Prompt key within the area */
    content_tag_prompt_key: string;
    /** Field name to extract from the LLM response as the content tag */
    content_tag_prompt_return_fieldname: string;
    /** Optional variables to substitute in the prompt template */
    content_tag_prompt_variables?: Record<string, string>;
}
/**
 * Options passed to the upload callback.
 */
export interface FileUploadOptions {
    /** Entity type for the file reference (default: 'form_field') */
    entity_type?: string;
    /** Entity ID — typically the field_id the file is attached to */
    entity_id: string;
    /** Visibility level for this upload */
    visibility?: 'public' | 'private';
    /** Scope ID for organizational grouping (e.g. workspace, tenant) */
    scope_id?: string;
    /** User ID performing the upload */
    uploaded_by?: string;
    /** Optional label for the file reference */
    label?: string;
    /** Optional metadata to attach to the file reference */
    metadata?: Record<string, unknown>;
}
/**
 * Callback interface that consuming apps implement to connect
 * hazo_collab_forms file uploads with hazo_files on the server.
 */
export interface FileManagerCallbacks {
    /** Upload a file and create a tracked reference. Returns the attachment. */
    upload: (file: File, options: FileUploadOptions) => Promise<FormFileAttachment>;
    /** Remove a file reference (not the physical file — that's handled by orphan detection). */
    remove: (file_id: string, ref_id: string) => Promise<void>;
    /** Get a download URL for a file. */
    get_download_url: (file_id: string, visibility?: 'public' | 'private') => string;
    /** Check status of files. Optional — if absent, status checking is disabled. */
    get_status?: (file_ids: string[]) => Promise<Record<string, FileStatus>>;
    /** Re-upload to replace a missing file. Optional — if absent, re-upload is disabled. */
    reupload?: (file: File, original_file_id: string, options: FileUploadOptions) => Promise<FormFileAttachment>;
    /** Query a file's content_tag after upload (for cases where tagging is async). */
    get_content_tag?: (file_id: string) => Promise<string | null>;
    /** Update classification tags on a file (persists to hazo_files). */
    update_tags?: (file_id: string, tags: string[]) => Promise<void>;
}
/**
 * Configuration object passed to form components to enable hazo_files integration.
 */
export interface FileManagerConfig {
    /** Callback implementations (required) */
    callbacks: FileManagerCallbacks;
    /** Show missing/deleted/orphaned badges on files (default: false) */
    show_file_status?: boolean;
    /** Allow re-uploading missing files (default: false) */
    allow_reupload?: boolean;
    /** Default entity_type for file references (default: 'form_field') */
    default_entity_type?: string;
    /** Scope ID passed to all upload calls */
    scope_id?: string;
    /** User ID passed to all upload calls */
    uploaded_by?: string;
    /** Content tag configuration for LLM-based document classification at upload time */
    content_tag_config?: ContentTagConfig;
    /** Set of file IDs currently being validated by LLM (shows spinner overlay on file card) */
    validating_file_ids?: Set<string>;
    /** Set of file IDs that have validation errors (shows error badge on file card) */
    error_file_ids?: Set<string>;
    /** Set of file IDs that passed validation (shows green checkmark badge on file card) */
    passed_file_ids?: Set<string>;
    /** Map of file_id → array of issue descriptions for error popover */
    error_file_details?: Record<string, string[]>;
    /** Clarification items for file-level issue dialogs */
    clarification_items?: ClarificationItem[];
    /** Callbacks for clarification lifecycle (respond, resolve, dismiss, reopen) */
    clarification_callbacks?: ClarificationCallbacks;
    /** Custom className for the private files section background (default: 'bg-muted rounded-md p-3') */
    private_files_class_name?: string;
}
//# sourceMappingURL=file_manager.d.ts.map