capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
453 lines • 16.5 kB
JavaScript
import { registerPlugin } from '@capacitor/core';
import { BarcodeScannerResult } from './barcode/BarcodeScannerTypes';
import { CheckScanningResult } from './check/CheckScannerTypes';
import { CreditCardScanningResult } from './credit_card/CreditCardTypes';
import { DocumentDataExtractionResult } from './document_data_extractor/DocumentDataExtractorTypes';
import { DocumentQualityAnalyzerResult } from './dqa/DocumentQualityAnalyzerTypes';
import { EuropeanHealthInsuranceCardRecognitionResult, } from './ehic/EuropeanHealthInsuranceCardTypes';
import { MedicalCertificateScanningResult } from './medical_certificate/MedicalCertificateTypes';
import { MrzScannerResult } from './mrz/MrzTypes';
import { mapRTUUIListResult, mapRTUUIResult } from './utils/utils';
const _registeredPlugin = registerPlugin('ScanbotSDKCapacitor', {});
/** @internal */
export const _ScanbotSDKInternalUiV2 = _registeredPlugin;
/** @internal */
export const ScanbotSDKInternal = _registeredPlugin;
const ScanbotDocument = {
/**
* Create a new document.
*/
createDocument(params) {
return ScanbotSDKInternal.createDocument(params);
},
/**
* Create a new document from legacy pages.
*/
createDocumentFromLegacyPages(params) {
return ScanbotSDKInternal.createDocumentFromLegacyPages(params);
},
/**
* Create a new document from PDF file.
*/
createDocumentFromPDF(params) {
return ScanbotSDKInternal.createDocumentFromPDF(params);
},
/**
* Check if a document with the given ID exists.
*/
documentExists(params) {
return ScanbotSDKInternal.documentExists(params);
},
/**
* Load a document by its ID.
*/
loadDocument(params) {
return ScanbotSDKInternal.loadDocument(params);
},
/**
* Gets all stored document IDs.
*/
storedDocumentIDs() {
return ScanbotSDKInternal.storedDocumentIDs();
},
/**
* Clone a document by its ID.
*/
cloneDocument(params) {
return ScanbotSDKInternal.cloneDocument(params);
},
/**
* Delete a document by its ID.
*/
deleteDocument(params) {
return ScanbotSDKInternal.deleteDocument(params);
},
/**
* Delete all documents.
*/
deleteAllDocuments() {
return ScanbotSDKInternal.deleteAllDocuments();
},
/**
* 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) {
return ScanbotSDKInternal.createPDFForDocument(params);
},
/**
* 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) {
return ScanbotSDKInternal.createTIFF(params);
},
/**
* Add a new page to a document and return the updated document.
*/
addPage(params) {
return ScanbotSDKInternal.addPage(params);
},
/**
* Move a page in a document and return the updated document.
*/
movePage(params) {
return ScanbotSDKInternal.movePage(params);
},
/**
* Modify a page in a document and return the updated document.
*/
modifyPage(params) {
return ScanbotSDKInternal.modifyPage(params);
},
/**
* Remove a page from a document.
*/
removePage(params) {
return ScanbotSDKInternal.removePageFromDocument(params);
},
/**
* Remove all pages from a document in one batch operation.
*/
removeAllPages(params) {
return ScanbotSDKInternal.removeAllPages(params);
},
};
export const ScanbotSDK = {
Document: ScanbotDocument,
/**
* 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) {
return ScanbotSDKInternal.startDocumentScanner(configuration);
},
/**
* Forces the Ready-To-Use UI Document Scanner screen to close while it is running.
*
* @deprecated
*/
closeDocumentScanner() {
return ScanbotSDKInternal.closeDocumentScanner();
},
/**
* 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) {
return ScanbotSDKInternal.startFinderDocumentScanner(configuration);
},
/**
* Forces the Ready-To-Use UI Finder Document Scanner screen to close while it is running.
*
* @deprecated
*/
closeFinderDocumentScanner() {
return ScanbotSDKInternal.closeFinderDocumentScanner();
},
/**
* 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) {
return ScanbotSDKInternal.startCroppingScreen(params);
},
/**
* Forces the Ready-To-Use UI Cropping screen to close while it is running.
*
* @deprecated
*/
closeCroppingScreen() {
return ScanbotSDKInternal.closeCroppingScreen();
},
/**
* 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.
*/
async startEHICScanner(configuration) {
return ScanbotSDKInternal.startEHICScanner(configuration).then((result) => mapRTUUIResult(result, EuropeanHealthInsuranceCardRecognitionResult));
},
/**
* Forces the Ready-To-Use UI European Health Insurance Card Scanner screen to close while it is running.
*
* @deprecated
*/
closeEHICScanner() {
return ScanbotSDKInternal.closeEHICScanner();
},
/**
* Opens the Ready-To-Use UI Medical Certificate Scanner screen with the desired configuration.
*/
async startMedicalCertificateScanner(configuration) {
return ScanbotSDKInternal.startMedicalCertificateScanner(configuration).then((result) => mapRTUUIResult(result, MedicalCertificateScanningResult));
},
/**
* Forces the Ready-To-Use UI Medical Certificate Scanner screen to close while it is running.
*/
closeMedicalCertificateScanner() {
return ScanbotSDKInternal.closeMedicalCertificateScanner();
},
/**
* Opens the Ready-To-Use UI Document Data Extractor screen with the desired configuration.
*/
async startDocumentDataExtractor(configuration) {
return ScanbotSDKInternal.startDocumentDataExtractor(configuration).then((result) => mapRTUUIListResult(result, DocumentDataExtractionResult));
},
/**
* Forces the Ready-To-Use UI Document Data Extractor screen to close while it is running.
*/
closeDocumentDataExtractor() {
return ScanbotSDKInternal.closeDocumentDataExtractor();
},
/**
* Opens the Ready-To-Use UI Check Scanner screen with the desired configuration.
*/
async startCheckScanner(configuration) {
return ScanbotSDKInternal.startCheckScanner(configuration).then((result) => mapRTUUIResult(result, CheckScanningResult));
},
/**
* Forces the Ready-To-Use UI Check Scanner screen to close while it is running.
*/
closeCheckScanner() {
return ScanbotSDKInternal.closeCheckScanner();
},
/**
* Opens the Ready-To-Use UI VIN Scanner screen with the desired configuration.
*/
startVinScanner(configuration) {
return ScanbotSDKInternal.startVinScanner(configuration);
},
/**
* Forces the Ready-To-Use UI VIN Scanner screen to close while it is running.
*/
closeVinScanner() {
return ScanbotSDKInternal.closeVinScanner();
},
/**
* Initializes the Scanbot SDK with the preferred configuration.
*/
initializeSDK(config) {
return ScanbotSDKInternal.initializeSDK(config);
},
/**
* Provides complete information about the current license status.
*/
getLicenseInfo() {
return ScanbotSDKInternal.getLicenseInfo();
},
/**
* Detects barcodes on the image represented by the file URI.
*/
async detectBarcodesOnImage(imageFileUri, configuration) {
return ScanbotSDKInternal.detectBarcodesOnImage({
imageFileUri: imageFileUri,
configuration: configuration,
}).then((result) => new BarcodeScannerResult(result));
},
/**
* Applies the given filters to the given image, and returns its URI.
*/
applyImageFilters(params) {
return ScanbotSDKInternal.applyImageFilters(params);
},
/**
* Applies the given filters to the given page.
*/
applyImageFiltersOnPage(params) {
return ScanbotSDKInternal.applyImageFiltersOnPage(params);
},
/**
* Returns the BASE64 Image Data for the given image.
*/
getImageData(params) {
return ScanbotSDKInternal.getImageData(params);
},
/**
* Rotates the given image by the specified degrees.
*/
rotateImage(params) {
return ScanbotSDKInternal.rotateImage(params);
},
/**
* Creates a page with the image located at the given URI.
*/
createPage(params) {
return ScanbotSDKInternal.createPage(params);
},
/**
* Removes the given page from the storage.
*/
removePage(params) {
return ScanbotSDKInternal.removePage(params);
},
/**
* Rotates the given page for the number of 90 degree counterclockwise rotations. Negative values will rotate clockwise.
*/
rotatePage(params) {
return ScanbotSDKInternal.rotatePage(params);
},
/**
* Applies the given image to the desired page.
*/
setDocumentImage(params) {
return ScanbotSDKInternal.setDocumentImage(params);
},
/**
* Detects document on the given image and returns the result.
*/
detectDocument(params) {
return ScanbotSDKInternal.detectDocument(params);
},
/**
* Detects document on the given page and returns the result.
*/
detectDocumentOnPage(params) {
return ScanbotSDKInternal.detectDocumentOnPage(params);
},
/**
* Detects the quality of the document on a still image.
*/
async documentQualityAnalyzer(imageFileUri, configuration) {
return ScanbotSDKInternal.documentQualityAnalyzer({
imageFileUri: imageFileUri,
configuration: configuration,
}).then((result) => new DocumentQualityAnalyzerResult(result));
},
/**
* Extracts images from a PDF represented by the file URL. The PDF file URL is part of the input params.
*/
extractImagesFromPdf(params) {
return ScanbotSDKInternal.extractImagesFromPdf(params);
},
/**
* 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.
*/
extractPagesFromPdf(params) {
return ScanbotSDKInternal.extractPagesFromPdf(params);
},
/**
* Recognizes a Check on the given image.
* Set desired check standards or leave it empty/undefined to recognize all supported checks.
*/
async recognizeCheck(imageFileUri, configuration, acceptedCheckStandards) {
return ScanbotSDKInternal.recognizeCheck({
imageFileUri: imageFileUri,
configuration: configuration,
acceptedCheckStandards: acceptedCheckStandards,
}).then((result) => new CheckScanningResult(result));
},
/**
* Recognizes an MRZ on the given image.
*/
async recognizeMrz(imageFileUri, configuration) {
return ScanbotSDKInternal.recognizeMrz({
imageFileUri: imageFileUri,
configuration: configuration,
}).then((result) => new MrzScannerResult(result));
},
/**
* Recognizes a Medical Certificate on the given image.
* Modify the result with extra options that are part of the input params.
*/
async recognizeMedicalCertificate(imageFileUri, configuration) {
return ScanbotSDKInternal.recognizeMedicalCertificate({
imageFileUri: imageFileUri,
configuration: configuration,
}).then((result) => new MedicalCertificateScanningResult(result));
},
/**
* Recognizes a European Health Insurance Card (EHIC) on the given image.
*
* @deprecated Use ***documentDataExtractor*** instead and enable ***EuropeanHealthInsuranceCardConfiguration*** configuration element.
*/
async recognizeEHIC(imageFileUri, configuration) {
return ScanbotSDKInternal.recognizeEHIC({
imageFileUri: imageFileUri,
configuration: configuration,
}).then((result) => new EuropeanHealthInsuranceCardRecognitionResult(result));
},
/**
* Recognizes a Credit Card on the given image.
* Modify the result with extra options that are part of the configuration.
*/
async recognizeCreditCard(imageFileUri, configuration) {
return ScanbotSDKInternal.recognizeCreditCard({
imageFileUri: imageFileUri,
configuration: configuration,
}).then((result) => new CreditCardScanningResult(result));
},
/**
* Extract data on the given image.
* Set the expected document formats or leave it empty/undefined to recognize all supported document formats.
*/
async documentDataExtractor(imageFileUri, configuration) {
return ScanbotSDKInternal.documentDataExtractor({
imageFileUri: imageFileUri,
configuration: configuration,
}).then((result) => new DocumentDataExtractionResult(result));
},
/**
* Recreates the given pages to refresh the Image URIs.
*/
refreshImageUris(params) {
return ScanbotSDKInternal.refreshImageUris(params);
},
/**
* Returns the available OCR configs.
*/
getOCRConfigs() {
return ScanbotSDKInternal.getOCRConfigs();
},
/**
* Removes all files generated by this plugin.
*/
cleanup() {
return ScanbotSDKInternal.cleanup();
},
/**
* 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) {
return ScanbotSDKInternal.performOCR(params);
},
/**
* 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) {
return ScanbotSDKInternal.createPDF(params);
},
/**
* 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) {
return ScanbotSDKInternal.writeTIFF(params);
},
};
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 './imageRef/index';
export * from './image_filters/ParametricFilters';
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';
//# sourceMappingURL=index.js.map