import { V as ValidationFlowState } from '../../../sdcLabelInternalModuleCapture-CxPSiq2o.js';
import { ValidationFlowField } from '../../ValidationFlowField.js';
import '../../../djinni-types/sdcBarcodeData.js';
import '../../../djinni-types/sdcSymbologySettings.js';
import '@scandit/web-datacapture-core/build/js/worker/dataCaptureWorkerRelated';
import '../../../djinni-types/sdcCoreInternalSdkArea.js';
import '../../../djinni-types/sdcCoreInternalSdkCommonGeometry.js';
import '../../../djinni-types/sdcCoreCommonGraphic.js';
import '../../../djinni-types/sdcCoreCommonGeometry.js';
import '../../../djinni-types/sdcCoreInternalSdkCommonAsync.js';
import '../../../djinni-types/sdcCoreInternalSdkOcr.js';
import '../../../djinni-types/sdcCoreCommon.js';
import '../../../djinni-types/sdcLabelData.js';
import '../../../djinni-types/sdcLabelInternalModuleData.js';
import '../../../djinni-types/sdcBarcodeInternalSdkData.js';
import '../../../djinni-types/sdcCoreCommonBuffer.js';
import '../../LabelField.js';
import '@scandit/web-datacapture-barcode';
import '@scandit/web-datacapture-core';
import '../../LabelFieldState.js';
import '../../LabelFieldType.js';
import '../../LabelFieldValueType.js';
import '../../LabelDateResult.js';

/**
 * Cloud backup processing states (orthogonal to scanning)
 */
declare enum CloudBackupState {
    /** No cloud backup processing */
    IDLE = "idle",
    /** Cloud backup processing in progress */
    PROCESSING = "processing"
}
/**
 * Individual input field states
 */
declare enum InputState {
    /** Empty or cleared, no validation */
    Initial = "initial",
    /** Actively scanning via camera */
    Scanning = "scanning",
    /** Being processed by cloud backup service */
    CloudBackup = "cloudBackup",
    /** Successfully validated */
    Validated = "validated",
    /** Validation failed */
    Error = "error"
}
/**
 * Manages validation flow state:
 * - Validation flow state: overall scanning state from native handler (IDLE, IN_COMPLETE_SCAN, etc.)
 * - Focused input: tracks which input is currently focused by name (for UI state)
 * - Cloud backup state: handles cloud processing (orthogonal to scanning)
 * - Input states: per-field validation states
 */
declare class ValidationFlowStateManager {
    private cloudBackupStateMachine;
    /** Tracks the overall validation flow state from the native handler */
    private validationFlowState;
    /** Tracks the name of the currently focused input */
    private currentInputName;
    /** Tracks which fields are currently being processed by cloud backup */
    private cloudBackupFields;
    /** Per-field input states */
    private fieldStates;
    /** Scan results from the last onFieldsScanned event, keyed by field name. CLEARED_SCAN_RESULT indicates a cleared/deleted result. */
    private scanResultMap;
    constructor();
    /**
     * Current validation flow state from the native handler
     */
    get validationFlowHandlerState(): ValidationFlowState;
    /**
     * Set the validation flow state (called when receiving state updates from native handler)
     */
    set validationFlowHandlerState(state: ValidationFlowState);
    /**
     * Whether currently in a scanning state (complete or partial scan)
     */
    get isScanning(): boolean;
    /**
     * Whether currently scanning OR processing cloud backup
     */
    get isScanningOrCloudBackup(): boolean;
    /**
     * Whether in paused state
     */
    get isPaused(): boolean;
    /**
     * Whether in finished state
     */
    get isFinished(): boolean;
    /**
     * Whether in idle state
     */
    get isIdle(): boolean;
    /**
     * Current cloud backup state
     */
    get cloudBackupState(): CloudBackupState;
    /**
     * Whether cloud backup is processing
     */
    get isCloudBackupProcessing(): boolean;
    /**
     * Whether an input is currently processed
     */
    get hasCurrentInputName(): boolean;
    /**
     * Get the name of the currently focused input
     */
    getCurrentInputName(): string | null;
    /**
     * Set the focused input by name
     */
    setCurrentInputName(inputName: string): void;
    /**
     * Clear the focused input
     */
    clearCurrentInputName(): void;
    /**
     * Start cloud backup processing for specific fields.
     * Only transitions IDLE → PROCESSING; if already PROCESSING, just updates the field set.
     */
    startCloudBackup(fieldNames: string[]): void;
    /**
     * Stop cloud backup processing (all fields)
     */
    stopCloudBackup(): void;
    /**
     * Cancel cloud backup for a specific field
     */
    cancelCloudBackupForField(fieldName: string): void;
    /**
     * Resume cloud backup for a specific field (uncancel)
     */
    uncancelCloudBackupForField(fieldName: string): void;
    /**
     * Check if a specific field is being processed by cloud backup
     */
    isFieldInCloudBackup(fieldName: string): boolean;
    /**
     * Get all fields currently in cloud backup
     */
    getCloudBackupFields(): string[];
    /**
     * Subscribe to cloud backup state changes
     */
    onCloudBackupStateChange(listener: (currentState: CloudBackupState, previousState: CloudBackupState, context?: unknown) => void): void;
    /**
     * Unsubscribe from cloud backup state changes
     */
    offCloudBackupStateChange(listener: (currentState: CloudBackupState, previousState: CloudBackupState, context?: unknown) => void): void;
    /**
     * Register all fields at initialization. Does not override existing state.
     */
    registerFields(fieldNames: string[]): void;
    /**
     * Remove all field state (call on re-initialization).
     */
    clearFields(): void;
    /**
     * Set field state, enforcing the invariant:
     * if currentInputName === fieldName and state is Scanning or CloudBackup → use Initial instead.
     */
    setInputState(fieldName: string, state: InputState): void;
    /**
     * Read the stored (invariant-enforced) state. Defaults to Initial for unknown fields.
     */
    getInputState(fieldName: string): InputState;
    /**
     * True if fieldName === currentInputName (field is focused or in blur-validation flow).
     */
    isCurrentInputName(fieldName: string): boolean;
    /**
     * Store the latest batch of scan results from onFieldsScanned.
     * All backend results are stored; value-based filtering happens at read time in the presenter.
     * Replaces any previously stored results.
     */
    setScanResults(validationFlowFields: ValidationFlowField[]): void;
    updateScanResults(validationFlowFields: ValidationFlowField[]): void;
    deleteScanResult(fieldName: string): void;
    /**
     * Get the stored scan result for a specific field.
     */
    getScanResult(fieldName: string): ValidationFlowField | undefined;
    /**
     * Clear all stored scan results (called at the end of syncInputWithState so that
     * subsequent syncs without new results start from a clean slate).
     */
    clearScanResults(): void;
}

export { CloudBackupState, InputState, ValidationFlowStateManager };
