-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImageInput.js
67 lines (56 loc) · 1.88 KB
/
ImageInput.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { inputType } from "./InputType.js";
import { Input } from "./Input.js";
import { align } from "./Align.js";
import { vAlign } from "./VAlign.js";
import { ImageResource } from "./ImageResource.js";
/**
* Represents an image input.
*/
export class ImageInput extends Input {
/**
* Initializes a new instance of the `ImageInput` class.
* @param {ImageResource | string} resource object to create ImageInput. | The image file path present in cloud resource manager.
*/
constructor(resource) {
super(resource);
this._Type = inputType.image;
}
/** Gets or sets the scaleX of the image. */
scaleX;
/** Gets or sets the scaleY of the image. */
scaleY;
/** Gets or sets a boolean indicating whether to expand the image. */
expandToFit;
/** Gets or sets a boolean indicating whether to shrink the image. */
shrinkToFit;
/** Gets or sets the horizontal alignment of the image. */
align = align.center;
/** Gets or sets the vertical alignment of the image. */
vAlign = vAlign.center;
/** Gets or sets the start page. */
startPage;
/** Gets or sets the page count. */
pageCount;
toJSON() {
return {
scaleX: this.scaleX,
scaleY: this.scaleY,
topMargin: this.topMargin,
leftMargin: this.leftMargin,
bottomMargin: this.bottomMargin,
rightMargin: this.rightMargin,
pageWidth: this.pageWidth,
pageHeight: this.pageHeight,
expandToFit: this.expandToFit,
shrinkToFit: this.shrinkToFit,
align: this.align,
vAlign: this.vAlign,
startPage: this.startPage,
pageCount: this.pageCount,
type: this._Type,
resourceName: this.resourceName,
id: this.id,
templateId: this._templateId,
}
}
}