/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten.
/// Generated from xplatforms/schemas/barcode_scanner/Barcode.yaml

import { ScanbotBarcodeImpl } from './impl';
import { ImageInput, ResultWrapper } from './types/base/customTypes';
import {
  BarcodeDocumentFormat,
  BarcodeDocumentParserResult,
} from './types/core/barcode/BarcodeDocumentTypes';
import {
  BarcodeScannerConfiguration,
  BarcodeScannerResult,
} from './types/core/barcode/BarcodeScannerTypes';
import { BarcodeScannerScreenConfiguration } from './types/core/ui_v2/barcode/BarcodeScannerScreenConfiguration';
import { BarcodeScannerUiResult } from './types/core/ui_v2/barcode/BarcodeScannerUiResult';

/**
 * Entry point for all barcode features.
 */
export const ScanbotBarcode = {
  /**
   * Opens the Ready-To-Use UI screen for scanning barcodes with the desired configuration.
   * @param {BarcodeScannerScreenConfiguration} configuration - The Barcode scanner configuration to be used for scanning.
   * @returns {Promise<ResultWrapper<BarcodeScannerUiResult>>} - The result of the Barcode scanning operation.
   */
  async startScanner(
    configuration: BarcodeScannerScreenConfiguration
  ): Promise<ResultWrapper<BarcodeScannerUiResult>> {
    return ScanbotBarcodeImpl.startScanner(configuration);
  },
  /**
   * Scans Barcode from a given image with the desired configuration.
   * @param {ImageInput} params.image - The image to be used for scanning.
   * @param {BarcodeScannerConfiguration} params.configuration - The Barcode scanner configuration to be used for scanning.
   * @returns {Promise<BarcodeScannerResult>} - The result of the Barcode scanning operation.
   */
  async scanFromImage(params: {
    image: ImageInput;
    configuration: BarcodeScannerConfiguration;
  }): Promise<BarcodeScannerResult> {
    return ScanbotBarcodeImpl.scanFromImage(params);
  },
  /**
   * Scans Barcode from a given PDF document with the desired configuration.
   * @param {string} params.pdfFileUri - The PDF file uri to be used for scanning.
   * @param {BarcodeScannerConfiguration} params.configuration - The Barcode scanner configuration to be used for scanning.
   * @returns {Promise<BarcodeScannerResult>} - The result of the Barcode scanning operation.
   */
  async scanFromPdf(params: {
    pdfFileUri: string;
    configuration: BarcodeScannerConfiguration;
  }): Promise<BarcodeScannerResult> {
    return ScanbotBarcodeImpl.scanFromPdf(params);
  },
  /**
   * Parses a barcode document from the given raw text content with the specified accepted formats.
   * @param {string} params.rawText - The raw text content representing the document to be parsed.
   * @param {BarcodeDocumentFormat[]} params.acceptedFormats - The list of accepted barcode document formats to be parsed. If not provided, all supported formats will be parsed.
   * @returns {Promise<BarcodeDocumentParserResult>} - The result of the Barcode document parsing operation.
   */
  async parseDocument(params: {
    rawText: string;
    acceptedFormats?: BarcodeDocumentFormat[];
  }): Promise<BarcodeDocumentParserResult> {
    return ScanbotBarcodeImpl.parseDocument(params);
  },
};
