import { V as ValidationFlowState } from '../../../sdcLabelInternalModuleCapture-yM8m0vEc.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; /** Whether the current paused state was entered because scanning timed out. */ private hasTimeout_; /** Whether the current paused state was entered by clicking the pause button from a scanning state. */ private pausedFromScanningState_; /** Field names targeted by the most recent partial (target) scan; empty when no partial scan is active. */ private partialScanFieldNames; 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). * Leaving PAUSED clears the timeout flag since the resume reason no longer applies. * Moving into a non-partial scanning state (IN_COMPLETE_SCAN, IDLE, FINISHED) clears the * recorded partial scan field names so a subsequent standby doesn't restart target mode. */ 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; /** * Whether the current paused state was entered via a scan timeout. */ get hasTimeout(): boolean; /** * Mark the current pause as resulting from a scan timeout. */ markTimeout(): void; /** * Whether the current paused state was entered by clicking the pause button from a scanning * state (Initial or Target). Tapping the preview should resume scanning in this case, * matching the same click-to-resume behaviour as a timeout-induced standby. */ get isPausedFromScanningState(): boolean; /** * Mark the current pause as initiated from the scanning state via the pause button. */ markPausedFromScanningState(): void; /** * Get the field names of the most recent partial (target) scan; empty if none is active. */ getPartialScanFieldNames(): string[]; /** * Record the field names for a partial (target) scan so we can restart it after a timeout. */ setPartialScanFieldNames(fieldNames: string[]): void; /** * Clear the recorded partial scan field names (when leaving target mode). */ clearPartialScanFieldNames(): void; /** * 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; /** * Transition to PROCESSING without specifying fields yet. * Use this at the start of onCloudBackupServiceStarted so that isCloudBackupProcessing * is true before updateCloudBackupFields is called with the fetched field list. */ startCloudBackupService(): void; /** * Update the set of fields shown as processing in cloud based on the latest field list. * Only updates the field set — state machine transitions (start/stop) are the * responsibility of onCloudBackupServiceStarted / onCloudBackupServiceStopped. */ updateCloudBackupFields(validationFlowFields: ValidationFlowField[]): 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 };