UNPKG

capacitor-plugin-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK for Capacitor

68 lines (67 loc) 2.37 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from native/schemas/document/DocumentData.yaml import { PageData } from '../document_scanner/PageData'; import { ToJsonConfiguration } from '../utils/json/JsonSerializationTypes'; import { PartiallyConstructible } from '../utils/utils'; /** Document Data. */ export class DocumentData extends PartiallyConstructible { /** @param source {@displayType `DeepPartial<DocumentData>`} */ constructor(source = {}) { super(); /** The maximum size of the document image. Default is 0 */ this.documentImageSizeLimit = 0; if (source.uuid !== undefined) { this.uuid = source.uuid; } else { throw new Error('uuid must be present in constructor argument'); } if (source.creationTimestamp !== undefined) { this.creationTimestamp = source.creationTimestamp; } else { throw new Error('creationTimestamp must be present in constructor argument'); } if (source.pages !== undefined) { this.pages = source.pages.map((it) => { return new PageData(it); }); } else { throw new Error('pages must be present in constructor argument'); } if (source.documentImageSizeLimit !== undefined) { this.documentImageSizeLimit = source.documentImageSizeLimit; } if (source.pdfURI !== undefined) { this.pdfURI = source.pdfURI; } else { throw new Error('pdfURI must be present in constructor argument'); } if (source.tiffURI !== undefined) { this.tiffURI = source.tiffURI; } else { throw new Error('tiffURI must be present in constructor argument'); } } serialize(config = new ToJsonConfiguration()) { return { uuid: this.uuid, creationTimestamp: this.creationTimestamp, pages: this.pages.map((it) => { return it.serialize(config); }), documentImageSizeLimit: this.documentImageSizeLimit, pdfURI: this.pdfURI, tiffURI: this.tiffURI, }; } } //# sourceMappingURL=DocumentData.js.map