/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from xplatforms/schemas/document_scanner/Document.yaml import { ScanbotDocumentImpl } from './impl'; import { AddPageOptions } from './types/base/AddPageOptions'; import { CreateDocumentOptions } from './types/base/CreateDocumentOptions'; import { ImageInput, ResultWrapper } from './types/base/customTypes'; import { ModifyPageOptions } from './types/base/ModifyPageOptions'; import { Page } from './types/base/types'; import { DocumentQualityAnalyzerConfiguration, DocumentQualityAnalyzerResult, } from './types/core/document_quality_analyzer/DocumentQualityAnalyzerTypes'; import { DocumentData } from './types/core/document_scanner/DocumentData'; import { DocumentScannerConfiguration, DocumentScanningResult, } from './types/core/document_scanner/DocumentScannerTypes'; import { CroppingConfiguration } from './types/core/ui_v2/document/CroppingConfiguration'; import { DocumentScanningFlow } from './types/core/ui_v2/document/DocumentScanningFlow'; /** * Entry point for all document features. */ export const ScanbotDocument = { /** * Creates a document from the provided images with the specified options. * @param {ImageInput[]} params.images - The images to be used for document creation. * @param {CreateDocumentOptions} params.options - The options to be used for document creation. * @returns {Promise} - Created document. */ async createDocumentFromImages(params: { images?: ImageInput[]; options?: CreateDocumentOptions; }): Promise { return ScanbotDocumentImpl.createDocumentFromImages(params); }, /** * Creates a document from the provided PDF file with the specified options. * @param {string} params.pdfFileUri - The PDF file uri to be used for document creation. * @param {CreateDocumentOptions} params.options - The options to be used for document creation. * @returns {Promise} - Created document. */ async createDocumentFromPdf(params: { pdfFileUri: string; options?: CreateDocumentOptions; }): Promise { return ScanbotDocumentImpl.createDocumentFromPdf(params); }, /** * Creates a document from the provided legacy pages with the specified image size limit. * @param {Page[]} params.pages - The legacy pages to be used for document creation. Legacy filters that are set on the pages will be ignored. Please switch to ParametricFilters instead. * @param {number} params.documentImageSizeLimit - The maximum size of the longest edge of the document image. If the image exceeds this limit, it will be downscaled proportionally. Default is 0 * @returns {Promise} - Created document. * @deprecated */ async createDocumentFromLegacyPages(params: { pages: Page[]; documentImageSizeLimit?: number; }): Promise { return ScanbotDocumentImpl.createDocumentFromLegacyPages(params); }, /** * Checks if a document with the specified Uuid exists. * @param {string} documentUuid - The Uuid of the document. * @returns {Promise} - True if the document exists, false otherwise. */ async documentExists(documentUuid: string): Promise { return ScanbotDocumentImpl.documentExists(documentUuid); }, /** * Loads the document with the specified Uuid. * @param {string} documentUuid - The Uuid of the document. * @returns {Promise} - Loaded document. */ async loadDocument(documentUuid: string): Promise { return ScanbotDocumentImpl.loadDocument(documentUuid); }, /** * Retrieves the Uuids of all stored documents. * @returns {Promise} - List of stored document Uuids. */ async getStoredDocumentUuids(): Promise { return ScanbotDocumentImpl.getStoredDocumentUuids(); }, /** * Clones the document with the specified Uuid. * @param {string} documentUuid - The Uuid of the document to be cloned. * @returns {Promise} - Cloned document. */ async cloneDocument(documentUuid: string): Promise { return ScanbotDocumentImpl.cloneDocument(documentUuid); }, /** * Deletes the document with the specified Uuid. * @param {string} documentUuid - The Uuid of the document to be deleted. * @returns {Promise} */ async deleteDocument(documentUuid: string): Promise { return ScanbotDocumentImpl.deleteDocument(documentUuid); }, /** * Deletes all stored documents. * @returns {Promise} */ async deleteAllDocuments(): Promise { return ScanbotDocumentImpl.deleteAllDocuments(); }, /** * Adds new pages from the provided images to the document with the specified Uuid. * @param {string} params.documentUuid - The Uuid of the document to which pages will be added. * @param {ImageInput[]} params.images - The images to be added as new pages. * @param {AddPageOptions} params.options - The options to be used when adding pages. * @returns {Promise} - Updated document with added pages. */ async addPages(params: { documentUuid: string; images: ImageInput[]; options?: AddPageOptions; }): Promise { return ScanbotDocumentImpl.addPages(params); }, /** * Moves a page within the document to a new position. * @param {string} params.documentUuid - The Uuid of the document containing the page to be moved. * @param {number} params.fromIndex - The index of the page to be moved. * @param {number} params.toIndex - The new index position for the page. * @returns {Promise} - Updated document with the page moved to the new position. */ async movePage(params: { documentUuid: string; fromIndex: number; toIndex: number; }): Promise { return ScanbotDocumentImpl.movePage(params); }, /** * Modifies a page within the document using the specified options. * @param {string} params.documentUuid - The Uuid of the document containing the page to be modified. * @param {string} params.pageUuid - The Uuid of the page to be modified. * @param {ModifyPageOptions} params.options - The options specifying the modifications to be made to the page. * @returns {Promise} - Updated document with the modified page. */ async modifyPage(params: { documentUuid: string; pageUuid: string; options?: ModifyPageOptions; }): Promise { return ScanbotDocumentImpl.modifyPage(params); }, /** * Removes pages with the specified Uuids from the document. * @param {string} params.documentUuid - The Uuid of the document from which pages will be removed. * @param {string[]} params.pageUuids - The Uuids of the pages to be removed. * @returns {Promise} - Updated document with the specified pages removed. */ async removePages(params: { documentUuid: string; pageUuids: string[] }): Promise { return ScanbotDocumentImpl.removePages(params); }, /** * Removes all pages from the document with the specified Uuid. * @param {string} documentUuid - The Uuid of the document from which all pages will be removed. * @returns {Promise} - Updated document with all pages removed. */ async removeAllPages(documentUuid: string): Promise { return ScanbotDocumentImpl.removeAllPages(documentUuid); }, /** * Opens the Ready-To-Use UI Document Scanner screen with the desired configuration. * @param {DocumentScanningFlow} configuration - The configuration to be used for the document scanner. * @returns {Promise>} - Scanned document. */ async startScanner(configuration: DocumentScanningFlow): Promise> { return ScanbotDocumentImpl.startScanner(configuration); }, /** * Opens the Ready-To-Use UI Cropping screen with the desired configuration. * @param {CroppingConfiguration} configuration - The configuration to be used for the cropping screen. * @returns {Promise>} - Updated document after cropping. */ async startCroppingScreen( configuration: CroppingConfiguration ): Promise> { return ScanbotDocumentImpl.startCroppingScreen(configuration); }, /** * Scans a document from the provided image. * @param {ImageInput} params.image - The image to be scanned. * @param {DocumentScannerConfiguration} params.configuration - The configuration to be used for scanning. * @returns {Promise} - Result of the scanning process. */ async scanFromImage(params: { image: ImageInput; configuration: DocumentScannerConfiguration; }): Promise { return ScanbotDocumentImpl.scanFromImage(params); }, /** * Analyzes the quality of the document on the provided image. * @param {ImageInput} params.image - The image to be analyzed. * @param {DocumentQualityAnalyzerConfiguration} params.configuration - The configuration to be used for analysis. * @returns {Promise} - Result of the quality analysis. */ async analyzeQualityOnImage(params: { image: ImageInput; configuration: DocumentQualityAnalyzerConfiguration; }): Promise { return ScanbotDocumentImpl.analyzeQualityOnImage(params); }, };