import type {CapturedResultItem, Quadrilateral, EnumCapturedResultItemType} from "../core";
import type {EnumBarcodeFormat} from "./EnumBarcodeFormat";

/**
 * Interface BarcodeResultItem extends {@link CapturedResultItem}, represents a barcode result item decoded by barcode reader engine.
 * @see {@link DecodedBarcodesResult}
 * @see {@link EnumCapturedResultItemType.CRIT_BARCODE}
 * */
export interface BarcodeResultItem extends CapturedResultItem{
    /**
     * The format of the barcode. It specifies the type of barcode that was recognized.
     * @see {@link EnumBarcodeFormat}
     * */
    format: EnumBarcodeFormat | bigint;

    /**@internal*/
    _formatNumberString: string;

    /**A string that describes the format of the barcode in human-readable form. It provides a textual representation of the barcode format.*/
    formatString: string;

    /**The textual data decoded from the barcode. It represents the content of the barcode.*/
    text: string;
    /**
     * The location of the barcode in the form of a {@link Quadrilateral} (a set of coordinates defining the four corners of the detected barcode).
     * It describes where the barcode was found within an image.
     * @see {@link Quadrilateral}
     * */
    location: Quadrilateral;

    /**The confidence score or reliability of the barcode detection.*/
    confidence: number;

    /**The angle or orientation of the barcode, indicating if the barcode was detected at an angle or rotated.*/
    angle: number;

    /**The size of the individual modules or elements within the barcode.*/
    moduleSize: number;

    /**Whether the barcode is mirrored or reversed from its normal orientation.*/
    isMirrored: boolean;

    /**Indicates whether the barcode is a Direct Part Marking (DPM) barcode.*/
    isDPM: boolean;
}
