UNPKG

react-native-scanbot-sdk

Version:

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

121 lines (110 loc) 2.73 kB
/// Auto-generated with ScanbotSDKCodegenV3. Modifications will be overwritten. /// Generated from core/schemas/Geometry.yaml import { ToJsonConfiguration } from '../../utils/json/JsonSerializationTypes'; import { PartiallyConstructible } from '../../utils/utils'; /** Represents a line segment in 2D space. */ export class LineSegmentInt extends PartiallyConstructible { /** Start point of the segment. */ /** End point of the segment. */ /** @param source {@displayType `DeepPartial<LineSegmentInt>`} */ constructor(source = {}) { super(); if (source.start !== undefined) { this.start = { x: source.start.x, y: source.start.y }; } else { throw new Error('start must be present in constructor argument'); } if (source.end !== undefined) { this.end = { x: source.end.x, y: source.end.y }; } else { throw new Error('end must be present in constructor argument'); } } serialize(config = new ToJsonConfiguration()) { return { start: this.start, end: this.end }; } } /** Represents a line segment in 2D space. */ export class LineSegmentFloat extends PartiallyConstructible { /** Start point of the segment. */ /** End point of the segment. */ /** @param source {@displayType `DeepPartial<LineSegmentFloat>`} */ constructor(source = {}) { super(); if (source.start !== undefined) { this.start = { x: source.start.x, y: source.start.y }; } else { throw new Error('start must be present in constructor argument'); } if (source.end !== undefined) { this.end = { x: source.end.x, y: source.end.y }; } else { throw new Error('end must be present in constructor argument'); } } serialize(config = new ToJsonConfiguration()) { return { start: this.start, end: this.end }; } } /** Aspect ratio is the ratio of the width to the height of an image or screen. */ export class AspectRatio extends PartiallyConstructible { /** Width component of the aspect ratio. Default is 1.0 */ width = 1.0; /** Height component of the aspect ratio. Default is 1.0 */ height = 1.0; /** @param source {@displayType `DeepPartial<AspectRatio>`} */ constructor(source = {}) { super(); if (source.width !== undefined) { this.width = source.width; } if (source.height !== undefined) { this.height = source.height; } } serialize(config = new ToJsonConfiguration()) { return { width: this.width, height: this.height }; } } //# sourceMappingURL=Geometry.js.map