@adobe/ccweb-add-on-sdk-types 1.1.0 → 1.1.1
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.
- package/package.json +10 -1
- package/sandbox/express-document-sdk.d.ts +147 -120
- package/ui/ui-sdk.d.ts +64 -3
package/package.json
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/ccweb-add-on-sdk-types",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"author": "Adobe",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"adobe",
|
|
9
|
+
"creative cloud web",
|
|
10
|
+
"express",
|
|
11
|
+
"add-on",
|
|
12
|
+
"typescript",
|
|
13
|
+
"sdk",
|
|
14
|
+
"typings"
|
|
15
|
+
],
|
|
7
16
|
"main": "",
|
|
8
17
|
"types": "index.d.ts",
|
|
9
18
|
"repository": {
|
|
@@ -30,20 +30,8 @@ declare namespace ApiConstants {
|
|
|
30
30
|
|
|
31
31
|
declare interface ApiModuleExport {
|
|
32
32
|
editor: ExpressEditor;
|
|
33
|
-
utils: ApiUtils;
|
|
34
33
|
constants: unknown;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
declare interface ApiUtils {
|
|
38
|
-
/**
|
|
39
|
-
* Create a new Color. All color components should be in a 0 - 1 range.
|
|
40
|
-
*
|
|
41
|
-
* @param red - The red component in a range from 0 - 1.
|
|
42
|
-
* @param green - The green component in a range from 0 - 1.
|
|
43
|
-
* @param blue - The blue component in a range from 0 - 1.
|
|
44
|
-
* @param alpha - (optional) The alpha component in a range from 0 - 1. Defaults to 1 (fully opaque).
|
|
45
|
-
*/
|
|
46
|
-
createColor(red: number, green: number, blue: number, alpha?: number): Color;
|
|
34
|
+
colorUtils: ExpressColorUtils;
|
|
47
35
|
}
|
|
48
36
|
|
|
49
37
|
/**
|
|
@@ -82,7 +70,20 @@ export declare class ArtboardList extends RestrictedItemList<ArtboardNode> {
|
|
|
82
70
|
*
|
|
83
71
|
* When multiple artboards exist on a page, the artboards represent "scenes" in a linear timeline sequence.
|
|
84
72
|
*/
|
|
85
|
-
export declare class ArtboardNode extends
|
|
73
|
+
export declare class ArtboardNode extends BaseNode implements IRectangularNode, ContainerNode {
|
|
74
|
+
/**
|
|
75
|
+
* Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
|
|
76
|
+
* GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
|
|
77
|
+
* hold children in various discrete "slots"; this `allChildren` list includes *all* such children and reflects their
|
|
78
|
+
* overall display z-order.
|
|
79
|
+
*
|
|
80
|
+
* The children of an Artboard are always other Node classes (never the more minimal BaseNode).
|
|
81
|
+
*/
|
|
82
|
+
get allChildren(): Readonly<Iterable<Node>>;
|
|
83
|
+
/**
|
|
84
|
+
* The node's children. Use the methods on this ItemList object to get, add, and remove children.
|
|
85
|
+
*/
|
|
86
|
+
get children(): ItemList<Node>;
|
|
86
87
|
/**
|
|
87
88
|
* The node's parent. Undefined if the node is an orphan.
|
|
88
89
|
*/
|
|
@@ -96,14 +97,44 @@ export declare class ArtboardNode extends ContainerNode implements IRectangularN
|
|
|
96
97
|
*/
|
|
97
98
|
get height(): number;
|
|
98
99
|
/**
|
|
99
|
-
* The background fill of the artboard.
|
|
100
|
+
* The background fill of the artboard. Artboards must always have a fill.
|
|
100
101
|
*/
|
|
101
|
-
get fill(): Fill
|
|
102
|
+
get fill(): Readonly<Fill>;
|
|
102
103
|
set fill(fill: Fill);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* A "node" represents an object in the scenegraph, the document's visual content tree. This base class includes only the
|
|
108
|
+
* most fundamental nonvisual properties that even nodes near the top of the document structure share (such as PageNode).
|
|
109
|
+
* The more tangible visual content typically extends the richer Node class which extends BaseNode with additional
|
|
110
|
+
* properties.
|
|
111
|
+
*/
|
|
112
|
+
export declare class BaseNode {
|
|
103
113
|
/**
|
|
104
|
-
*
|
|
114
|
+
* Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
|
|
115
|
+
* GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
|
|
116
|
+
* hold children in various discrete "slots"; this `allChildren` list includes *all* such children and reflects their
|
|
117
|
+
* overall display z-order.
|
|
118
|
+
*
|
|
119
|
+
* Although BaseNode's allChildren may yield other BaseNodes, the subclasses Node and ArtboardNode override allChildren
|
|
120
|
+
* to guarantee all their children are full-fledged Node instances.
|
|
121
|
+
*/
|
|
122
|
+
get allChildren(): Readonly<Iterable<BaseNode>>;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The node's type.
|
|
126
|
+
*/
|
|
127
|
+
get type(): SceneNodeType;
|
|
128
|
+
/**
|
|
129
|
+
* The node's parent. Undefined if the node is an orphan, or if the node is the artwork root.
|
|
105
130
|
*/
|
|
106
|
-
get
|
|
131
|
+
get parent(): BaseNode | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* Removes the node from its parent - for a basic ContainerNode, this is equivalent to `node.parent.children.remove(node)`.
|
|
134
|
+
* For nodes with other slots, removes the child from whichever slot it resides in, if possible. Throws if the slot does
|
|
135
|
+
* not support removal. Also throws if node is the artwork root. No-op if node is already an orphan.
|
|
136
|
+
*/
|
|
137
|
+
removeFromParent(): void;
|
|
107
138
|
}
|
|
108
139
|
|
|
109
140
|
/**
|
|
@@ -166,33 +197,25 @@ declare enum BlendMode {
|
|
|
166
197
|
}
|
|
167
198
|
|
|
168
199
|
/**
|
|
169
|
-
* Represents
|
|
200
|
+
* Represents an RGBA color.
|
|
170
201
|
*/
|
|
171
|
-
export declare
|
|
202
|
+
export declare interface Color {
|
|
172
203
|
/**
|
|
173
204
|
* The red channel in range from 0 - 1.
|
|
174
205
|
*/
|
|
175
|
-
|
|
206
|
+
red: number;
|
|
176
207
|
/**
|
|
177
208
|
* The green channel in range from 0 - 1.
|
|
178
209
|
*/
|
|
179
|
-
|
|
210
|
+
green: number;
|
|
180
211
|
/**
|
|
181
212
|
* The blue channel in range from 0 - 1.
|
|
182
213
|
*/
|
|
183
|
-
|
|
214
|
+
blue: number;
|
|
184
215
|
/**
|
|
185
216
|
* The alpha channel in range from 0 - 1.
|
|
186
217
|
*/
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* This color's color space. Currently only sRGB is supported.
|
|
190
|
-
*/
|
|
191
|
-
get colorSpace(): ColorSpace;
|
|
192
|
-
/**
|
|
193
|
-
* Get the color in 8-digit hex "#RRGGBBAA" format.
|
|
194
|
-
*/
|
|
195
|
-
getHex(): string;
|
|
218
|
+
alpha: number;
|
|
196
219
|
}
|
|
197
220
|
|
|
198
221
|
/**
|
|
@@ -206,16 +229,44 @@ export declare interface ColorFill extends Fill {
|
|
|
206
229
|
/**
|
|
207
230
|
* The fill color.
|
|
208
231
|
*/
|
|
209
|
-
|
|
232
|
+
color: Color;
|
|
210
233
|
}
|
|
211
234
|
|
|
212
235
|
/**
|
|
213
|
-
*
|
|
236
|
+
* Utility methods for working with color values.
|
|
214
237
|
*/
|
|
215
|
-
export declare
|
|
216
|
-
|
|
238
|
+
export declare class ColorUtils {
|
|
239
|
+
/**
|
|
240
|
+
* Create a new Color. All color components should be in a 0 - 1 range.
|
|
241
|
+
*
|
|
242
|
+
* @param redOrPartialColor - The red component in a range from 0 - 1; or Partial Color object having alpha component as partial.
|
|
243
|
+
* @param green - The green component in a range from 0 - 1.
|
|
244
|
+
* @param blue - The blue component in a range from 0 - 1.
|
|
245
|
+
* @param alpha - (optional) The alpha component in a range from 0 - 1. Defaults to 1 (fully opaque).
|
|
246
|
+
*/
|
|
247
|
+
fromRGB(red: number, green: number, blue: number, alpha?: number): Color;
|
|
248
|
+
fromRGB(color: { red: number; green: number; blue: number; alpha?: number }): Color;
|
|
249
|
+
/**
|
|
250
|
+
* Create a new color from its equivalent RGBA hex representation. Currently only
|
|
251
|
+
* supports formats "#RRGGBBAA" or "RRGGBBAA". If the hex value is invalid, this
|
|
252
|
+
* method will return transparent black.
|
|
253
|
+
*
|
|
254
|
+
* @param hex - The color in hex representation.
|
|
255
|
+
* @returns A new color matching the given hex representation, or transparent black if
|
|
256
|
+
* the hex string cannot be parsed.
|
|
257
|
+
*/
|
|
258
|
+
fromHex(hex: string): Color;
|
|
259
|
+
/**
|
|
260
|
+
* Get the color in 8-digit hex "#RRGGBBAA" format.
|
|
261
|
+
* @privateRemarks
|
|
262
|
+
* Future: Since this format is only valid for the sRGB color space, if the color is in another color space once other
|
|
263
|
+
* spaces are supported, the value return here would be a lossy conversion.
|
|
264
|
+
*/
|
|
265
|
+
toHex(color: Color): string;
|
|
217
266
|
}
|
|
218
267
|
|
|
268
|
+
export declare const colorUtils: ExpressColorUtils;
|
|
269
|
+
|
|
219
270
|
/**
|
|
220
271
|
* A ComplexShapeNode is complex prepackaged shape that appears as a leaf node in the UI, even if it is composed
|
|
221
272
|
* of multiple separate paths.
|
|
@@ -225,11 +276,14 @@ export declare class ComplexShapeNode extends FillableNode {}
|
|
|
225
276
|
export declare const constants: typeof ApiConstants;
|
|
226
277
|
|
|
227
278
|
/**
|
|
228
|
-
*
|
|
279
|
+
* Interface for any node that contains an entirely generic collection of children. Some ContainerNode classes may host
|
|
229
280
|
* *additional* children in other specific "slots," such as background or mask layers; and non-ContainerNode classes may
|
|
230
281
|
* also hold children in specified "slots." Use {@link Node.allChildren} for read access to children regardless of node type.
|
|
282
|
+
*
|
|
283
|
+
* Some ContainerNode classes may be full-fledged Node subclasses (such as Group), while others may be a subclass of the
|
|
284
|
+
* more minimal BaseNode (such as Artboard).
|
|
231
285
|
*/
|
|
232
|
-
export declare
|
|
286
|
+
export declare interface ContainerNode extends BaseNode {
|
|
233
287
|
/**
|
|
234
288
|
* The node's children. Use the methods on this ItemList object to get, add, and remove children.
|
|
235
289
|
*/
|
|
@@ -280,12 +334,12 @@ export declare class Editor {
|
|
|
280
334
|
*/
|
|
281
335
|
get documentRoot(): ExpressRootNode;
|
|
282
336
|
/**
|
|
283
|
-
* @returns an ellipse node with default x/y radii, and
|
|
337
|
+
* @returns an ellipse node with default x/y radii, a black fill, and no initial stroke.
|
|
284
338
|
* Transform values default to 0.
|
|
285
339
|
*/
|
|
286
340
|
createEllipse(): EllipseNode;
|
|
287
341
|
/**
|
|
288
|
-
* @returns a rectangle node with default width and height, and
|
|
342
|
+
* @returns a rectangle node with default width and height, a black fill, and no initial stroke.
|
|
289
343
|
* Transform values default to 0.
|
|
290
344
|
*/
|
|
291
345
|
createRectangle(): RectangleNode;
|
|
@@ -299,10 +353,10 @@ export declare class Editor {
|
|
|
299
353
|
*/
|
|
300
354
|
createGroup(): GroupNode;
|
|
301
355
|
/**
|
|
356
|
+
* Convenience helper to create a complete ColorFill value given just its color.
|
|
302
357
|
* @param color - The color to use for the fill.
|
|
303
|
-
* @returns a solid color fill.
|
|
304
358
|
*/
|
|
305
|
-
|
|
359
|
+
makeColorFill(color: Color): ColorFill;
|
|
306
360
|
/**
|
|
307
361
|
* Creates a bitmap image, represented as a multi-node MediaContainerNode structure. Always creates a "full-frame,"
|
|
308
362
|
* uncropped image initially, but cropping can be changed after it is created by modifying the properties of the
|
|
@@ -337,20 +391,20 @@ export declare class Editor {
|
|
|
337
391
|
*/
|
|
338
392
|
loadBitmapImage(bitmapData: Blob): Promise<BitmapImage>;
|
|
339
393
|
/**
|
|
340
|
-
*
|
|
394
|
+
* Convenience helper to create a complete Stroke value given just a subset of its fields. All other fields are
|
|
395
|
+
* populated with default values.
|
|
396
|
+
*
|
|
397
|
+
* See {@link Stroke} for more details on the `options` fields. Defaults:
|
|
341
398
|
* - `color` has default value {@link DEFAULT_STROKE_COLOR} if none is provided.
|
|
342
399
|
* - `width` has default value {@link DEFAULT_STROKE_WIDTH} if none is provided.
|
|
343
|
-
* - `
|
|
344
|
-
*
|
|
345
|
-
* - `dashOffset` has default value 0 if none is provided. This
|
|
400
|
+
* - `position` has default value `center` if none is provided.
|
|
401
|
+
* - `dashPattern` has default value [] if none is provided.
|
|
402
|
+
* - `dashOffset` has default value 0 if none is provided. This field is ignored
|
|
346
403
|
* if no `dashPattern` was provided.
|
|
347
404
|
*
|
|
348
|
-
* The stroke's `position` field cannot be specified via options yet because only
|
|
349
|
-
* {@link StrokePosition.center} is supported.
|
|
350
|
-
*
|
|
351
405
|
* @returns a stroke configured with the given options.
|
|
352
406
|
*/
|
|
353
|
-
|
|
407
|
+
makeStroke(options?: Partial<Stroke>): Stroke;
|
|
354
408
|
/**
|
|
355
409
|
* @returns a text node with default styles. The text content is initially empty, so the text node will be
|
|
356
410
|
* invisible until its `text` property is set. Creates point text, so the node's width will automatically
|
|
@@ -424,12 +478,14 @@ export declare class EllipseNode extends FillableNode {
|
|
|
424
478
|
declare const expressApiModule: ApiModuleExport;
|
|
425
479
|
export default expressApiModule;
|
|
426
480
|
|
|
481
|
+
declare class ExpressColorUtils extends ColorUtils {}
|
|
482
|
+
|
|
427
483
|
declare class ExpressEditor extends Editor {}
|
|
428
484
|
|
|
429
485
|
/**
|
|
430
486
|
* An ExpressRootNode represents the root node of the document's "scenegraph" artwork tree.
|
|
431
487
|
*/
|
|
432
|
-
export declare class ExpressRootNode extends
|
|
488
|
+
export declare class ExpressRootNode extends BaseNode {
|
|
433
489
|
/**
|
|
434
490
|
* The pages of the document. All visual content is contained on artboards within the pages.
|
|
435
491
|
*/
|
|
@@ -451,9 +507,10 @@ export declare interface Fill {
|
|
|
451
507
|
*/
|
|
452
508
|
export declare class FillableNode extends StrokableNode implements IFillableNode {
|
|
453
509
|
/**
|
|
454
|
-
*
|
|
510
|
+
* The fill applied to the shape, if any.
|
|
455
511
|
*/
|
|
456
|
-
get
|
|
512
|
+
get fill(): Readonly<Fill> | undefined;
|
|
513
|
+
set fill(fill: Fill | undefined);
|
|
457
514
|
}
|
|
458
515
|
|
|
459
516
|
/**
|
|
@@ -494,7 +551,7 @@ export declare class GridLayoutNode extends Node implements IRectangularNode {
|
|
|
494
551
|
/**
|
|
495
552
|
* The background fill of the GridLayout.
|
|
496
553
|
*/
|
|
497
|
-
get fill(): Fill
|
|
554
|
+
get fill(): Readonly<Fill>;
|
|
498
555
|
set fill(fill: Fill);
|
|
499
556
|
}
|
|
500
557
|
|
|
@@ -502,7 +559,7 @@ export declare class GridLayoutNode extends Node implements IRectangularNode {
|
|
|
502
559
|
* A GroupNode represents a Group object in the scenegraph, which has a collection of generic children as well as a separate,
|
|
503
560
|
* optional vector mask child.
|
|
504
561
|
*/
|
|
505
|
-
export declare class GroupNode extends ContainerNode {
|
|
562
|
+
export declare class GroupNode extends Node implements ContainerNode {
|
|
506
563
|
/**
|
|
507
564
|
* The Group's regular children. Does not include the maskShape if one is present.
|
|
508
565
|
* Use the methods on this ItemList object to get, add, and remove children.
|
|
@@ -523,11 +580,11 @@ export declare class GroupNode extends ContainerNode {
|
|
|
523
580
|
}
|
|
524
581
|
|
|
525
582
|
/**
|
|
526
|
-
* Interface for {@link FillableNode} *and* any other nodes with a similar `
|
|
527
|
-
* FillableNode class.
|
|
583
|
+
* Interface for {@link FillableNode} *and* any other nodes with a similar `fill` property that do not directly inherit from
|
|
584
|
+
* the FillableNode class.
|
|
528
585
|
*/
|
|
529
586
|
declare interface IFillableNode {
|
|
530
|
-
|
|
587
|
+
fill: Fill | undefined;
|
|
531
588
|
}
|
|
532
589
|
|
|
533
590
|
/**
|
|
@@ -559,11 +616,11 @@ declare interface IRectangularNode {
|
|
|
559
616
|
}
|
|
560
617
|
|
|
561
618
|
/**
|
|
562
|
-
* Interface for {@link StrokableNode} *and* any other nodes with a similar `
|
|
563
|
-
* the StrokableNode class. (See {@link ArtboardNode}, for example).
|
|
619
|
+
* Interface for {@link StrokableNode} *and* any other nodes with a similar `stroke` property that do not directly inherit
|
|
620
|
+
* from the StrokableNode class. (See {@link ArtboardNode}, for example).
|
|
564
621
|
*/
|
|
565
622
|
declare interface IStrokableNode {
|
|
566
|
-
|
|
623
|
+
stroke: Stroke | undefined;
|
|
567
624
|
}
|
|
568
625
|
|
|
569
626
|
/**
|
|
@@ -640,31 +697,23 @@ export declare class LineNode extends StrokableNode {
|
|
|
640
697
|
*/
|
|
641
698
|
get endY(): number;
|
|
642
699
|
/**
|
|
643
|
-
* The shape encapsulating the start of a line.
|
|
644
|
-
* depends on the first available stroke's weight and color assigned to the node.
|
|
645
|
-
* Removal of all strokes on this line leads to the arrowhead's removal.
|
|
700
|
+
* The shape encapsulating the start of a line.
|
|
646
701
|
*
|
|
647
|
-
*
|
|
648
|
-
* or no arrowhead on the first stroke of the line.
|
|
702
|
+
* Returns {@link ArrowHeadType.none} if there is no stroke on the line.
|
|
649
703
|
*/
|
|
650
704
|
get startArrowHeadType(): ArrowHeadType;
|
|
651
705
|
/**
|
|
652
|
-
* The setter
|
|
653
|
-
* and updates the arrowhead on only the first stroke of the line.
|
|
706
|
+
* The setter sets a default stroke on the line if it did not have one.
|
|
654
707
|
*/
|
|
655
708
|
set startArrowHeadType(type: ArrowHeadType);
|
|
656
709
|
/**
|
|
657
|
-
* The shape encapsulating the end of a line.
|
|
658
|
-
* depends on the first available stroke's weight and color assigned to the node.
|
|
659
|
-
* Removal of all strokes on this line leads to the arrowhead's removal.
|
|
710
|
+
* The shape encapsulating the end of a line.
|
|
660
711
|
*
|
|
661
|
-
*
|
|
662
|
-
* or no arrowhead on the first stroke of the line.
|
|
712
|
+
* Returns {@link ArrowHeadType.none} if there is no stroke on the line.
|
|
663
713
|
*/
|
|
664
714
|
get endArrowHeadType(): ArrowHeadType;
|
|
665
715
|
/**
|
|
666
|
-
* The setter
|
|
667
|
-
* and updates the arrowhead on only the first stroke of the line.
|
|
716
|
+
* The setter sets a default stroke on the line if it did not have one.
|
|
668
717
|
*/
|
|
669
718
|
set endArrowHeadType(type: ArrowHeadType);
|
|
670
719
|
}
|
|
@@ -696,21 +745,21 @@ export declare class MediaContainerNode extends Node {
|
|
|
696
745
|
}
|
|
697
746
|
|
|
698
747
|
/**
|
|
699
|
-
* A Node represents an object in the scenegraph, the document's visual content tree.
|
|
748
|
+
* A Node represents an object in the scenegraph, the document's visual content tree. Most tangible visual content is a
|
|
749
|
+
* subclass of Node, but note that some abstract top-level structural nodes (such as PageNode) only extend the more minimal
|
|
750
|
+
* BaseNode. As a general rule, if you can click or drag an object with the select/move tool in the UI, then it extends
|
|
751
|
+
* from Node.
|
|
700
752
|
*/
|
|
701
|
-
declare class Node {
|
|
753
|
+
declare class Node extends BaseNode {
|
|
702
754
|
/**
|
|
703
755
|
* Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or
|
|
704
756
|
* GroupNode also provide a mutable {@link ContainerNode.children} list. Other nodes with a more specific structure can
|
|
705
757
|
* hold children in various discrete "slots"; this `allChildren` list includes *all* such children and reflects their
|
|
706
758
|
* overall display z-order.
|
|
759
|
+
*
|
|
760
|
+
* The children of a Node are always other Node classes (never the more minimal BaseNode).
|
|
707
761
|
*/
|
|
708
762
|
get allChildren(): Readonly<Iterable<Node>>;
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* The node's type.
|
|
712
|
-
*/
|
|
713
|
-
get type(): SceneNodeType;
|
|
714
763
|
/**
|
|
715
764
|
* The translation of the node along its parent's axes. This is identical to the translation component of
|
|
716
765
|
* `transformMatrix`. It is often simpler to set a node's position using `setPositionInParent` than by
|
|
@@ -760,16 +809,6 @@ declare class Node {
|
|
|
760
809
|
* cumulative rotation from the node's parent containers.
|
|
761
810
|
*/
|
|
762
811
|
get rotationInScreen(): number;
|
|
763
|
-
/**
|
|
764
|
-
* The node's parent. Undefined if the node is an orphan, or if the node is the artwork root.
|
|
765
|
-
*/
|
|
766
|
-
get parent(): Node | undefined;
|
|
767
|
-
/**
|
|
768
|
-
* Removes the node from its parent - for a basic ContainerNode, this is equivalent to `node.parent.children.remove(node)`.
|
|
769
|
-
* For nodes with other slots, removes the child from whichever slot it resides in, if possible. Throws if the slot does
|
|
770
|
-
* not support removal. Also throws if node is the artwork root. No-op if node is already an orphan.
|
|
771
|
-
*/
|
|
772
|
-
removeFromParent(): void;
|
|
773
812
|
/**
|
|
774
813
|
* The node's opacity, from 0.0 to 1.0
|
|
775
814
|
*/
|
|
@@ -816,7 +855,7 @@ export declare class PageList extends RestrictedItemList<PageNode> {
|
|
|
816
855
|
* A PageNode represents a page in the document. A page contains one or more artboards, representing "scenes" in a linear
|
|
817
856
|
* timeline sequence. Those artboards in turn contain all the visual content of the document.
|
|
818
857
|
*/
|
|
819
|
-
export declare class PageNode extends
|
|
858
|
+
export declare class PageNode extends BaseNode implements Readonly<IRectangularNode> {
|
|
820
859
|
/**
|
|
821
860
|
* The artboards or "scenes" of a page, ordered by timeline sequence.
|
|
822
861
|
*/
|
|
@@ -1048,7 +1087,7 @@ export declare class SolidColorShapeNode extends Node {
|
|
|
1048
1087
|
/**
|
|
1049
1088
|
* The color of the single color shape.
|
|
1050
1089
|
*/
|
|
1051
|
-
get color(): Color | undefined;
|
|
1090
|
+
get color(): Readonly<Color> | undefined;
|
|
1052
1091
|
set color(color: Color | undefined);
|
|
1053
1092
|
}
|
|
1054
1093
|
|
|
@@ -1057,43 +1096,39 @@ export declare class SolidColorShapeNode extends Node {
|
|
|
1057
1096
|
*/
|
|
1058
1097
|
export declare class StrokableNode extends Node implements IStrokableNode {
|
|
1059
1098
|
/**
|
|
1060
|
-
*
|
|
1099
|
+
* The stroke applied to the shape, if any.
|
|
1061
1100
|
*/
|
|
1062
|
-
get
|
|
1101
|
+
get stroke(): Readonly<Stroke> | undefined;
|
|
1102
|
+
set stroke(stroke: Stroke | undefined);
|
|
1063
1103
|
}
|
|
1064
1104
|
|
|
1065
1105
|
/**
|
|
1066
1106
|
* Represents a stroke in the scenegraph. See {@link StrokableNode}.
|
|
1067
1107
|
*/
|
|
1068
|
-
export declare interface Stroke
|
|
1069
|
-
/**
|
|
1070
|
-
* The position of the stroke relative to the outline of the shape.
|
|
1071
|
-
*/
|
|
1072
|
-
readonly position: StrokePosition;
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
/**
|
|
1076
|
-
* Properties that can be provided to create a stroke.
|
|
1077
|
-
*/
|
|
1078
|
-
export declare interface StrokeOptions {
|
|
1108
|
+
export declare interface Stroke {
|
|
1079
1109
|
/**
|
|
1080
1110
|
* The color of a stroke.
|
|
1081
1111
|
*/
|
|
1082
|
-
|
|
1112
|
+
color: Color;
|
|
1083
1113
|
/**
|
|
1084
1114
|
* The thickness of a stroke. Must be from {@link MIN_STROKE_WIDTH} to {@link MAX_STROKE_WIDTH}.
|
|
1085
1115
|
*/
|
|
1086
|
-
|
|
1116
|
+
width: number;
|
|
1087
1117
|
/**
|
|
1088
1118
|
* If empty, this is a solid stroke.
|
|
1089
1119
|
* If non-empty, the values alternate between length of a rendered and blank segment,
|
|
1090
1120
|
* repeated along the length of the stroke. The first value represents the first solid segment.
|
|
1121
|
+
* Array must be of even length. Values cannot be negative.
|
|
1091
1122
|
*/
|
|
1092
|
-
|
|
1123
|
+
dashPattern: number[];
|
|
1093
1124
|
/**
|
|
1094
1125
|
* Number of pixels the beginning of dash pattern should be offset along the stroke.
|
|
1095
1126
|
*/
|
|
1096
|
-
|
|
1127
|
+
dashOffset: number;
|
|
1128
|
+
/**
|
|
1129
|
+
* The position of the stroke relative to the outline of the shape.
|
|
1130
|
+
*/
|
|
1131
|
+
position: StrokePosition;
|
|
1097
1132
|
}
|
|
1098
1133
|
|
|
1099
1134
|
/**
|
|
@@ -1112,13 +1147,7 @@ declare enum StrokePosition {
|
|
|
1112
1147
|
* A StrokeShapeNode is prepackaged shape that has a single stroke property and appears as a leaf node in the UI, even
|
|
1113
1148
|
* if it is composed of multiple separate paths.
|
|
1114
1149
|
*/
|
|
1115
|
-
export declare class StrokeShapeNode extends
|
|
1116
|
-
/**
|
|
1117
|
-
* Stroke on the shape.
|
|
1118
|
-
*/
|
|
1119
|
-
get stroke(): Stroke | undefined;
|
|
1120
|
-
set stroke(stroke: Stroke | undefined);
|
|
1121
|
-
}
|
|
1150
|
+
export declare class StrokeShapeNode extends StrokableNode {}
|
|
1122
1151
|
|
|
1123
1152
|
/**
|
|
1124
1153
|
* <InlineAlert slots="text" variant="warning"/>
|
|
@@ -1151,6 +1180,4 @@ export declare class TextNode extends Node {
|
|
|
1151
1180
|
*/
|
|
1152
1181
|
export declare class UnknownNode extends Node {}
|
|
1153
1182
|
|
|
1154
|
-
export declare const utils: ApiUtils;
|
|
1155
|
-
|
|
1156
1183
|
export {};
|
package/ui/ui-sdk.d.ts
CHANGED
|
@@ -562,6 +562,10 @@ declare interface Document_2 {
|
|
|
562
562
|
* Create renditions
|
|
563
563
|
*/
|
|
564
564
|
createRenditions(renditionOptions: RenditionOptions, renditionIntent?: RenditionIntent): Promise<Rendition[]>;
|
|
565
|
+
/**
|
|
566
|
+
* Get metadata of all or range of pages of the document
|
|
567
|
+
*/
|
|
568
|
+
getPagesMetadata(options: PageMetadataOptions): Promise<PageMetadata[]>;
|
|
565
569
|
/**
|
|
566
570
|
* Get document id
|
|
567
571
|
*/
|
|
@@ -792,6 +796,53 @@ export declare interface OAuth {
|
|
|
792
796
|
authorizeWithOwnRedirect(request: AuthorizeWithOwnRedirectRequest): Promise<AuthorizationResult>;
|
|
793
797
|
}
|
|
794
798
|
|
|
799
|
+
/**
|
|
800
|
+
* Represents the metadata of the Page
|
|
801
|
+
*/
|
|
802
|
+
export declare interface PageMetadata {
|
|
803
|
+
/**
|
|
804
|
+
* Unique id that represent the given page
|
|
805
|
+
*/
|
|
806
|
+
id: string;
|
|
807
|
+
/**
|
|
808
|
+
* Page title
|
|
809
|
+
*/
|
|
810
|
+
title: string;
|
|
811
|
+
/**
|
|
812
|
+
* Page size in pixels
|
|
813
|
+
*/
|
|
814
|
+
size: {
|
|
815
|
+
width: number;
|
|
816
|
+
height: number;
|
|
817
|
+
};
|
|
818
|
+
/**
|
|
819
|
+
* Whether page contains any premium content
|
|
820
|
+
*/
|
|
821
|
+
hasPremiumContent: boolean;
|
|
822
|
+
/**
|
|
823
|
+
* Whether page contains timelines
|
|
824
|
+
*/
|
|
825
|
+
hasTemporalContent: boolean;
|
|
826
|
+
/**
|
|
827
|
+
* Pixels per inch of the page
|
|
828
|
+
*/
|
|
829
|
+
pixelsPerInch?: number;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Options for fetching page metadata
|
|
834
|
+
*/
|
|
835
|
+
export declare interface PageMetadataOptions {
|
|
836
|
+
/**
|
|
837
|
+
* Page range of the document to get the metadata
|
|
838
|
+
*/
|
|
839
|
+
range: Range_2;
|
|
840
|
+
/**
|
|
841
|
+
* Ids of the pages (Only required if the range is "specificPages")
|
|
842
|
+
*/
|
|
843
|
+
pageIds?: string[];
|
|
844
|
+
}
|
|
845
|
+
|
|
795
846
|
export declare interface PageRendition extends Rendition {
|
|
796
847
|
/**
|
|
797
848
|
* Page rendition type
|
|
@@ -801,6 +852,10 @@ export declare interface PageRendition extends Rendition {
|
|
|
801
852
|
* Page title
|
|
802
853
|
*/
|
|
803
854
|
title: string;
|
|
855
|
+
/**
|
|
856
|
+
* Page metadata
|
|
857
|
+
*/
|
|
858
|
+
metadata: PageMetadata;
|
|
804
859
|
}
|
|
805
860
|
|
|
806
861
|
export declare interface PngRenditionOptions extends RenditionOptions {
|
|
@@ -857,7 +912,11 @@ declare enum Range_2 {
|
|
|
857
912
|
/**
|
|
858
913
|
* Generate rendition for all the pages
|
|
859
914
|
*/
|
|
860
|
-
entireDocument = "entireDocument"
|
|
915
|
+
entireDocument = "entireDocument",
|
|
916
|
+
/**
|
|
917
|
+
* Generate rendition for specific pages
|
|
918
|
+
*/
|
|
919
|
+
specificPages = "specificPages"
|
|
861
920
|
}
|
|
862
921
|
export { Range_2 as Range };
|
|
863
922
|
|
|
@@ -958,6 +1017,10 @@ export declare interface RenditionOptions {
|
|
|
958
1017
|
* Format of the rendition
|
|
959
1018
|
*/
|
|
960
1019
|
format: RenditionFormat;
|
|
1020
|
+
/**
|
|
1021
|
+
* Ids of the pages (Only required if the range is "specificPages")
|
|
1022
|
+
*/
|
|
1023
|
+
pageIds?: string[];
|
|
961
1024
|
}
|
|
962
1025
|
|
|
963
1026
|
/**
|
|
@@ -980,7 +1043,6 @@ export declare interface Runtime {
|
|
|
980
1043
|
dialog?: Dialog;
|
|
981
1044
|
|
|
982
1045
|
/**
|
|
983
|
-
* @experimental - Experimental API
|
|
984
1046
|
* Exposes the concrete object/function of type T,
|
|
985
1047
|
* which can be accessed into different runtime part of this AddOn e.g., "document model sandbox" runtime.
|
|
986
1048
|
* Note that only concrete objects / class instances are supported. We can't expose entire class
|
|
@@ -995,7 +1057,6 @@ export declare interface Runtime {
|
|
|
995
1057
|
*/
|
|
996
1058
|
exposeApi?<T>(apiObj: T): void;
|
|
997
1059
|
/**
|
|
998
|
-
* @experimental - Experimental API
|
|
999
1060
|
* Requests a promise based proxy object for other runtimes, which will be used
|
|
1000
1061
|
* by this UI runtime to directly call the APIs exposed (using exposeApi) from the other runtimes.
|
|
1001
1062
|
* await or .then is necessary, since returned object is a promise.
|