UNPKG

capacitor-plugin-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK for Capacitor

466 lines (465 loc) 20.1 kB
import type { AnalyticsSubscriber } from './analytics/index'; import type { BarcodeScannerConfiguration } from './barcode/BarcodeScannerTypes'; import { BarcodeScannerResult } from './barcode/BarcodeScannerTypes'; import type { AddPageParams, ApplyImageFiltersOnPageResult, ApplyImageFiltersResult, CheckScannerScreenConfiguration, CreateDocumentParams, CreatePageResult, CreatePDFArguments, CreatePDFResult, CreateTIFFResult, CroppingConfiguration, CroppingResult, DetectDocumentOnPageResult, DetectDocumentResult, DocumentExistsResult, DocumentFromLegacyPagesParams, DocumentScannerMetadata, DocumentScannerResult, DocumentScannerScreenConfiguration, ExtractImagesFromPdfArguments, ExtractImagesFromPdfResult, ExtractPagesFromPdfArguments, ExtractPagesFromPdfResult, FinderDocumentScannerConfiguration, FinderDocumentScannerResult, HealthInsuranceCardScannerConfiguration, ImageDataResult, LicenseInfoResult, MedicalCertificateScannerConfiguration, MockCameraParams, ModifyPageParams, MovePageParams, OCRConfigsResult, Page, PDFFromDocumentParams, PerformOCRArguments, PerformOCRResult, RefreshImageUrisResult, RemovePageParams, ResultWrapper, ResultWrapperWithMetadata, RotateImageResult, RotatePageResult, ScanbotSdkConfiguration, SetDocumentImageResult, StoredDocumentIDsResult, TIFFFromDocumentParams, VinScannerScreenConfiguration, WriteTIFFArguments, WriteTIFFResult } from './base'; import type { CheckScannerConfiguration } from './check/CheckScannerTypes'; import { CheckScanningResult } from './check/CheckScannerTypes'; import type { CreditCardScannerConfiguration } from './credit_card/CreditCardTypes'; import { CreditCardScanningResult } from './credit_card/CreditCardTypes'; import type { DocumentDataExtractorConfiguration } from './document_data_extractor/DocumentDataExtractorTypes'; import { DocumentDataExtractionResult, DocumentVerificationReport } from './document_data_extractor/DocumentDataExtractorTypes'; import { DocumentData } from './document_scanner/DocumentData'; import type { GenericDocument } from './documents/GenericDocument'; import type { DocumentQualityAnalyzerConfiguration } from './dqa/DocumentQualityAnalyzerTypes'; import { DocumentQualityAnalyzerResult } from './dqa/DocumentQualityAnalyzerTypes'; import { EuropeanHealthInsuranceCardRecognitionResult, type EuropeanHealthInsuranceCardRecognizerConfiguration } from './ehic/EuropeanHealthInsuranceCardTypes'; import type { ParametricFilter } from './image_filters/ParametricFilters'; import type { MedicalCertificateScanningParameters } from './medical_certificate/MedicalCertificateTypes'; import { MedicalCertificateScanningResult } from './medical_certificate/MedicalCertificateTypes'; import type { MrzScannerConfiguration } from './mrz/MrzTypes'; import { MrzScannerResult } from './mrz/MrzTypes'; import { VinScannerResult } from './vin/VinScannerTypes'; declare const ScanbotDocument: { /** * Create a new document. */ createDocument(params: CreateDocumentParams): Promise<DocumentData>; /** * Create a new document from legacy pages. */ createDocumentFromLegacyPages(params: DocumentFromLegacyPagesParams): Promise<DocumentData>; /** * Create a new document from a PDF file. */ createDocumentFromPDF(params: { pdfUri: string; }): Promise<DocumentData>; /** * Check if a document with the given ID exists. */ documentExists(params: { documentID: string; }): Promise<DocumentExistsResult>; /** * Load a document by its ID. */ loadDocument(params: { documentID: string; }): Promise<DocumentData>; /** * Gets all stored document IDs. */ storedDocumentIDs(): Promise<StoredDocumentIDsResult>; /** * Clone a document by its ID. */ cloneDocument(params: { documentID: string; }): Promise<DocumentData>; /** * Delete a document by its ID. */ deleteDocument(params: { documentID: string; }): Promise<void>; /** * Delete all documents. */ deleteAllDocuments(): Promise<void>; /** * Creates a PDF for the given document. * Please check the extra options that are part of the input params to modify the created PDF file per your needs. */ createPDF(params: PDFFromDocumentParams): Promise<CreatePDFResult>; /** * Creates a TIFF for the given document. * Please check the extra options that are part of the input params to modify the created TIFF file per your needs. */ createTIFF(params: TIFFFromDocumentParams): Promise<CreateTIFFResult>; /** * Add a new page to a document and return the updated document. */ addPage(params: AddPageParams): Promise<DocumentData>; /** * Move a page in a document and return the updated document. */ movePage(params: MovePageParams): Promise<DocumentData>; /** * Modify a page in a document and return the updated document. */ modifyPage(params: ModifyPageParams): Promise<DocumentData>; /** * Remove a page from a document. */ removePage(params: RemovePageParams): Promise<DocumentData>; /** * Remove all pages from a document in one batch operation. */ removeAllPages(params: { documentID: string; }): Promise<DocumentData>; }; export declare const ScanbotSDK: { Document: { /** * Create a new document. */ createDocument(params: CreateDocumentParams): Promise<DocumentData>; /** * Create a new document from legacy pages. */ createDocumentFromLegacyPages(params: DocumentFromLegacyPagesParams): Promise<DocumentData>; /** * Create a new document from a PDF file. */ createDocumentFromPDF(params: { pdfUri: string; }): Promise<DocumentData>; /** * Check if a document with the given ID exists. */ documentExists(params: { documentID: string; }): Promise<DocumentExistsResult>; /** * Load a document by its ID. */ loadDocument(params: { documentID: string; }): Promise<DocumentData>; /** * Gets all stored document IDs. */ storedDocumentIDs(): Promise<StoredDocumentIDsResult>; /** * Clone a document by its ID. */ cloneDocument(params: { documentID: string; }): Promise<DocumentData>; /** * Delete a document by its ID. */ deleteDocument(params: { documentID: string; }): Promise<void>; /** * Delete all documents. */ deleteAllDocuments(): Promise<void>; /** * Creates a PDF for the given document. * Please check the extra options that are part of the input params to modify the created PDF file per your needs. */ createPDF(params: PDFFromDocumentParams): Promise<CreatePDFResult>; /** * Creates a TIFF for the given document. * Please check the extra options that are part of the input params to modify the created TIFF file per your needs. */ createTIFF(params: TIFFFromDocumentParams): Promise<CreateTIFFResult>; /** * Add a new page to a document and return the updated document. */ addPage(params: AddPageParams): Promise<DocumentData>; /** * Move a page in a document and return the updated document. */ movePage(params: MovePageParams): Promise<DocumentData>; /** * Modify a page in a document and return the updated document. */ modifyPage(params: ModifyPageParams): Promise<DocumentData>; /** * Remove a page from a document. */ removePage(params: RemovePageParams): Promise<DocumentData>; /** * Remove all pages from a document in one batch operation. */ removeAllPages(params: { documentID: string; }): Promise<DocumentData>; }; /** * Opens the Ready-To-Use UI Document Scanner screen with the desired configuration. * * @deprecated Use ***startDocumentScanner*** from ***'capacitor-plugin-scanbot-sdk/ui_v2'*** instead. */ startDocumentScanner(configuration: DocumentScannerScreenConfiguration): Promise<ResultWrapperWithMetadata<DocumentScannerResult, DocumentScannerMetadata>>; /** * Forces the Ready-To-Use UI Document Scanner screen to close while it is running. * * @deprecated */ closeDocumentScanner(): Promise<void>; /** * Opens the Ready-To-Use UI Finder Document Scanner screen with the desired configuration. * * @deprecated Use ***startDocumentScanner*** from ***'capacitor-plugin-scanbot-sdk/ui_v2'*** instead. */ startFinderDocumentScanner(configuration: FinderDocumentScannerConfiguration): Promise<ResultWrapper<FinderDocumentScannerResult>>; /** * Forces the Ready-To-Use UI Finder Document Scanner screen to close while it is running. * * @deprecated */ closeFinderDocumentScanner(): Promise<void>; /** * Opens the Ready-To-Use UI Cropping screen with the desired configuration. * * @deprecated Use ***startCroppingScreen*** from ***'capacitor-plugin-scanbot-sdk/ui_v2'*** instead. */ startCroppingScreen(params: { page: Page; configuration: CroppingConfiguration; }): Promise<ResultWrapper<CroppingResult>>; /** * Forces the Ready-To-Use UI Cropping screen to close while it is running. * * @deprecated */ closeCroppingScreen(): Promise<void>; /** * Opens the Ready-To-Use UI European Health Insurance Card Scanner screen with the desired configuration. * * @deprecated Use ***startDocumentDataExtractor*** instead and enable ***DE_HEALTH_INSURANCE_CARD_FRONT*** and ***EU_HEALTH_INSURANCE_CARD*** document formats. */ startEHICScanner(configuration: HealthInsuranceCardScannerConfiguration): Promise<ResultWrapper<EuropeanHealthInsuranceCardRecognitionResult>>; /** * Forces the Ready-To-Use UI European Health Insurance Card Scanner screen to close while it is running. * * @deprecated */ closeEHICScanner(): Promise<void>; /** * Opens the Ready-To-Use UI Medical Certificate Scanner screen with the desired configuration. */ startMedicalCertificateScanner(configuration: MedicalCertificateScannerConfiguration): Promise<ResultWrapper<MedicalCertificateScanningResult>>; /** * Forces the Ready-To-Use UI Medical Certificate Scanner screen to close while it is running. */ closeMedicalCertificateScanner(): Promise<void>; /** * Opens the Ready-To-Use UI Check Scanner screen with the desired configuration. * * @deprecated Use ***startCheckScanner*** from ***'capacitor-plugin-scanbot-sdk/ui_v2'*** instead. */ startCheckScanner(configuration: CheckScannerScreenConfiguration): Promise<ResultWrapper<CheckScanningResult>>; /** * Forces the Ready-To-Use UI Check Scanner screen to close while it is running. * * @deprecated */ closeCheckScanner(): Promise<void>; /** * Opens the Ready-To-Use UI VIN Scanner screen with the desired configuration. * * @deprecated Use ***startVINScanner*** from ***'capacitor-plugin-scanbot-sdk/ui_v2'*** instead. */ startVinScanner(configuration: VinScannerScreenConfiguration): Promise<ResultWrapper<VinScannerResult>>; /** * Forces the Ready-To-Use UI VIN Scanner screen to close while it is running. * * @deprecated */ closeVinScanner(): Promise<void>; /** * Initializes the Scanbot SDK with the preferred configuration. */ initializeSDK(config: ScanbotSdkConfiguration): Promise<LicenseInfoResult>; /** * Provides complete information about the current license status. */ getLicenseInfo(): Promise<LicenseInfoResult>; /** * Detects barcodes on the image represented by the file URI. */ detectBarcodesOnImage(imageFileUri: string, configuration: BarcodeScannerConfiguration): Promise<BarcodeScannerResult>; /** * Applies the given filters to the given image, and returns its URI. */ applyImageFilters(params: { imageFileUri: string; filters: ParametricFilter[]; }): Promise<ApplyImageFiltersResult>; /** * Applies the given filters to the given page. * * @deprecated Use {@link ScanbotSDK.Document.modifyPage} instead. */ applyImageFiltersOnPage(params: { page: Page; filters: ParametricFilter[]; }): Promise<ApplyImageFiltersOnPageResult>; /** * Returns the BASE64 Image Data for the given image. */ getImageData(params: { imageFileUri: string; }): Promise<ImageDataResult>; /** * Rotates the given image by the specified degrees. */ rotateImage(params: { imageFileUri: string; degrees: number; }): Promise<RotateImageResult>; /** * Creates a page with the image located at the given URI. * * @deprecated Use {@link ScanbotSDK.Document.createDocument} instead. */ createPage(params: { imageUri: string; }): Promise<CreatePageResult>; /** * Removes the given page from the storage. * * @deprecated Use {@link ScanbotSDK.Document.removePage} instead. */ removePage(params: { page: Page; }): Promise<void>; /** * Rotates the given page for the number of 90 degree counterclockwise rotations. Negative values will rotate clockwise. * * @deprecated Use {@link ScanbotSDK.Document.modifyPage} instead. */ rotatePage(params: { page: Page; times: number; }): Promise<RotatePageResult>; /** * Applies the given image to the desired page. * * @deprecated Use {@link ScanbotSDK.Document} instead. */ setDocumentImage(params: { page: Page; imageFileUri: string; }): Promise<SetDocumentImageResult>; /** * Detects a document on the given image and returns the result. */ detectDocument(params: { imageFileUri: string; }): Promise<DetectDocumentResult>; /** * Detects a document on the given page and returns the result. * * @deprecated Use {@link ScanbotSDK.Document} instead. */ detectDocumentOnPage(params: { page: Page; }): Promise<DetectDocumentOnPageResult>; /** * Detects the quality of the document on a still image. */ documentQualityAnalyzer(imageFileUri: string, configuration: DocumentQualityAnalyzerConfiguration): Promise<DocumentQualityAnalyzerResult>; /** * Extracts images from a PDF represented by the file URL. The PDF file URL is part of the input params. */ extractImagesFromPdf(params: ExtractImagesFromPdfArguments): Promise<ExtractImagesFromPdfResult>; /** * Extracts images from a PDF represented by the file URL, creates pages from them and returns the created pages. * The PDF file URL is part of the input params. * * @deprecated Use {@link ScanbotSDK.Document.createDocumentFromPDF} instead. */ extractPagesFromPdf(params: ExtractPagesFromPdfArguments): Promise<ExtractPagesFromPdfResult>; /** * Recognizes a check in the given image using the preferred configuration. */ recognizeCheck(imageFileUri: string, configuration: CheckScannerConfiguration): Promise<CheckScanningResult>; /** * Recognizes an MRZ on the given image. */ recognizeMrz(imageFileUri: string, configuration: MrzScannerConfiguration): Promise<MrzScannerResult>; /** * Recognizes a Medical Certificate on the given image. * Modify the result with extra options that are part of the input params. */ recognizeMedicalCertificate(imageFileUri: string, configuration: MedicalCertificateScanningParameters): Promise<MedicalCertificateScanningResult>; /** * Recognizes a European Health Insurance Card (EHIC) on the given image. * * @deprecated Use {@link documentDataExtractor} instead and enable ***EuropeanHealthInsuranceCardConfiguration*** configuration element. */ recognizeEHIC(imageFileUri: string, configuration: EuropeanHealthInsuranceCardRecognizerConfiguration): Promise<EuropeanHealthInsuranceCardRecognitionResult>; /** * Recognizes a Credit Card on the given image. * Modify the result with extra options that are part of the configuration. */ recognizeCreditCard(imageFileUri: string, configuration: CreditCardScannerConfiguration): Promise<CreditCardScanningResult>; /** * Extract data on the given image. * Set the expected document formats or leave it empty/undefined to recognize all supported document formats. */ documentDataExtractor(imageFileUri: string, configuration: DocumentDataExtractorConfiguration): Promise<DocumentDataExtractionResult>; /** * Recreates the given pages to refresh the Image URIs. * * @deprecated Use {@link ScanbotSDK.Document} instead. */ refreshImageUris(params: { pages: Page[]; }): Promise<RefreshImageUrisResult>; /** * Returns the available OCR configs. */ getOCRConfigs(): Promise<OCRConfigsResult>; /** * Removes all files generated by this plugin. */ cleanup(): Promise<void>; /** * Performs OCR on given images. Set preferred ***ocrConfiguration*** engine, or leave it undefined to use the default one which is ***OCRScanbotEngineConfiguration***. * If ***OCRTesseractConfiguration*** is used, the expected ***languages*** need to be set. */ performOCR(params: PerformOCRArguments): Promise<PerformOCRResult>; /** * Creates a PDF using the given list of image file URIs. * Please check the extra options that are part of the input params to modify the created PDF file per your needs. */ createPDF(params: CreatePDFArguments): Promise<CreatePDFResult>; /** * Creates a TIFF using the given list of image file URIs. * Please check the extra options that are part of the input params to modify the created TIFF file per your needs. */ writeTIFF(params: WriteTIFFArguments): Promise<WriteTIFFResult>; /** * Verifies the given document parts using the DocumentDataExtractorConfiguration. */ verifyDocument(documentParts: GenericDocument[], configuration: DocumentDataExtractorConfiguration): Promise<DocumentVerificationReport>; /** * Register analytics service callback to receive analytics events. */ setAnalyticsSubscriber(subscriber: AnalyticsSubscriber | null): Promise<void>; /** * Mock camera preview by using static images as a frame source. * This is useful for testing purposes. */ mockCamera(params: MockCameraParams): Promise<void>; }; export type ScanbotSDK = typeof ScanbotSDK; export type ScanbotDocument = typeof ScanbotDocument; export * from './analytics/index'; export * from './barcode/index'; export * from './base/index'; export * from './check/CheckScannerTypes'; export * from './credit_card/CreditCardTypes'; export * from './document_data_extractor/index'; export * from './document_scanner/index'; export * from './documents/index'; export * from './dqa/DocumentQualityAnalyzerTypes'; export * from './ehic/EuropeanHealthInsuranceCardTypes'; export * from './frame_accumulation/FrameAccumulationTypes'; export * from './image_filters/ParametricFilters'; export * from './imageRef/index'; export * from './medical_certificate/MedicalCertificateTypes'; export * from './mrz/MrzTypes'; export * from './ocr_renderer/PdfConfigurationTypes'; export * from './text_pattern_scanner/TextPatternScannerTypes'; export * from './tiff_wrapper/TiffTypes'; export * from './utils/index'; export * from './vin/VinScannerTypes';