lucid-extension-sdk 0.0.206 → 0.0.207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SimpleImageFill } from '../core/properties/fillcolor';
|
|
2
|
+
import { StrokeStyle } from '../core/properties/strokestyle';
|
|
2
3
|
import { Box } from '../math';
|
|
3
4
|
/**
|
|
4
5
|
* The information required to create a new image block on the current document
|
|
@@ -12,4 +13,28 @@ export interface ImageDefinition {
|
|
|
12
13
|
* Settings for using an image as the fill style of a block.
|
|
13
14
|
*/
|
|
14
15
|
fillStyle: SimpleImageFill;
|
|
16
|
+
/**
|
|
17
|
+
* The opacity (0 - 1) for this image (default is 1).
|
|
18
|
+
*/
|
|
19
|
+
opacity?: number;
|
|
20
|
+
/**
|
|
21
|
+
* the border color for this image (default is black, #000000).
|
|
22
|
+
*/
|
|
23
|
+
lineColor?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The border width in pixels for this image (default is 1).
|
|
26
|
+
*/
|
|
27
|
+
lineWidth?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The stroke style for the border of this image (default is Solid).
|
|
30
|
+
*/
|
|
31
|
+
strokeStyle?: StrokeStyle;
|
|
32
|
+
/**
|
|
33
|
+
* The rounding for this image (default is 0).
|
|
34
|
+
*/
|
|
35
|
+
rounding?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The rotation for this image (deafult is 0).
|
|
38
|
+
*/
|
|
39
|
+
rotation?: number;
|
|
15
40
|
}
|
package/document/pageproxy.d.ts
CHANGED
|
@@ -69,15 +69,15 @@ export declare class PageProxy extends ElementProxy {
|
|
|
69
69
|
*/
|
|
70
70
|
addBlock(def: BlockDefinition): BlockProxy;
|
|
71
71
|
/**
|
|
72
|
-
* Add a new line to this page
|
|
72
|
+
* Add a new line to this page.
|
|
73
73
|
* @param def The definition of the new line to add
|
|
74
74
|
* @returns The added line
|
|
75
75
|
*/
|
|
76
76
|
addLine(def: LineDefinition): LineProxy;
|
|
77
77
|
/**
|
|
78
|
-
* Add a new image to this page
|
|
78
|
+
* Add a new image to this page.
|
|
79
79
|
* @param def The definition of the new image to add
|
|
80
|
-
* @returns The added image
|
|
80
|
+
* @returns The added image
|
|
81
81
|
*/
|
|
82
82
|
addImage(def: ImageDefinition): Promise<BlockProxy>;
|
|
83
83
|
/**
|
package/document/pageproxy.js
CHANGED
|
@@ -100,7 +100,7 @@ class PageProxy extends elementproxy_1.ElementProxy {
|
|
|
100
100
|
return block;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
* Add a new line to this page
|
|
103
|
+
* Add a new line to this page.
|
|
104
104
|
* @param def The definition of the new line to add
|
|
105
105
|
* @returns The added line
|
|
106
106
|
*/
|
|
@@ -114,13 +114,25 @@ class PageProxy extends elementproxy_1.ElementProxy {
|
|
|
114
114
|
return line;
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
|
-
* Add a new image to this page
|
|
117
|
+
* Add a new image to this page.
|
|
118
118
|
* @param def The definition of the new image to add
|
|
119
|
-
* @returns The added image
|
|
119
|
+
* @returns The added image
|
|
120
120
|
*/
|
|
121
121
|
async addImage(def) {
|
|
122
122
|
await this.client.loadBlockClasses(['UserImage2Block']);
|
|
123
|
-
return this.addBlock(
|
|
123
|
+
return this.addBlock({
|
|
124
|
+
className: 'UserImage2Block',
|
|
125
|
+
boundingBox: def.boundingBox,
|
|
126
|
+
fillStyle: def.fillStyle,
|
|
127
|
+
properties: {
|
|
128
|
+
opactiy: def.opacity,
|
|
129
|
+
lineColor: def.lineColor,
|
|
130
|
+
lineWidth: def.lineWidth,
|
|
131
|
+
strokeStyle: def.strokeStyle,
|
|
132
|
+
rounding: def.rounding,
|
|
133
|
+
rotation: def.rotation,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
124
136
|
}
|
|
125
137
|
/**
|
|
126
138
|
* Updates the page of this page
|