lucid-extension-sdk 0.0.196 → 0.0.197
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.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SimpleImageFill } from '../core/properties/fillcolor';
|
|
2
|
+
import { Box } from '../math';
|
|
3
|
+
/**
|
|
4
|
+
* The information required to create a new image block on the current document
|
|
5
|
+
*/
|
|
6
|
+
export interface ImageDefinition {
|
|
7
|
+
/**
|
|
8
|
+
* The initial location and size of the block on the page.
|
|
9
|
+
*/
|
|
10
|
+
boundingBox: Box;
|
|
11
|
+
/**
|
|
12
|
+
* Settings for using an image as the fill style of a block.
|
|
13
|
+
*/
|
|
14
|
+
fillStyle: SimpleImageFill;
|
|
15
|
+
}
|
package/document/pageproxy.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { BlockProxy } from './blockproxy';
|
|
|
6
6
|
import { RuleProxy } from './documentelement/ruleproxy';
|
|
7
7
|
import { ElementProxy } from './elementproxy';
|
|
8
8
|
import { GroupProxy } from './groupproxy';
|
|
9
|
+
import { ImageDefinition } from './imagedefinition';
|
|
9
10
|
import { LineDefinition } from './linedefinition';
|
|
10
11
|
import { LineProxy } from './lineproxy';
|
|
11
12
|
import { MapProxy } from './mapproxy';
|
|
@@ -72,6 +73,7 @@ export declare class PageProxy extends ElementProxy {
|
|
|
72
73
|
* @returns The added line
|
|
73
74
|
*/
|
|
74
75
|
addLine(def: LineDefinition): LineProxy;
|
|
76
|
+
addImage(def: ImageDefinition): Promise<BlockProxy>;
|
|
75
77
|
/**
|
|
76
78
|
* Updates the page of this page
|
|
77
79
|
* @param title The new title for this page
|
package/document/pageproxy.js
CHANGED
|
@@ -113,6 +113,10 @@ class PageProxy extends elementproxy_1.ElementProxy {
|
|
|
113
113
|
line.setEndpoint2(def.endpoint2);
|
|
114
114
|
return line;
|
|
115
115
|
}
|
|
116
|
+
async addImage(def) {
|
|
117
|
+
await this.client.loadBlockClasses(['UserImage2Block']);
|
|
118
|
+
return this.addBlock(Object.assign({ className: 'UserImage2Block' }, def));
|
|
119
|
+
}
|
|
116
120
|
/**
|
|
117
121
|
* Updates the page of this page
|
|
118
122
|
* @param title The new title for this page
|