import { Symbology } from './djinni-types/sdcBarcodeData.js';
import { SymbologySettings } from './djinni-types/sdcSymbologySettings.js';
import { WasmFrameData, DataCaptureContext } from '@scandit/web-datacapture-core/build/js/worker/dataCaptureWorkerRelated';
import { LocationSelection } from './djinni-types/sdcCoreInternalSdkArea.js';
import { WrappedFuture } from './djinni-types/sdcCoreInternalSdkCommonAsync.js';
import { ExternalOcrBackend } from './djinni-types/sdcCoreInternalSdkOcr.js';
import { Rect } from './djinni-types/sdcCoreCommonGeometry.js';
import { LabelFieldLocationType, LabelDateComponentFormat, AdaptiveRecognitionMode } from './djinni-types/sdcLabelData.js';
import { CapturedLabel, ReceiptScanningResult, LabelField } from './djinni-types/sdcLabelInternalModuleData.js';

/**
  * Copyright 2021 Snap, Inc.
  * Copyright 2024 Scandit AG
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *    http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
interface ResultOutcome<T> {
    type: "result";
    result: T;
}
interface ErrorOutcome<E> {
    type: "error";
    error: E;
}
type ResultOrError<T, E> = ResultOutcome<T> | ErrorOutcome<E>;

interface LabelCapture {
    isEnabled(): boolean;
    setEnabled(enabled: boolean): void;
    isAttachedToContext(): boolean;
    addListenerAsync(listener: LabelCaptureListener, priority: number): void;
    removeListenerAsync(listener: LabelCaptureListener): void;
    getSession(): LabelCaptureSession;
    applySettingsWrapped(settings: LabelCaptureSettings): WrappedFuture;
    getContext(): DataCaptureContext;
    registerExternalOcrBackend(backend: ExternalOcrBackend): void;
    shouldUseEngineDrivenAnimations(): boolean;
    receiptScanningHandler(): ReceiptScanningHandler;
    validationFlowHandler(): ValidationFlowHandler;
    unsetValidationFlowHandler(): void;
}
interface LabelCapture_statics {
    create(context: DataCaptureContext, settings: LabelCaptureSettings): LabelCapture;
}
interface LabelCaptureHelper {
}
interface LabelCaptureHelper_statics {
    addLabelCaptureToContext(mode: LabelCapture, context: DataCaptureContext): void;
    removeLabelCaptureFromContext(mode: LabelCapture, context: DataCaptureContext): void;
}
interface LabelCaptureSettings {
    setLocationSelection(locationSelection: LocationSelection): void;
    getLocationSelection(): LocationSelection | undefined;
    getLicenseKey(): string;
    setLicenseKey(license: string): void;
    getLicensee(): string;
    setLicensee(licensee: string): void;
    getIntProperty(key: string): number | undefined;
    setIntProperty(key: string, value: number): void;
    getBlueprintJson(): string;
    getBasicOverlayAnimationMillis(): number | undefined;
}
interface LabelCaptureSettings_statics {
    loadFromString(description: string): ResultOrError<LabelCaptureSettings, string>;
    createFromLabelDefinitions(labelDefinitions: Array<LabelDefinition>): ResultOrError<LabelCaptureSettings, string>;
    create(labelDefinitions: Array<LabelDefinition>, hiddenPropertyJsonString: string, blueprintJsonUpdate: string): ResultOrError<LabelCaptureSettings, string>;
}
interface LabelCaptureSession {
    getLabels(): Array<CapturedLabel>;
    getLastFrameId(): number;
    toJson(): string;
}
interface LabelCaptureListener {
    onSessionUpdated(mode: LabelCapture, session: LabelCaptureSession, data: WasmFrameData): void;
    onObservationStarted(mode: LabelCapture): void;
    onObservationStopped(mode: LabelCapture): void;
}
interface LabelDefinition {
    getName(): string;
    getFieldDefinitions(): Array<LabelFieldDefinition>;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getAdaptiveRecognitionMode(): AdaptiveRecognitionMode;
    setAdaptiveRecognitionMode(mode: AdaptiveRecognitionMode): void;
}
interface LabelDefinition_statics {
    create(name: string, fieldDefinitions: Array<LabelFieldDefinition>): LabelDefinition;
    createVinLabelDefinition(name: string): LabelDefinition;
    createPriceCaptureDefinition(name: string): LabelDefinition;
    createSevenSegmentDisplayLabelDefinition(name: string): LabelDefinition;
}
interface LabelFieldDefinition {
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
}
interface LabelDateFormat {
    componentFormat: LabelDateComponentFormat;
    acceptPartialDates: boolean;
}
interface TextField {
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    resetDataTypePatterns(): void;
}
interface DateText {
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    asLabelFieldDefinition(): LabelFieldDefinition;
    getLabelDateFormat(): LabelDateFormat;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    getDataTypePatterns(): Array<string> | undefined;
    resetDataTypePatterns(): void;
}
interface DateText_statics {
    create(name: string, format: LabelDateFormat): DateText;
}
interface ExpiryDateText {
    asLabelFieldDefinition(): LabelFieldDefinition;
    setLabelDateFormat(format: LabelDateFormat | undefined): void;
    getLabelDateFormat(): LabelDateFormat | undefined;
    resetDataTypePatterns(): void;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
}
interface ExpiryDateText_statics {
    create(name: string): ExpiryDateText;
}
interface PackingDateText {
    asLabelFieldDefinition(): LabelFieldDefinition;
    setLabelDateFormat(format: LabelDateFormat | undefined): void;
    getLabelDateFormat(): LabelDateFormat | undefined;
    resetDataTypePatterns(): void;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
}
interface PackingDateText_statics {
    create(name: string): PackingDateText;
}
interface TotalPriceText {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    resetDataTypePatterns(): void;
}
interface TotalPriceText_statics {
    create(name: string): TotalPriceText;
}
interface UnitPriceText {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    resetDataTypePatterns(): void;
}
interface UnitPriceText_statics {
    create(name: string): UnitPriceText;
}
interface WeightText {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    resetDataTypePatterns(): void;
}
interface WeightText_statics {
    create(name: string): WeightText;
}
interface CustomText {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    resetDataTypePatterns(): void;
}
interface CustomText_statics {
    create(name: string): CustomText;
}
interface BarcodeField {
    getSymbologies(): Array<SymbologySettings>;
    setSymbologies(symbologies: Array<SymbologySettings>): void;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
}
interface BarcodeField_statics {
    defaultSymbologies(symbologies: Array<Symbology>): Array<SymbologySettings>;
}
interface ImeiOneBarcode {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    /** inherited from barcode_field */
    getSymbologies(): Array<SymbologySettings>;
    setSymbologies(symbologies: Array<SymbologySettings>): void;
}
interface ImeiOneBarcode_statics {
    create(name: string): ImeiOneBarcode;
}
interface ImeiTwoBarcode {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    /** inherited from barcode_field */
    getSymbologies(): Array<SymbologySettings>;
    setSymbologies(symbologies: Array<SymbologySettings>): void;
}
interface ImeiTwoBarcode_statics {
    create(name: string): ImeiTwoBarcode;
}
interface PartNumberBarcode {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    /** inherited from barcode_field */
    getSymbologies(): Array<SymbologySettings>;
    setSymbologies(symbologies: Array<SymbologySettings>): void;
}
interface PartNumberBarcode_statics {
    create(name: string): PartNumberBarcode;
}
interface SerialNumberBarcode {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    /** inherited from barcode_field */
    getSymbologies(): Array<SymbologySettings>;
    setSymbologies(symbologies: Array<SymbologySettings>): void;
}
interface SerialNumberBarcode_statics {
    create(name: string): SerialNumberBarcode;
}
interface CustomBarcode {
    asLabelFieldDefinition(): LabelFieldDefinition;
    /** inherited from label_field_definition */
    getName(): string;
    isOptional(): boolean;
    setOptional(optional: boolean): void;
    getPatterns(): Array<string>;
    setPatterns(patterns: Array<string>): void;
    getHiddenProperties(): string;
    setHiddenProperties(jsonString: string): void;
    getLocation(): LabelFieldLocation | undefined;
    setLocation(location: LabelFieldLocation): void;
    getDataTypePatterns(): Array<string> | undefined;
    setDataTypePatterns(dataTypePatterns: Array<string>): void;
    /** inherited from barcode_field */
    getSymbologies(): Array<SymbologySettings>;
    setSymbologies(symbologies: Array<SymbologySettings>): void;
}
interface CustomBarcode_statics {
    create(name: string, symbologies: Array<SymbologySettings>): CustomBarcode;
}
interface LabelFieldLocation {
    getLabelFieldLocationType(): LabelFieldLocationType | undefined;
    getRect(): Rect | undefined;
}
interface LabelFieldLocation_statics {
    createWithType(locationType: LabelFieldLocationType): LabelFieldLocation;
    createWithRect(rect: Rect): LabelFieldLocation;
}
interface ReceiptScanningListener {
    onProcessingStarted(): void;
    onReceiptScanned(result: ReceiptScanningResult): void;
    onReceiptScanningFailed(): void;
}
interface ReceiptScanningHandler {
    startFlow(): void;
    finishFlow(): void;
    addListener(listener: ReceiptScanningListener): void;
    removeListener(listener: ReceiptScanningListener): void;
}
declare enum LabelResultUpdateType {
    SYNC = 0,
    ASYNC_STARTED = 1,
    ASYNC_FINISHED = 2
}
interface LabelResultUpdate {
    type: LabelResultUpdateType;
    asyncId?: bigint;
}
declare enum ValidationFlowState {
    IDLE = 0,
    IN_PARTIAL_SCAN = 1,
    IN_COMPLETE_SCAN = 2,
    PAUSED = 3,
    FINISHED = 4
}
interface ValidationFlowField {
    getLabelField(): LabelField;
    isValid(): boolean;
    isProcessingInCloud(): boolean;
}
interface ValidationFlowListener {
    onFieldsScanned(fields: Array<ValidationFlowField>): void;
    onScanTimeout(): void;
    onLabelIsMissingRequiredField(fields: Array<ValidationFlowField>): void;
    onManualInput(field: ValidationFlowField, oldValue: string | undefined, newValue: string): void;
    onStateChanged(state: ValidationFlowState): void;
    onCloudBackupServiceStarted(): void;
    onCloudBackupServiceStopped(): void;
    onResultUpdate(update: LabelResultUpdate, fields: Array<ValidationFlowField>, frameData: WasmFrameData): void;
}
interface ValidationFlowHandler {
    startCompleteLabelScan(labelName: string): void;
    startPartialLabelScan(fieldNames: Array<string>): void;
    updateFieldValue(fieldName: string, value: string): boolean;
    finishFlow(): ResultOrError<Array<ValidationFlowField>, string>;
    clearAllFields(): void;
    validationFlowFields(): Array<ValidationFlowField>;
    pauseScan(): void;
    resumeScan(): void;
    reset(): void;
    cancelCloudBackupTaskForField(fieldName: string): void;
    uncancelCloudBackupTaskForField(fieldName: string): void;
    addListener(listener: ValidationFlowListener): void;
    removeListener(listener: ValidationFlowListener): void;
}
interface SdcLabelInternalModuleCapture_statics {
    LabelCapture: LabelCapture_statics;
    LabelCaptureHelper: LabelCaptureHelper_statics;
    LabelCaptureSettings: LabelCaptureSettings_statics;
    LabelDefinition: LabelDefinition_statics;
    DateText: DateText_statics;
    ExpiryDateText: ExpiryDateText_statics;
    PackingDateText: PackingDateText_statics;
    TotalPriceText: TotalPriceText_statics;
    UnitPriceText: UnitPriceText_statics;
    WeightText: WeightText_statics;
    CustomText: CustomText_statics;
    BarcodeField: BarcodeField_statics;
    ImeiOneBarcode: ImeiOneBarcode_statics;
    ImeiTwoBarcode: ImeiTwoBarcode_statics;
    PartNumberBarcode: PartNumberBarcode_statics;
    SerialNumberBarcode: SerialNumberBarcode_statics;
    CustomBarcode: CustomBarcode_statics;
    LabelFieldLocation: LabelFieldLocation_statics;
}

export { type LabelDefinition_statics as A, type BarcodeField as B, type CustomBarcode as C, type DateText as D, type ExpiryDateText as E, type LabelFieldLocation_statics as F, type PackingDateText_statics as G, type PartNumberBarcode_statics as H, type ImeiOneBarcode as I, type ReceiptScanningHandler as J, type SerialNumberBarcode_statics as K, type LabelCapture as L, type TextField as M, type TotalPriceText_statics as N, type UnitPriceText_statics as O, type PackingDateText as P, type WeightText_statics as Q, type ResultOrError as R, type SerialNumberBarcode as S, type TotalPriceText as T, type UnitPriceText as U, ValidationFlowState as V, type WeightText as W, type SdcLabelInternalModuleCapture_statics as X, type ValidationFlowHandler as Y, LabelResultUpdateType as a, type LabelCaptureListener as b, type LabelCaptureSession as c, type LabelFieldLocation as d, type LabelFieldDefinition as e, type CustomText as f, type LabelDateFormat as g, type ImeiTwoBarcode as h, type LabelCaptureHelper as i, type LabelCaptureSettings as j, type LabelDefinition as k, type PartNumberBarcode as l, type ReceiptScanningListener as m, type ValidationFlowListener as n, type ValidationFlowField as o, type LabelResultUpdate as p, type BarcodeField_statics as q, type CustomBarcode_statics as r, type CustomText_statics as s, type DateText_statics as t, type ExpiryDateText_statics as u, type ImeiOneBarcode_statics as v, type ImeiTwoBarcode_statics as w, type LabelCapture_statics as x, type LabelCaptureHelper_statics as y, type LabelCaptureSettings_statics as z };
