UNPKG

react-native-scanbot-sdk

Version:

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

40 lines (37 loc) 1.23 kB
import { DeepPartial, PartiallyConstructible } from '../../utils'; /** Configuration of the cropping result. */ export class CroppingResult extends PartiallyConstructible { /** The UUID of the document that was cropped. */ public readonly documentUuid: string; /** The UUID of the page of the document that was cropped. */ public readonly pageUuid: string; /** The error message if a problem occurred. */ public readonly errorMessage: string | null; /** @param source {@displayType `DeepPartial<CroppingResult>`} */ public constructor(source: DeepPartial<CroppingResult> = {}) { super(); if (source.documentUuid !== undefined) { this.documentUuid = source.documentUuid; } else { throw new Error('documentUuid must be present in constructor argument'); } if (source.pageUuid !== undefined) { this.pageUuid = source.pageUuid; } else { throw new Error('pageUuid must be present in constructor argument'); } if (source.errorMessage !== undefined) { this.errorMessage = source.errorMessage != null ? source.errorMessage : null; } else { throw new Error('errorMessage must be present in constructor argument'); } } }