capacitor-plugin-scanbot-sdk
Version:
Scanbot Document and Barcode Scanner SDK for Capacitor
92 lines (90 loc) • 2.8 kB
JavaScript
/// 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 {
/** @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 {
/** @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 {
/** @param source {@displayType `DeepPartial<AspectRatio>`} */
constructor(source = {}) {
super();
/**
Width component of the aspect ratio.
Default is 1.0
*/
this.width = 1.0;
/**
Height component of the aspect ratio.
Default is 1.0
*/
this.height = 1.0;
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