UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

148 lines (138 loc) 3.4 kB
import { ParametricFilter } from '../image_filters/ParametricFilters'; import { PdfConfiguration } from '../ocr_renderer/PdfConfigurationTypes'; import { TiffGeneratorParameters } from '../tiff_wrapper/TiffTypes'; import { Point } from '../utils'; import { OCRConfiguration } from './arguments'; import { Page } from './types'; export interface CreateDocumentParams { /** * Image URIs that will be used to create the document. If empty or undefined, empty document will be created. */ imageFileUris?: string[]; /** * The maximum size of the document image. * Default is 0, no limit. */ documentImageSizeLimit?: number; /** * The list of filters applied to the page. */ filters?: ParametricFilter[]; /** * Recognizes documents on created document. * Default is true. */ documentDetection?: boolean; } export interface DocumentFromLegacyPagesParams { /** * Legacy pages. */ pages: Page[]; /** * The maximum size of the document image. * Default is 0, no limit. */ documentImageSizeLimit?: number; } export interface PDFFromDocumentParams { /** * The ID of the document for which the PDF file will be created. */ documentID: string; /** * Set PDF configuration for the file that is created. */ pdfConfiguration: PdfConfiguration; /** * Set OCR configuration for the file that is created. */ ocrConfiguration?: OCRConfiguration; } export interface TIFFFromDocumentParams { /** * The ID of the document for which the TIFF file will be created. */ documentID: string; /** * Configure TIFF file that is created. */ configuration: TiffGeneratorParameters; } export interface AddPageParams { /** * Document ID to which this page will be added. */ documentID: string; /** * Image URI that will be used to create a page. */ imageFileUri: string; /** * The list of filters applied to the page. */ filters?: ParametricFilter[]; /** * Set preferred index at which new page should be added. */ index?: number; /** * Recognizes documents on created document. * Default is true. */ documentDetection?: boolean; } export interface MovePageParams { /** * Document ID in which this page exists. */ documentID: string; /** * Current index of the page. */ fromIndex: number; /** * Destination index. */ toIndex: number; } export interface ModifyPageParams { /** * Document ID in which this page exists. */ documentID: string; /** * Page by its ID that will be modified. */ pageID: string; /** * The type of rotation to apply. If not specified, no rotation is applied. */ rotation?: PageRotation; /** * The array of recognition polygon points to apply. */ polygon?: Point[]; /** * The list of filters to apply. */ filters?: ParametricFilter[]; } export interface RemovePageParams { /** * The ID of the document from which this page is to be removed. */ documentID: string; /** * Page by its ID to be removed. */ pageID: string; } /** Rotation of a page. */ export type PageRotation = /** A 90 degree clockwise rotation is applied to the page. */ | 'CLOCKWISE_90' /** A 180 degree rotation is applied to the page. */ | 'CLOCKWISE_180' /** A 90 degree counter-clockwise rotation is applied to the page. */ | 'COUNTERCLOCKWISE_90';