@adobe/ccweb-add-on-sdk-types 1.9.1 → 1.11.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/ccweb-add-on-sdk-types",
3
- "version": "1.9.1",
3
+ "version": "1.11.0",
4
4
  "author": "Adobe",
5
5
  "license": "MIT",
6
6
  "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
@@ -39,7 +39,6 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "tslib": "2.6.2",
42
- "@swc/helpers": "0.5.12",
43
42
  "gl-matrix": "3.3.0"
44
43
  },
45
44
  "devDependencies": {
@@ -22,22 +22,125 @@
22
22
  * SOFTWARE.
23
23
  ********************************************************************************/
24
24
 
25
- /// <reference types="gl-matrix/index.js" />
26
-
27
25
  import { mat2d } from "gl-matrix";
28
26
 
27
+ /**
28
+ * AddOnData class provides APIs to read, write, remove private metadata to a Node.
29
+ * This metadata is accessible only to the add-on that has set it.
30
+ */
31
+ export declare class AddOnData {
32
+ /**
33
+ * <InlineAlert slots="text" variant="warning"/>
34
+ *
35
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
36
+ *
37
+ * @experimental
38
+ * Sets a private metadata entry on the node.
39
+ * @param key - The key for the private metadata entry.
40
+ * @param value - The value for the private metadata entry.
41
+ */
42
+ setItem(key: string, value: string): void;
43
+ /**
44
+ * <InlineAlert slots="text" variant="warning"/>
45
+ *
46
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
47
+ *
48
+ * @experimental
49
+ * Retrieves the private metadata value for the specified key on the node.
50
+ * @param key - The key of the private metadata entry to retrieve.
51
+ * @returns The value of the private metadata entry.
52
+ */
53
+ getItem(key: string): string | undefined;
54
+ /**
55
+ * <InlineAlert slots="text" variant="warning"/>
56
+ *
57
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
58
+ *
59
+ * @experimental
60
+ * Removes a single private metadata entry on the node.
61
+ * @param key - The key of the private metadata entry to remove.
62
+ */
63
+ removeItem(key: string): void;
64
+ /**
65
+ * <InlineAlert slots="text" variant="warning"/>
66
+ *
67
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
68
+ *
69
+ * @experimental
70
+ * Clears all private metadata entries on the node.
71
+ */
72
+ clear(): void;
73
+ /**
74
+ * <InlineAlert slots="text" variant="warning"/>
75
+ *
76
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
77
+ *
78
+ * @experimental
79
+ * @returns an array of all keys for the private metadata entries on the node.
80
+ */
81
+ keys(): string[];
82
+ /**
83
+ * <InlineAlert slots="text" variant="warning"/>
84
+ *
85
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
86
+ *
87
+ * @experimental
88
+ * @returns an object with the remaining quota for private metadata on the node for this add-on.
89
+ * The object contains the following properties:
90
+ * - sizeInBytes: The remaining quota size in bytes (maximum 3KB).
91
+ * - numKeys: The remaining quota for the number of keys (maximum 20 keys).
92
+ */
93
+ get remainingQuota(): Readonly<{
94
+ sizeInBytes: number;
95
+ numKeys: number;
96
+ }>;
97
+ /**
98
+ * @returns an iterator for all the private metadata entries on the node.
99
+ * The iterator yields the metadata key-value pairs.
100
+ */
101
+ [Symbol.iterator](): Iterator<[string, string]>;
102
+ }
103
+
29
104
  declare namespace ApiConstants {
30
- export { ArrowHeadType, BlendMode, FillRule, FillType, SceneNodeType, StrokePosition, StrokeType, TextAlignment };
105
+ export {
106
+ ArrowHeadType,
107
+ BlendMode,
108
+ FillRule,
109
+ FillType,
110
+ SceneNodeType,
111
+ StrokePosition,
112
+ StrokeType,
113
+ TextAlignment,
114
+ TextType,
115
+ EditorEvent,
116
+ VisualEffectType
117
+ };
31
118
  }
32
119
 
33
120
  declare interface ApiModuleExport {
34
121
  editor: ExpressEditor;
35
122
  constants: unknown;
36
123
  colorUtils: ExpressColorUtils;
124
+ fonts: ExpressFonts;
125
+ viewport: ExpressViewport;
126
+ }
127
+
128
+ /**
129
+ * <InlineAlert slots="text" variant="warning"/>
130
+ *
131
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
132
+ *
133
+ * @experimental
134
+ */
135
+ export declare interface AreaTextLayout {
136
+ type: TextType.area;
137
+ width: number;
138
+ height: number;
37
139
  }
38
140
 
39
141
  /**
40
142
  * <InlineAlert slots="text" variant="warning"/>
143
+ *
41
144
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
42
145
  */
43
146
  declare enum ArrowHeadType {
@@ -53,7 +156,7 @@ declare enum ArrowHeadType {
53
156
 
54
157
  /**
55
158
  * ArtboardList represents an ordered list of ArtboardNodes arranged in a timeline sequence, where they are called "scenes."
56
- * All items in the list are children of a single PageNode.
159
+ * All items in the list are children of a single {@link PageNode}.
57
160
  *
58
161
  * ArtboardList also provides APIs for adding/removing artboards from the page. ArtboardList is never empty: it is illegal to
59
162
  * remove the last remaining artboard from the list.
@@ -71,8 +174,12 @@ export declare class ArtboardList extends RestrictedItemList<ArtboardNode> {
71
174
 
72
175
  /**
73
176
  * An ArtboardNode represents an artboard object in the scenegraph. All user visual content must be contained on an artboard.
177
+ * Artboards are always contained on a {@link PageNode}; when a page contains multiple artboards, the artboards represent
178
+ * "scenes" in a linear timeline sequence.
74
179
  *
75
- * When multiple artboards exist on a page, the artboards represent "scenes" in a linear timeline sequence.
180
+ * To create new artboards, see {@link ArtboardList.addArtboard}.
181
+ *
182
+ * Please note that creating and deleting an artboard in a single frame will crash the editor.
76
183
  */
77
184
  export declare class ArtboardNode extends VisualNode implements IRectangularNode, ContainerNode {
78
185
  /**
@@ -107,6 +214,103 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
107
214
  get height(): number;
108
215
  }
109
216
 
217
+ /**
218
+ * <InlineAlert slots="text" variant="warning"/>
219
+ *
220
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
221
+ *
222
+ * @experimental
223
+ */
224
+ export declare interface AutoHeightTextLayout {
225
+ type: TextType.autoHeight;
226
+ width: number;
227
+ }
228
+
229
+ /**
230
+ * Font the current user has access or licensing permissions to create / edit content with.
231
+ */
232
+ export declare class AvailableFont extends BaseFont {
233
+ /**
234
+ * <InlineAlert slots="text" variant="warning"/>
235
+ *
236
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
237
+ *
238
+ * @experimental
239
+ * Whether the font is a premium Adobe font.
240
+ */
241
+ get isPremium(): boolean;
242
+ get availableForEditing(): true;
243
+ }
244
+
245
+ /**
246
+ * <InlineAlert slots="text" variant="warning"/>
247
+ *
248
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
249
+ *
250
+ * @experimental
251
+ * Base character styles that can be applied to any range of characters.
252
+ * Excludes font style, which differs between the getter-oriented {@link CharacterStyles} interface and the
253
+ * setter-oriented {@link CharacterStylesInput}.
254
+ */
255
+ declare interface BaseCharacterStyles {
256
+ /**
257
+ * Size of the text in points.
258
+ */
259
+ fontSize: number;
260
+ /**
261
+ * Text color.
262
+ */
263
+ color: Color;
264
+ /**
265
+ * Uniformly adjusts the letter spacing, aka character spacing. Specified as a delta relative to the font's default
266
+ * spacing, in units of 1/1000 em: positive values increase the spacing, negative values tighten the spacing, and 0
267
+ * leaves spacing at its default.
268
+ */
269
+ letterSpacing: number;
270
+ /**
271
+ * Adds an underline to text.
272
+ */
273
+ underline: boolean;
274
+ }
275
+
276
+ /**
277
+ * Represents a font that is able to be rendered within this document. However, the user may not have edit permissions for
278
+ * all such fonts.
279
+ */
280
+ declare abstract class BaseFont {
281
+ /**
282
+ * <InlineAlert slots="text" variant="warning"/>
283
+ *
284
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
285
+ *
286
+ * @experimental
287
+ * The PostScript name of the font.
288
+ */
289
+ get postscriptName(): string;
290
+ /**
291
+ * <InlineAlert slots="text" variant="warning"/>
292
+ *
293
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
294
+ *
295
+ * @experimental
296
+ * The font family containing the font.
297
+ */
298
+ get family(): string;
299
+ /**
300
+ * <InlineAlert slots="text" variant="warning"/>
301
+ *
302
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
303
+ *
304
+ * @experimental
305
+ * The style of the font within the family.
306
+ */
307
+ get style(): string;
308
+ /**
309
+ * Whether the current user has permission to create / edit content using this font.
310
+ */
311
+ abstract get availableForEditing(): boolean;
312
+ }
313
+
110
314
  /**
111
315
  * A "node" represents an object in the scenegraph, the document's visual content tree. This base class includes only the
112
316
  * most fundamental nonvisual properties that even nodes near the top of the document structure share (such as PageNode).
@@ -114,6 +318,16 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
114
318
  * properties.
115
319
  */
116
320
  export declare class BaseNode {
321
+ /**
322
+ * <InlineAlert slots="text" variant="warning"/>
323
+ *
324
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
325
+ *
326
+ * @experimental
327
+ * Get {@link AddOnData} reference for managing the private metadata on this node for this add-on.
328
+ */
329
+ get addOnData(): AddOnData;
330
+
117
331
  /**
118
332
  * A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is
119
333
  * moved to a different part of the document.
@@ -170,6 +384,7 @@ export declare interface BitmapImage {
170
384
 
171
385
  /**
172
386
  * <InlineAlert slots="text" variant="warning"/>
387
+ *
173
388
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
174
389
  *
175
390
  * Determines how a scenenode is composited on top of the content rendered below it.
@@ -212,6 +427,63 @@ declare enum BlendMode {
212
427
  luminosity = 17
213
428
  }
214
429
 
430
+ /**
431
+ * <InlineAlert slots="text" variant="warning"/>
432
+ *
433
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
434
+ *
435
+ * @experimental
436
+ * Text styles that can be applied to any range of characters, even a short span like a single word. (Contrast with
437
+ * ParagraphStyles, which must be applied to an entire paragraph atomically).
438
+ */
439
+ export declare interface CharacterStyles extends BaseCharacterStyles {
440
+ font: Font;
441
+ }
442
+
443
+ /**
444
+ * <InlineAlert slots="text" variant="warning"/>
445
+ *
446
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
447
+ *
448
+ * @experimental
449
+ * Variant of {@link CharacterStyles} with all style fields optional, used for applyCharacterStyles(). When using that API,
450
+ * any fields not specified are left unchanged, preserving the text's existing styles.
451
+ *
452
+ * If specified, the font must be of the {@link AvailableFont} type – one that is guaranteed to be available for the current
453
+ * user to edit with.
454
+ */
455
+ export declare interface CharacterStylesInput extends Partial<BaseCharacterStyles> {
456
+ font?: AvailableFont;
457
+ }
458
+
459
+ /**
460
+ * <InlineAlert slots="text" variant="warning"/>
461
+ *
462
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
463
+ *
464
+ * @experimental
465
+ * A set of {@link CharacterStyles} along with the range of characters they apply to. Seen in the characterStyleRanges
466
+ * getter.
467
+ *
468
+ * Note that fonts returned by the getter are *not* guaranteed to be ones the user has rights to edit with, even though they
469
+ * are visible in the document.
470
+ */
471
+ export declare interface CharacterStylesRange extends CharacterStyles, StyleRange {}
472
+
473
+ /**
474
+ * <InlineAlert slots="text" variant="warning"/>
475
+ *
476
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
477
+ *
478
+ * @experimental
479
+ * Variant of {@link CharacterStylesRange} with all style fields optional, along with the range of characters they apply to.
480
+ * Used for the characterStyleRanges setter. When invoking the setter, any fields not specified are reset to their defaults.
481
+ *
482
+ * If specified, the font must be of the {@link AvailableFont} type – one that is guaranteed to be available for the current
483
+ * user to edit with.
484
+ */
485
+ export declare interface CharacterStylesRangeInput extends CharacterStylesInput, StyleRange {}
486
+
215
487
  /**
216
488
  * Represents an RGBA color value.
217
489
  */
@@ -318,9 +590,13 @@ export declare class Context {
318
590
  */
319
591
  get selection(): readonly Node[];
320
592
  /**
321
- * Sets the current selection, automatically ensuring these rules are met:
322
- * - Nodes must be within the current artboard (others are filtered out).
323
- * - A node cannot be selected at the same time as its ancestor (descendants are filtered out).
593
+ * Sets the current selection to an array of {@link Node}.
594
+ * Accepts a single node as a shortcut for a length-1 array `[node]` or
595
+ * `undefined` as a shortcut for `[]`, which clears the selection.
596
+ *
597
+ * Only node(s) that meet the following criteria can be selected:
598
+ * - Nodes must be within the current artboard (nodes outside the active artboard are filtered out).
599
+ * - A node cannot be selected if its ancestor is also selected (descendants are filtered out).
324
600
  * - Locked nodes are filtered out (but will still be included in selectionIncludingNonEditable).
325
601
  */
326
602
  set selection(nodes: Node | readonly Node[] | undefined);
@@ -344,6 +620,32 @@ export declare class Context {
344
620
  * @returns The currently viewed page.
345
621
  */
346
622
  get currentPage(): PageNode;
623
+ /**
624
+ * <InlineAlert slots="text" variant="warning"/>
625
+ *
626
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
627
+ *
628
+ * @experimental
629
+ * Registers a handler for editor events such as selection change.
630
+ * The registered callback will be invoked when the specified event occurs.
631
+ * Note: Do not attempt to make changes to the document in response to a selection change callback because it may destabilize the application.
632
+ * @param eventName - an editor event name.
633
+ * @param callback - a callback to be registered for an editor event.
634
+ * @returns a unique ID for the registered event handler.
635
+ */
636
+ on(eventName: EditorEvent, callback: EditorEventHandler): EventHandlerId;
637
+ /**
638
+ * <InlineAlert slots="text" variant="warning"/>
639
+ *
640
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
641
+ *
642
+ * @experimental
643
+ * Unregisters handlers for editor events like selection change.
644
+ * @param eventName - an editor event name.
645
+ * @param handlerId - a unique ID returned by `editor.context.on` API.
646
+ * Callback that was previously registered will be removed and will no more be invoked when the event occurs.
647
+ */
648
+ off(eventName: EditorEvent, handlerId: EventHandlerId): void;
347
649
  }
348
650
 
349
651
  /**
@@ -364,7 +666,7 @@ export declare class Editor {
364
666
  * Generally, calling any setter or method is treated as an edit; but simple getters may be safely called at any time.
365
667
  *
366
668
  * Example of typical usage:
367
- * ```javascript
669
+ * ```js
368
670
  * // Assume insertImage() is called from your UI code, and given a Blob containing image data
369
671
  * async function insertImage(blob) {
370
672
  * // This function was invoked from the UI iframe, so we can make any edits we want synchronously here.
@@ -427,7 +729,7 @@ export declare class Editor {
427
729
  * render as a gray placeholder on other clients until it has been uploaded to DCX and then downloaded by those clients.
428
730
  * This local client will act as having unsaved changes until the upload has finished.
429
731
  *
430
- * @param bitmapData - BitmapImage resource (e.g. returned from loadBitmapImage()).
732
+ * @param bitmapData - BitmapImage resource (e.g. returned from {@link loadBitmapImage}).
431
733
  * @param options - Additional configuration:
432
734
  * - initialSize - Size the image is displayed at. Must have the same aspect ratio as bitmapData. Defaults to the
433
735
  * size the image would be created at by a UI drag-drop gesture (typically the image's full size, but scaled down
@@ -473,8 +775,11 @@ export declare class Editor {
473
775
  makeStroke(options?: Partial<SolidColorStroke>): SolidColorStroke;
474
776
  /**
475
777
  * @returns a text node with default styles. The text content is initially empty, so the text node will be
476
- * invisible until its `text` property is set. Creates point text, so the node's width will automatically
778
+ * invisible until its `fullContent` property's `text` is set. Creates point text, so the node's width will automatically
477
779
  * adjust to accommodate whatever text is set.
780
+ *
781
+ * Note: the registration point of this text node is not guaranteed to be at the top-left of the bounding box of its
782
+ * insertion parent. Recommend using `setPositionInParent` over `translation` to set the position.
478
783
  */
479
784
  createText(): TextNode;
480
785
  /**
@@ -490,7 +795,31 @@ export declare class Editor {
490
795
  export declare const editor: ExpressEditor;
491
796
 
492
797
  /**
493
- * An EllipseNode represents an ellipse object in the scenegraph.
798
+ * <InlineAlert slots="text" variant="warning"/>
799
+ *
800
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
801
+ *
802
+ * @experimental
803
+ * This enum represents the supported editor events.
804
+ */
805
+ export declare enum EditorEvent {
806
+ selectionChange = "selectionChange"
807
+ }
808
+
809
+ /**
810
+ * <InlineAlert slots="text" variant="warning"/>
811
+ *
812
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
813
+ *
814
+ * @experimental
815
+ * This type represents function signature for the editor event handler callback.
816
+ */
817
+ export declare type EditorEventHandler = () => void;
818
+
819
+ /**
820
+ * An EllipseNode represents an ellipse or circle shape in the scenegraph.
821
+ *
822
+ * To create new ellipse, see {@link Editor.createEllipse}.
494
823
  */
495
824
  export declare class EllipseNode extends FillableNode {
496
825
  /**
@@ -513,6 +842,16 @@ export declare class EllipseNode extends FillableNode {
513
842
  set ry(value: number);
514
843
  }
515
844
 
845
+ /**
846
+ * <InlineAlert slots="text" variant="warning"/>
847
+ *
848
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
849
+ *
850
+ * @experimental
851
+ * This type represents unique id of each event handler callback that is registered.
852
+ */
853
+ export declare type EventHandlerId = string;
854
+
516
855
  declare const expressApiModule: ApiModuleExport;
517
856
  export default expressApiModule;
518
857
 
@@ -520,6 +859,8 @@ declare class ExpressColorUtils extends ColorUtils {}
520
859
 
521
860
  declare class ExpressEditor extends Editor {}
522
861
 
862
+ declare class ExpressFonts extends Fonts {}
863
+
523
864
  /**
524
865
  * An ExpressRootNode represents the root node of the document's "scenegraph" artwork tree. The root contains a collection
525
866
  * of {@link pages}. Each page contains one or more artboards, arranged in a timeline sequence. All the visual content of
@@ -530,10 +871,13 @@ declare class ExpressEditor extends Editor {}
530
871
  export declare class ExpressRootNode extends BaseNode {
531
872
  /**
532
873
  * The pages of the document. All visual content is contained on artboards within the pages.
874
+ * To create new pages, see {@link PageList.addPage}.
533
875
  */
534
876
  get pages(): PageList;
535
877
  }
536
878
 
879
+ declare class ExpressViewport extends Viewport {}
880
+
537
881
  /**
538
882
  * Base interface representing any fill in the scenegraph. See {@link FillableNode}.
539
883
  * Currently, you can only create {@link ColorFill}s, but you might encounter
@@ -559,6 +903,7 @@ export declare class FillableNode extends StrokableNode implements IFillableNode
559
903
 
560
904
  /**
561
905
  * <InlineAlert slots="text" variant="warning"/>
906
+ *
562
907
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
563
908
  *
564
909
  * The fill rule, aka "winding rule," specifies how the interior area of a path is determined in cases where the path is
@@ -571,9 +916,11 @@ declare enum FillRule {
571
916
 
572
917
  /**
573
918
  * <InlineAlert slots="text" variant="warning"/>
919
+ *
574
920
  * *Do not depend on the literal string values of these constants*, as they may change. Always reference the enum identifiers in your code.
575
921
  *
576
922
  * <InlineAlert slots="text" variant="warning"/>
923
+ *
577
924
  * *Additional fill types may be added in the future.* If your code has different branches or cases depending on fill type,
578
925
  * always have a default/fallback case to handle any unknown values you may encounter.
579
926
  */
@@ -582,11 +929,60 @@ declare enum FillType {
582
929
  color = "Color"
583
930
  }
584
931
 
932
+ /**
933
+ * <InlineAlert slots="text" variant="warning"/>
934
+ *
935
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
936
+ *
937
+ * @experimental
938
+ * Represents a font in the document.
939
+ *
940
+ * Note: not every font encountered in the existing content is available for editing.
941
+ * Check the `availableForEditing` property to be sure.
942
+ */
943
+ export declare type Font = AvailableFont | UnavailableFont;
944
+
945
+ /**
946
+ * The Fonts class provides methods to work with fonts.
947
+ */
948
+ export declare class Fonts {
949
+ /**
950
+ * <InlineAlert slots="text" variant="warning"/>
951
+ *
952
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
953
+ *
954
+ * @experimental
955
+ * Get an {@link AvailableFont} that exactly matches the given PostScript name, if any. Only fonts that the user has permission to use
956
+ * for editing content are returned, so the result of this call is always safe to apply to a {@link TextContentModel}'s styles.
957
+ *
958
+ * @param postscriptName - The PostScript name of the font.
959
+ * @returns The Font object if found and available for editing, otherwise undefined.
960
+ */
961
+ fromPostscriptName(postscriptName: string): Promise<AvailableFont | undefined>;
962
+ }
963
+
964
+ export declare const fonts: ExpressFonts;
965
+
966
+ /**
967
+ * A GridCellNode represents the MediaContainerNode aspect of a grid cell. Unlike other MediaContainerNodes,
968
+ * GridCellNodes cannot be translated or rotated directly. This implementation translates and rotates the
969
+ * MediaRectangle child of the GridCellNode when those actions are applied.
970
+ */
971
+ export declare class GridCellNode extends MediaContainerNode {}
972
+
585
973
  /**
586
974
  * A GridLayoutNode represents a grid layout in the scenegraph. The GridLayoutNode is used to create
587
975
  * a layout grid that other content can be placed into.
976
+ *
977
+ * APIs to create a new grid layout are not yet available.
588
978
  */
589
979
  export declare class GridLayoutNode extends Node implements Readonly<IRectangularNode> {
980
+ /**
981
+ * The Grid's regular children. Does not include rectangles and skips over media constainer nodes to return fill grandchildren.
982
+ * Grid Cells are ordered by the y and then x position of their top left corner, i.e. left to right and top to bottom.
983
+ * The children cannot be added or removed.
984
+ */
985
+ get allChildren(): Readonly<Iterable<Node>>;
590
986
  /**
591
987
  * The background fill of the GridLayout.
592
988
  */
@@ -605,6 +1001,8 @@ export declare class GridLayoutNode extends Node implements Readonly<IRectangula
605
1001
  /**
606
1002
  * A GroupNode represents a Group object in the scenegraph, which has a collection of generic children as well as a separate,
607
1003
  * optional vector mask child.
1004
+ *
1005
+ * To create new group, see {@link Editor.createGroup}.
608
1006
  */
609
1007
  export declare class GroupNode extends Node implements ContainerNode {
610
1008
  /**
@@ -643,6 +1041,9 @@ declare interface IFillableNode {
643
1041
  * ImageRectangleNode is a rectangular node that displays the image media part of a MediaContainerNode. It can only exist
644
1042
  * within that container parent. Cropping can be adjusted by changing this media's position/rotation (as well as its mask
645
1043
  * shape sibling node).
1044
+ *
1045
+ * ImageRectangleNodes cannot be created directly; use {@link Editor.createImageContainer} to create the entire
1046
+ * container structure together.
646
1047
  */
647
1048
  export declare class ImageRectangleNode extends Node implements Readonly<IRectangularNode> {
648
1049
  /**
@@ -688,6 +1089,8 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
688
1089
  /**
689
1090
  * Add one or more items to the end of the list. The last argument will become the last item in this list. Items are
690
1091
  * removed from their previous parent, if any – or if an item is already in *this* list, its index is simply changed.
1092
+ *
1093
+ * @throws - if item has a different parent and item is a {@link TextNode} that's a part of a Text Flow, or if item's children subtree contains a TextNode who is a part of a Text Flow.
691
1094
  */
692
1095
  append(...items: T[]): void;
693
1096
  /**
@@ -698,24 +1101,32 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
698
1101
  * Replace `oldItem` with `newItem` in this list. Throws if `oldItem` is not a member of this list.
699
1102
  * `newItem` is removed from its previous parent, if any – or if it's already in *this* list, its index is simply
700
1103
  * changed. No-op if both arguments are the same item.
1104
+ *
1105
+ * @throws - if newItem has a different parent and newItem is a {@link TextNode} that's a part of a Text Flow, or if newItem's children subtree contains a TextNode who is a part of a Text Flow.
701
1106
  */
702
1107
  replace(oldItem: T, newItem: T): void;
703
1108
  /**
704
1109
  * Insert `newItem` so it is immediately before `before` in this list: places `newItem` at the index that `before` used
705
1110
  * to occupy, shifting `before` and all later items to higher indices. `newItem` is removed from its previous parent,
706
1111
  * if any – or if it's already in *this* list, its index is simply changed. No-op if both arguments are the same item.
1112
+ *
1113
+ * @throws - if newItem has a different parent and it is a {@link TextNode} that's a part of a Text Flow, or if newItem's children subtree contains a TextNode who is a part of a Text Flow.
707
1114
  */
708
1115
  insertBefore(newItem: T, before: T): void;
709
1116
  /**
710
1117
  * Insert `newItem` so it is immediately after `after` in this list: places `newItem` at the index one higher than `after`,
711
1118
  * shifting all later items to higher indices (the index of `after` remains unchanged). `newItem` is removed from its previous parent,
712
1119
  * if any – or if it's already in *this* list, its index is simply changed. No-op if both arguments are the same item.
1120
+ *
1121
+ * @throws - if newItem has a different parent and it is a {@link TextNode} that's a part of a Text Flow, or if newItem's children subtree contains a TextNode who is a part of a Text Flow.
713
1122
  */
714
1123
  insertAfter(newItem: T, after: T): void;
715
1124
  }
716
1125
 
717
1126
  /**
718
- * A LineNode represents a simple line object in the scenegraph – a single straight-line segment.
1127
+ * A LineNode represents a simple vector line in the scenegraph – a single straight-line segment.
1128
+ *
1129
+ * To create new lines, see {@link Editor.createLine}.
719
1130
  */
720
1131
  export declare class LineNode extends StrokableNode {
721
1132
  static readonly DEFAULT_START_X = 0;
@@ -786,6 +1197,9 @@ export declare interface ListItem {}
786
1197
  * A MediaContainerNode is a multi-node construct that displays media (such as images or video) with optional cropping and
787
1198
  * clipping to a shape mask. The underlying media asset is always rectangular, but the final appearance of this node is
788
1199
  * determined by the maskShape which is not necessarily a rectangle.
1200
+ *
1201
+ * To create new media container for a bitmap image, see {@link Editor.createImageContainer}. APIs for creating a
1202
+ * container with other content, such as videos, are not yet available.
789
1203
  */
790
1204
  export declare class MediaContainerNode extends Node {
791
1205
  /**
@@ -914,8 +1328,8 @@ export { Node as Node };
914
1328
 
915
1329
  /**
916
1330
  * PageList represents an ordered list of PageNodes, all of which are children of the root node of the document's "scenegraph"
917
- * artwork tree. A page contains one or more artboards, representing "scenes" in a linear timeline sequence. Those artboards
918
- * in turn contain all the visual content of the document.
1331
+ * artwork tree (see {@link ExpressRootNode}). A page contains one or more artboards, representing "scenes" in a linear timeline
1332
+ * sequence. Those artboards in turn contain all the visual content of the document.
919
1333
  *
920
1334
  * PageList also provides APIs for adding/removing pages from the document. PageList is never empty: it is illegal to
921
1335
  * remove the last remaining page from the list.
@@ -932,12 +1346,16 @@ export declare class PageList extends RestrictedItemList<PageNode> {
932
1346
  }
933
1347
 
934
1348
  /**
935
- * A PageNode represents a page in the document. A page contains one or more artboards, representing "scenes" in a linear
936
- * timeline sequence. Those artboards in turn contain all the visual content of the document.
1349
+ * A PageNode represents a page in the document, a child of the root node of the document's "scenegraph" artwork tree
1350
+ * (see {@link ExpressRootNode}). A page contains one or more artboards, representing "scenes" in a linear timeline
1351
+ * sequence. Those artboards in turn contain all the visual content of the document.
1352
+ *
1353
+ * To create new pages, see {@link PageList.addPage}.
937
1354
  */
938
1355
  export declare class PageNode extends BaseNode implements Readonly<IRectangularNode> {
939
1356
  /**
940
1357
  * The artboards or "scenes" of a page, ordered by timeline sequence.
1358
+ * To create new artboards, see {@link ArtboardList.addArtboard}.
941
1359
  */
942
1360
  get artboards(): ArtboardList;
943
1361
  /**
@@ -967,8 +1385,10 @@ export declare class PageNode extends BaseNode implements Readonly<IRectangularN
967
1385
  }
968
1386
 
969
1387
  /**
970
- * A PathNode represents a generic vector path shape in the scenegraph. Paths cannot be created or edited through this API
1388
+ * A PathNode represents a generic vector path shape in the scenegraph. Paths cannot be edited through this API
971
1389
  * yet, only read.
1390
+ *
1391
+ * To create new paths, see {@link Editor.createPath}.
972
1392
  */
973
1393
  export declare class PathNode extends FillableNode {
974
1394
  /**
@@ -993,6 +1413,17 @@ export declare interface Point {
993
1413
  y: number;
994
1414
  }
995
1415
 
1416
+ /**
1417
+ * <InlineAlert slots="text" variant="warning"/>
1418
+ *
1419
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1420
+ *
1421
+ * @experimental
1422
+ */
1423
+ export declare interface PointTextLayout {
1424
+ type: TextType.autoWidth;
1425
+ }
1426
+
996
1427
  /**
997
1428
  * ReadOnlyItemList represents an ordered list of API objects, representing items that are all children of the
998
1429
  * same parent node. (The reverse is not necessarily true, however: this list might not include all
@@ -1046,7 +1477,9 @@ export declare interface RectangleGeometry {
1046
1477
  }
1047
1478
 
1048
1479
  /**
1049
- * A RectangleNode represents a rectangle object in the scenegraph.
1480
+ * A RectangleNode represents a rectangle shape in the scenegraph.
1481
+ *
1482
+ * To create new rectangles, see {@link Editor.createRectangle}.
1050
1483
  */
1051
1484
  export declare class RectangleNode extends FillableNode implements IRectangularNode {
1052
1485
  /**
@@ -1144,9 +1577,11 @@ declare class RestrictedItemList<T extends ListItem> extends ReadOnlyItemList<T>
1144
1577
 
1145
1578
  /**
1146
1579
  * <InlineAlert slots="text" variant="warning"/>
1580
+ *
1147
1581
  * *Do not depend on the literal string values of these constants*, as they may change. Always reference the enum identifiers in your code.
1148
1582
  *
1149
1583
  * <InlineAlert slots="text" variant="warning"/>
1584
+ *
1150
1585
  * *Additional node types may be added in the future.* If your code has different branches or cases depending on node type,
1151
1586
  * always have a default/fallback case to handle any unknown values you may encounter.
1152
1587
  */
@@ -1155,7 +1590,6 @@ declare enum SceneNodeType {
1155
1590
  rectangle = "Rectangle",
1156
1591
  ellipse = "Ellipse",
1157
1592
  path = "Path",
1158
- text = "Text",
1159
1593
  linkedAsset = "LinkedAsset",
1160
1594
  group = "Group",
1161
1595
  artboard = "ab:Artboard",
@@ -1173,8 +1607,12 @@ declare enum SceneNodeType {
1173
1607
  solidColorShape = "SolidColorShape",
1174
1608
  /** Type of StrokeShapeNode, representing a stroke-only prepackaged shape that appears as a leaf node in the UI */
1175
1609
  strokeShape = "StrokeShape",
1610
+ /** Type of MediaContainerNode which is a child of a GridLayout, representing one of the Grid's cells*/
1611
+ gridCell = "GridCell",
1176
1612
  /** Type of GridLayoutNode represents a grid layout in the scenegraph used to create a layout grid that other content can be placed into */
1177
- gridLayout = "GridLayout"
1613
+ gridLayout = "GridLayout",
1614
+ /** Type of TextNode, representing a non-threaded text or a threaded text frame */
1615
+ text = "Text"
1178
1616
  }
1179
1617
 
1180
1618
  /**
@@ -1255,6 +1693,7 @@ export declare interface Stroke {
1255
1693
 
1256
1694
  /**
1257
1695
  * <InlineAlert slots="text" variant="warning"/>
1696
+ *
1258
1697
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
1259
1698
  *
1260
1699
  * A stroke's {@link Stroke.position} determines how the thickness of the stroke is aligned along a shape's path outline.
@@ -1273,9 +1712,11 @@ export declare class StrokeShapeNode extends StrokableNode {}
1273
1712
 
1274
1713
  /**
1275
1714
  * <InlineAlert slots="text" variant="warning"/>
1715
+ *
1276
1716
  * *Do not depend on the literal string values of these constants*, as they may change. Always reference the enum identifiers in your code.
1277
1717
  *
1278
1718
  * <InlineAlert slots="text" variant="warning"/>
1719
+ *
1279
1720
  * *Additional stroke types may be added in the future.* If your code has different branches or cases depending on stroke type,
1280
1721
  * always have a default/fallback case to handle any unknown values you may encounter.
1281
1722
  */
@@ -1286,8 +1727,21 @@ declare enum StrokeType {
1286
1727
  color = "Color"
1287
1728
  }
1288
1729
 
1730
+ /**
1731
+ * Represents a range of characters defined by a length (and implicitly started at the end of the previous range).
1732
+ */
1733
+ declare interface StyleRange {
1734
+ /**
1735
+ * The length or number of characters in which character styles will be applied.
1736
+ * Note: since characters are represented as UTF-16 code units, some symbols
1737
+ * such as emojis are considered to have a length of 2.
1738
+ */
1739
+ length: number;
1740
+ }
1741
+
1289
1742
  /**
1290
1743
  * <InlineAlert slots="text" variant="warning"/>
1744
+ *
1291
1745
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
1292
1746
  */
1293
1747
  declare enum TextAlignment {
@@ -1297,22 +1751,193 @@ declare enum TextAlignment {
1297
1751
  }
1298
1752
 
1299
1753
  /**
1300
- * A TextNode represents a text object in the scenegraph.
1754
+ * Represents a complete piece of text content flow, which may be split across multiple {@link TextNode} frames for display.
1755
+ * Use this model to get or modify the text string and the style ranges applied to it.
1756
+ */
1757
+ export declare class TextContentModel {
1758
+ /**
1759
+ * <InlineAlert slots="text" variant="warning"/>
1760
+ *
1761
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1762
+ *
1763
+ * @experimental
1764
+ * A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is
1765
+ * moved to a different part of the document.
1766
+ *
1767
+ * To determine if two TextNodes are connected to the same TextContentModel,
1768
+ * check if both models have the same id.
1769
+ * Comparing two models using `===` will always fail.
1770
+ */
1771
+ get id(): string;
1772
+ /**
1773
+ * <InlineAlert slots="text" variant="warning"/>
1774
+ *
1775
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1776
+ *
1777
+ * @experimental
1778
+ * Get ordered list of all {@link TextNode}s that display this text content in the scenegraph. The text content
1779
+ * starts in the first {@link TextNode} "frame", and then flows into the second node once it has filled the first one. The ending of the
1780
+ * text content may not be visible at all, if the last {@link TextNode} "frame" is not large enough to accommodate it.
1781
+ *
1782
+ * If there are multiple {@link TextNode}s, all of them must be configured to use {@link AreaTextLayout}.
1783
+ */
1784
+ get allTextNodes(): Readonly<Iterable<TextNode>>;
1785
+ /**
1786
+ * The complete text string, which may span multiple {@link TextNode} "frames" in the scenegraph.
1787
+ */
1788
+ get text(): string;
1789
+ set text(textContent: string);
1790
+ /**
1791
+ * <InlineAlert slots="text" variant="warning"/>
1792
+ *
1793
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1794
+ *
1795
+ * @experimental
1796
+ * The character styles applied to different ranges of this text content. When setting character styles, any style
1797
+ * properties that are not provided are reset to their defaults (contrast to {@link applyCharacterStyles} which
1798
+ * preserves the text's existing styles for any fields not specified). When *getting* styles, all fields are always
1799
+ * provided.
1800
+ *
1801
+ * Note: existing fonts used in the document, returned by this getter, are not guaranteed to be ones the current user
1802
+ * has rights to edit with. The *setter* only accepts the AvailableFont type which has been verified to be usable.
1803
+ */
1804
+ get characterStyleRanges(): readonly CharacterStylesRange[];
1805
+ set characterStyleRanges(styles: readonly CharacterStylesRangeInput[]);
1806
+ /**
1807
+ * <InlineAlert slots="text" variant="warning"/>
1808
+ *
1809
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1810
+ *
1811
+ * @experimental
1812
+ * Apply one or more styles to the characters in the given range, leaving any style properties that were not specified
1813
+ * unchanged. Does not modify any styles in the text outside this range. Contrast to the {@link characterStyleRanges}
1814
+ * setter, which specifies new style range(s) for the entire text at once, and resets any unspecified properties back to
1815
+ * default styles.
1816
+
1817
+ * @param styles - The styles to apply.
1818
+ * @param range - The start and length of character sequence to which the styles should be applied.
1819
+ * If not specified the styles will be applied to the entire piece of text content flow.
1820
+ */
1821
+ applyCharacterStyles(
1822
+ styles: CharacterStylesInput,
1823
+ range?: {
1824
+ start: number;
1825
+ length: number;
1826
+ }
1827
+ ): void;
1828
+ }
1829
+
1830
+ /**
1831
+ * A TextNode represents a text display frame in the scenegraph. It may display an entire piece of text, or sometimes just
1832
+ * a subset of longer text that flows across multiple TextNode "frames". Because of this, the TextNode does not directly hold
1833
+ * the text content and styles – instead it refers to a {@link TextContentModel}, which may be shared across multiple TextNode frames.
1834
+ *
1835
+ * To create new a single-frame piece of text, see {@link Editor.createText}. APIs are not yet available to create
1836
+ * multi-frame text flows.
1301
1837
  */
1302
1838
  export declare class TextNode extends Node {
1303
1839
  /**
1304
- * The text string of the node.
1840
+ * The model containing the complete text string and its styles, only part of which may be visible within the bounds of
1841
+ * this specific TextNode "frame." The full text content flow may be split across multiple frames, and/or it may be clipped if a
1842
+ * fixed-size frame using {@link AreaTextLayout} does not fit all the (remaining) text.
1843
+ *
1844
+ * Note: When traversing the scenegraph in search of text content, bear in mind that multiple TextNodes may refer to the
1845
+ * same single {@link TextContentModel}; this can give the impression that the same text is duplicated multiple times when it is
1846
+ * not. Use {@link TextContentModel}.id to determine whether a given piece of text content is unique or if it's already been
1847
+ * encountered before.
1848
+ *
1849
+ */
1850
+ get fullContent(): TextContentModel;
1851
+ /**
1852
+ * <InlineAlert slots="text" variant="warning"/>
1853
+ *
1854
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1855
+ *
1856
+ * @experimental
1857
+ * The next TextNode that text overflowing this node will spill into, if any. If undefined and this TextNode is fixed size
1858
+ * ({@link AreaTextLayout}), any text content that does not fit within this node's area will be clipped.
1859
+ *
1860
+ * To get *all* TextNodes that the text content may be split across, use `TextNode.fullContent.allTextNodes`.
1861
+ */
1862
+ get nextTextNode(): TextNode | undefined;
1863
+ /**
1864
+ * The text string content which is partially *or* fully displayed in this TextNode "frame."
1865
+ * WARNING: If a piece of text content flows across several TextNodes, *each* TextNode's `text` getter will return
1866
+ * the *entire* text content string.
1867
+ * @deprecated - Use the text getter on {@link TextContentModel} instead. Access it via `TextNode.fullContent.text`.
1305
1868
  */
1306
1869
  get text(): string;
1307
1870
  /**
1308
- * Sets the text content of the text node.
1871
+ * Sets the text content of the TextNode.
1872
+ * WARNING: If a piece of text content flows across several TextNodes,
1873
+ * *each* TextNode's `text` setter will sets the *entire* text content string.
1874
+ * @deprecated - Use the text setter on {@link TextContentModel} instead. Access it via `TextNode.fullContent.text`.
1309
1875
  */
1310
1876
  set text(textContent: string);
1311
1877
  /**
1312
- * The horizontal text alignment of the text node. Alignment is always the same across this node's entire text content.
1878
+ * The horizontal text alignment of the TextNode. Alignment is always the same across this node's entire text content.
1313
1879
  */
1314
1880
  get textAlignment(): TextAlignment;
1315
1881
  set textAlignment(alignment: TextAlignment);
1882
+ /**
1883
+ * <InlineAlert slots="text" variant="warning"/>
1884
+ *
1885
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1886
+ *
1887
+ * @experimental
1888
+ * @returns The list of visual effects applied to the TextNode.
1889
+ */
1890
+ get visualEffects(): readonly VisualEffectType[];
1891
+ /**
1892
+ * <InlineAlert slots="text" variant="warning"/>
1893
+ *
1894
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1895
+ *
1896
+ * @experimental
1897
+ * @returns The layout mode of the TextNode "frame."
1898
+ */
1899
+ get layout(): Readonly<PointTextLayout | AutoHeightTextLayout | AreaTextLayout | UnsupportedTextLayout>;
1900
+ /**
1901
+ * <InlineAlert slots="text" variant="warning"/>
1902
+ *
1903
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1904
+ *
1905
+ * @experimental
1906
+ * Sets the layout mode of the TextNode "frame."
1907
+ *
1908
+ * If this TextNode is part of a multi-frame text content flow, it must be configured to use {@link AreaTextLayout}. Other
1909
+ * layout modes are only available for single-frame text.
1910
+ *
1911
+ * @throws if changing text layout to/from {@link TextType.magicFit} or {@link TextType.circular} layout when the text contains font(s) unavailable to the current user.
1912
+ * @throws if TextNode is part of a multi-frame text content flow and the layout is not {@link AreaTextLayout}.
1913
+ */
1914
+ set layout(layout: PointTextLayout | AutoHeightTextLayout | AreaTextLayout);
1915
+ }
1916
+
1917
+ /**
1918
+ * <InlineAlert slots="text" variant="warning"/>
1919
+ *
1920
+ * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
1921
+ */
1922
+ declare enum TextType {
1923
+ /**
1924
+ * Point text
1925
+ */
1926
+ autoWidth = 0,
1927
+ /**
1928
+ * Soft bottom
1929
+ */
1930
+ autoHeight = 1,
1931
+ area = 2,
1932
+ magicFit = 3,
1933
+ circular = 4
1934
+ }
1935
+
1936
+ /**
1937
+ * Font the current user does not have access or licensing permissions to create / edit content with.
1938
+ */
1939
+ export declare class UnavailableFont extends BaseFont {
1940
+ get availableForEditing(): false;
1316
1941
  }
1317
1942
 
1318
1943
  /**
@@ -1320,6 +1945,54 @@ export declare class TextNode extends Node {
1320
1945
  */
1321
1946
  export declare class UnknownNode extends Node {}
1322
1947
 
1948
+ /**
1949
+ * <InlineAlert slots="text" variant="warning"/>
1950
+ *
1951
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1952
+ *
1953
+ * @experimental
1954
+ */
1955
+ export declare interface UnsupportedTextLayout {
1956
+ type: TextType.magicFit | TextType.circular;
1957
+ }
1958
+
1959
+ /**
1960
+ * Represents the area of the canvas that is currently visible on-screen.
1961
+ */
1962
+ export declare class Viewport {
1963
+ /**
1964
+ * Adjusts the viewport to make the node's bounds visible on-screen, assuming all bounds are within the artboard bounds.
1965
+ * Makes the node's {@link ArtboardNode} or {@link PageNode} visible if they were not already
1966
+ * (which may result in {@link Context.selection} being cleared). It is strongly recomended
1967
+ * to further draw user's attention to the node by setting it as the {@link Context.selection} following this call.
1968
+ *
1969
+ * After this call, the value of {@link Context.insertionParent} will always be the node's containing {@link ArtboardNode}.
1970
+ *
1971
+ * Note that the node might still not appear visible if:
1972
+ * - Its animation settings make it invisible at the beginning of the {@link ArtboardNode} "scene".
1973
+ * - It is obscured underneath other artwork in the z-order.
1974
+ * - It is hidden by a {@link GroupNode}'s mask or similar cropping.
1975
+ */
1976
+ bringIntoView(node: VisualNode): void;
1977
+ }
1978
+
1979
+ export declare const viewport: ExpressViewport;
1980
+
1981
+ /**
1982
+ * <InlineAlert slots="text" variant="warning"/>
1983
+ *
1984
+ * **IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
1985
+ *
1986
+ * @experimental
1987
+ * Visual effects that can be applied to a text node.
1988
+ */
1989
+ declare enum VisualEffectType {
1990
+ generativeTextEffects = "GenerativeTextEffects",
1991
+ outline = "Outline",
1992
+ shadow = "Shadow",
1993
+ shapeDecoration = "ShapeDecoration"
1994
+ }
1995
+
1323
1996
  /**
1324
1997
  * A "node" represents an object in the scenegraph, the document's visual content tree. This class represents any node
1325
1998
  * that can be visually perceived in the content. Most visual content is a subclass of the richer Node class which extends
package/ui/ui-sdk.d.ts CHANGED
@@ -259,7 +259,6 @@ declare interface ApplicationBase {
259
259
  */
260
260
  startPremiumUpgradeIfFreeUser(): Promise<boolean>;
261
261
  /**
262
- * @experimental - Experimental API
263
262
  * Get information regarding current platform.
264
263
  * @returns the details regarding the current platform.
265
264
  */
@@ -372,9 +371,34 @@ export declare enum AuthorizationStatus {
372
371
  POPUP_BLOCKED = "POPUP_BLOCKED",
373
372
  POPUP_CLOSED = "POPUP_CLOSED",
374
373
  POPUP_TIMEOUT = "POPUP_TIMEOUT",
375
- FAILED = "FAILED"
374
+ FAILED = "FAILED",
375
+ IFRAME_LOAD_FAILED = "IFRAME_LOAD_FAILED"
376
376
  }
377
377
 
378
+ /**
379
+ * Request parameters to authorize a user using OAuth 2.0 PKCE based authorization in an iframe.
380
+ */
381
+ export declare type AuthorizeInsideIframeRequest = AuthorizationRequest & {
382
+ /**
383
+ * Relative position of the oauth iframe panel
384
+ */
385
+ position?: {
386
+ top: number;
387
+ left: number;
388
+ };
389
+ /**
390
+ * Offset from the right and bottom of the Iframe container when the size (windowSize) is not specified.
391
+ */
392
+ offset?: {
393
+ right: number;
394
+ bottom: number;
395
+ };
396
+ /**
397
+ * Flag to determine if the iframe panel needs to show a header.
398
+ */
399
+ showHeader?: boolean;
400
+ };
401
+
378
402
  /**
379
403
  * Request parameters to initiate an OAuth 2.0 PKCE based authorization workflow,
380
404
  * where the Add-on developer is responsible for handling redirect to his/her owned Redirect URL.
@@ -519,7 +543,6 @@ declare namespace Constants {
519
543
  export { Constants };
520
544
 
521
545
  /**
522
- * @experimental - Experimental API
523
546
  * Interface for the current platform
524
547
  */
525
548
  export declare interface CurrentPlatformPayload {
@@ -599,7 +622,6 @@ export declare interface DevFlags {
599
622
  }
600
623
 
601
624
  /**
602
- * @experimental - Experimental API
603
625
  * Denotes the device class
604
626
  */
605
627
  export declare enum DeviceClass {
@@ -683,9 +705,13 @@ export declare type DisableDragToDocument = () => void;
683
705
  */
684
706
  declare interface Document_2 {
685
707
  /**
686
- * Add image/gif/Ps/Ai files to the current page
708
+ * Add image/Ps/Ai files to the current page
687
709
  */
688
710
  addImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
711
+ /**
712
+ * Add GIF files to the current page
713
+ */
714
+ addAnimatedImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
689
715
  /**
690
716
  * Add video to the current page
691
717
  */
@@ -711,6 +737,14 @@ declare interface Document_2 {
711
737
  * Get document name/title
712
738
  */
713
739
  title(): Promise<string>;
740
+ /**
741
+ * Import a Pdf to the document.
742
+ */
743
+ importPdf(blob: Blob, attributes: MediaAttributes): void;
744
+ /**
745
+ * Import a presentation to the document.
746
+ */
747
+ importPresentation(blob: Blob, attributes: MediaAttributes): void;
714
748
  }
715
749
  export { Document_2 as Document };
716
750
 
@@ -1064,6 +1098,12 @@ export declare interface OAuth {
1064
1098
  * @returns - {@link AuthorizationResult} Authorization result.
1065
1099
  */
1066
1100
  authorizeWithOwnRedirect(request: AuthorizeWithOwnRedirectRequest): Promise<AuthorizationResult>;
1101
+ /**
1102
+ * Authorize a user using OAuth 2.0 PKCE workflow in an iframe.
1103
+ * @param request - {@link AuthorizeInsideIframeRequest} Payload with parameters to be used in the authorization workflow.
1104
+ * @returns - {@link AuthorizationResponse} Response containing a ONE-TIME Authorization Code which can be used to obtain an access token.
1105
+ */
1106
+ authorizeInsideIframe(request: AuthorizeInsideIframeRequest): Promise<AuthorizationResponse>;
1067
1107
  }
1068
1108
 
1069
1109
  /**
@@ -1231,7 +1271,6 @@ export declare interface PdfRenditionOptions extends RenditionOptions {
1231
1271
  }
1232
1272
 
1233
1273
  /**
1234
- * @experimental - Experimental API
1235
1274
  * Denotes the enum for current environment
1236
1275
  */
1237
1276
  export declare enum PlatformEnvironment {
@@ -1246,7 +1285,6 @@ export declare enum PlatformEnvironment {
1246
1285
  }
1247
1286
 
1248
1287
  /**
1249
- * @experimental - Experimental API
1250
1288
  * Denotes the type of platform
1251
1289
  */
1252
1290
  export declare enum PlatformType {