UNPKG

react-native-scanbot-sdk

Version:

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

55 lines (45 loc) 1.71 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from core/schemas/JSONSerializationTypes.yaml import { DeepPartial, PartiallyConstructible } from '../../utils/utils'; /** Configuration used to serialize an object to json. */ export class ToJsonConfiguration extends PartiallyConstructible { /** Serialize images in the object to json. If false, then fields that contain images are not serialized. Default is true */ public readonly serializeImages: boolean = true; /** Image serialization mode. Default is REFERENCE */ public readonly imageSerializationMode: ImageSerializationMode = 'REFERENCE'; /** @param source {@displayType `DeepPartial<ToJsonConfiguration>`} */ public constructor(source: DeepPartial<ToJsonConfiguration> = {}) { super(); if (source.serializeImages !== undefined) { this.serializeImages = source.serializeImages; } if (source.imageSerializationMode !== undefined) { this.imageSerializationMode = source.imageSerializationMode; } } public serialize( config: ToJsonConfiguration = new ToJsonConfiguration() ): DeepPartial<ToJsonConfiguration> { return { serializeImages: this.serializeImages, imageSerializationMode: this.imageSerializationMode, }; } } /** Image serialization mode. Applicable only when serializeImages is true. - `REFERENCE`: Images are serialized as references to native resources. - `BUFFER`: Images are serialized as base64 encoded buffers. */ export type ImageSerializationMode = 'REFERENCE' | 'BUFFER'; export const ImageSerializationModeValues: ImageSerializationMode[] = ['REFERENCE', 'BUFFER'];