@adobe/ccweb-add-on-sdk-types 1.9.0 → 1.10.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.0",
3
+ "version": "1.10.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": {
@@ -26,18 +26,122 @@
26
26
 
27
27
  import { mat2d } from "gl-matrix";
28
28
 
29
+ /**
30
+ * AddOnData class provides APIs to read, write, remove private metadata to a Node.
31
+ * This metadata is accessible only to the add-on that has set it.
32
+ */
33
+ export declare class AddOnData {
34
+ /**
35
+ * <InlineAlert slots="text" variant="warning"/>
36
+ *
37
+ * **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`.
38
+ *
39
+ * @experimental
40
+ * Sets a private metadata entry on the node.
41
+ * @param key - The key for the private metadata entry.
42
+ * @param value - The value for the private metadata entry.
43
+ */
44
+ setItem(key: string, value: string): void;
45
+ /**
46
+ * <InlineAlert slots="text" variant="warning"/>
47
+ *
48
+ * **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`.
49
+ *
50
+ * @experimental
51
+ * Retrieves the private metadata value for the specified key on the node.
52
+ * @param key - The key of the private metadata entry to retrieve.
53
+ * @returns The value of the private metadata entry.
54
+ */
55
+ getItem(key: string): string | undefined;
56
+ /**
57
+ * <InlineAlert slots="text" variant="warning"/>
58
+ *
59
+ * **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`.
60
+ *
61
+ * @experimental
62
+ * Removes a single private metadata entry on the node.
63
+ * @param key - The key of the private metadata entry to remove.
64
+ */
65
+ removeItem(key: string): void;
66
+ /**
67
+ * <InlineAlert slots="text" variant="warning"/>
68
+ *
69
+ * **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`.
70
+ *
71
+ * @experimental
72
+ * Clears all private metadata entries on the node.
73
+ */
74
+ clear(): void;
75
+ /**
76
+ * <InlineAlert slots="text" variant="warning"/>
77
+ *
78
+ * **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`.
79
+ *
80
+ * @experimental
81
+ * @returns an array of all keys for the private metadata entries on the node.
82
+ */
83
+ keys(): string[];
84
+ /**
85
+ * <InlineAlert slots="text" variant="warning"/>
86
+ *
87
+ * **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`.
88
+ *
89
+ * @experimental
90
+ * @returns an object with the remaining quota for private metadata on the node for this add-on.
91
+ * The object contains the following properties:
92
+ * - sizeInBytes: The remaining quota size in bytes (maximum 3KB).
93
+ * - numKeys: The remaining quota for the number of keys (maximum 20 keys).
94
+ */
95
+ get remainingQuota(): Readonly<{
96
+ sizeInBytes: number;
97
+ numKeys: number;
98
+ }>;
99
+ /**
100
+ * @returns an iterator for all the private metadata entries on the node.
101
+ * The iterator yields the metadata key-value pairs.
102
+ */
103
+ [Symbol.iterator](): Iterator<[string, string]>;
104
+ }
105
+
29
106
  declare namespace ApiConstants {
30
- export { SceneNodeType, BlendMode, FillType, ArrowHeadType, TextAlignment, FillRule, StrokePosition };
107
+ export {
108
+ ArrowHeadType,
109
+ BlendMode,
110
+ FillRule,
111
+ FillType,
112
+ SceneNodeType,
113
+ StrokePosition,
114
+ StrokeType,
115
+ TextAlignment,
116
+ TextType,
117
+ EditorEvent,
118
+ VisualEffectType
119
+ };
31
120
  }
32
121
 
33
122
  declare interface ApiModuleExport {
34
123
  editor: ExpressEditor;
35
124
  constants: unknown;
36
125
  colorUtils: ExpressColorUtils;
126
+ fonts: ExpressFonts;
37
127
  }
38
128
 
39
129
  /**
40
130
  * <InlineAlert slots="text" variant="warning"/>
131
+ *
132
+ * **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`.
133
+ *
134
+ * @experimental
135
+ */
136
+ export declare interface AreaTextLayout {
137
+ type: TextType.area;
138
+ width: number;
139
+ height: number;
140
+ }
141
+
142
+ /**
143
+ * <InlineAlert slots="text" variant="warning"/>
144
+ *
41
145
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
42
146
  */
43
147
  declare enum ArrowHeadType {
@@ -73,6 +177,7 @@ export declare class ArtboardList extends RestrictedItemList<ArtboardNode> {
73
177
  * An ArtboardNode represents an artboard object in the scenegraph. All user visual content must be contained on an artboard.
74
178
  *
75
179
  * When multiple artboards exist on a page, the artboards represent "scenes" in a linear timeline sequence.
180
+ * Please note that creating and deleting an artboard in a single frame will crash the editor.
76
181
  */
77
182
  export declare class ArtboardNode extends VisualNode implements IRectangularNode, ContainerNode {
78
183
  /**
@@ -107,6 +212,87 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
107
212
  get height(): number;
108
213
  }
109
214
 
215
+ /**
216
+ * <InlineAlert slots="text" variant="warning"/>
217
+ *
218
+ * **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`.
219
+ *
220
+ * @experimental
221
+ */
222
+ export declare interface AutoHeightTextLayout {
223
+ type: TextType.autoHeight;
224
+ width: number;
225
+ }
226
+
227
+ /**
228
+ * Font the current user has access or licensing permissions to create / edit content with.
229
+ */
230
+ export declare class AvailableFont extends BaseFont {
231
+ /**
232
+ * <InlineAlert slots="text" variant="warning"/>
233
+ *
234
+ * **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`.
235
+ *
236
+ * @experimental
237
+ * Whether the font is a premium Adobe font.
238
+ */
239
+ get isPremium(): boolean;
240
+ get availableForEditing(): true;
241
+ }
242
+
243
+ /**
244
+ * <InlineAlert slots="text" variant="warning"/>
245
+ *
246
+ * **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`.
247
+ *
248
+ * @experimental
249
+ * Base character styles that can be applied to a range of characters.
250
+ */
251
+ declare interface BaseCharacterStyles {
252
+ fontSize: number;
253
+ color: Color;
254
+ tracking: number;
255
+ underline: boolean;
256
+ }
257
+
258
+ /**
259
+ * Represents a font that is able to be rendered within this document. However, the user may not have edit permissions for
260
+ * all such fonts.
261
+ */
262
+ declare abstract class BaseFont {
263
+ /**
264
+ * <InlineAlert slots="text" variant="warning"/>
265
+ *
266
+ * **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`.
267
+ *
268
+ * @experimental
269
+ * The PostScript name of the font.
270
+ */
271
+ get postscriptName(): string;
272
+ /**
273
+ * <InlineAlert slots="text" variant="warning"/>
274
+ *
275
+ * **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`.
276
+ *
277
+ * @experimental
278
+ * The font family containing the font.
279
+ */
280
+ get family(): string;
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 style of the font within the family.
288
+ */
289
+ get style(): string;
290
+ /**
291
+ * Whether the current user has permission to create / edit content using this font.
292
+ */
293
+ abstract get availableForEditing(): boolean;
294
+ }
295
+
110
296
  /**
111
297
  * A "node" represents an object in the scenegraph, the document's visual content tree. This base class includes only the
112
298
  * most fundamental nonvisual properties that even nodes near the top of the document structure share (such as PageNode).
@@ -114,6 +300,16 @@ export declare class ArtboardNode extends VisualNode implements IRectangularNode
114
300
  * properties.
115
301
  */
116
302
  export declare class BaseNode {
303
+ /**
304
+ * <InlineAlert slots="text" variant="warning"/>
305
+ *
306
+ * **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`.
307
+ *
308
+ * @experimental
309
+ * Get {@link AddOnData} reference for managing the private metadata on this node for this add-on.
310
+ */
311
+ get addOnData(): AddOnData;
312
+
117
313
  /**
118
314
  * A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is
119
315
  * moved to a different part of the document.
@@ -170,6 +366,7 @@ export declare interface BitmapImage {
170
366
 
171
367
  /**
172
368
  * <InlineAlert slots="text" variant="warning"/>
369
+ *
173
370
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
174
371
  *
175
372
  * Determines how a scenenode is composited on top of the content rendered below it.
@@ -212,6 +409,50 @@ declare enum BlendMode {
212
409
  luminosity = 17
213
410
  }
214
411
 
412
+ /**
413
+ * <InlineAlert slots="text" variant="warning"/>
414
+ *
415
+ * **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`.
416
+ *
417
+ * @experimental
418
+ * Text styles of a range of characters, even a short span like a single word.
419
+ */
420
+ export declare interface CharacterStyles extends BaseCharacterStyles {
421
+ font: Font;
422
+ }
423
+
424
+ /**
425
+ * <InlineAlert slots="text" variant="warning"/>
426
+ *
427
+ * **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`.
428
+ *
429
+ * @experimental
430
+ * Input shape of the applyCharacterStyle API.
431
+ */
432
+ export declare interface CharacterStylesInput extends Partial<BaseCharacterStyles> {
433
+ font?: AvailableFont;
434
+ }
435
+
436
+ /**
437
+ * <InlineAlert slots="text" variant="warning"/>
438
+ *
439
+ * **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`.
440
+ *
441
+ * @experimental
442
+ * Output shape of the characterStyleRange getter.
443
+ */
444
+ export declare interface CharacterStylesRange extends CharacterStyles, StyleRange {}
445
+
446
+ /**
447
+ * <InlineAlert slots="text" variant="warning"/>
448
+ *
449
+ * **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`.
450
+ *
451
+ * @experimental
452
+ * Input shape of the characterStyleRange setter.
453
+ */
454
+ export declare interface CharacterStylesRangeInput extends CharacterStylesInput, StyleRange {}
455
+
215
456
  /**
216
457
  * Represents an RGBA color value.
217
458
  */
@@ -344,6 +585,32 @@ export declare class Context {
344
585
  * @returns The currently viewed page.
345
586
  */
346
587
  get currentPage(): PageNode;
588
+ /**
589
+ * <InlineAlert slots="text" variant="warning"/>
590
+ *
591
+ * **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`.
592
+ *
593
+ * @experimental
594
+ * Registers a handler for editor events such as selection change.
595
+ * The registered callback will be invoked when the specified event occurs.
596
+ * Note: Do not attempt to make changes to the document in response to a selection change callback because it may destabilize the application.
597
+ * @param eventName - an editor event name.
598
+ * @param callback - a callback to be registered for an editor event.
599
+ * @returns a unique ID for the registered event handler.
600
+ */
601
+ on(eventName: EditorEvent, callback: EditorEventHandler): EventHandlerId;
602
+ /**
603
+ * <InlineAlert slots="text" variant="warning"/>
604
+ *
605
+ * **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`.
606
+ *
607
+ * @experimental
608
+ * Unregisters handlers for editor events like selection change.
609
+ * @param eventName - an editor event name.
610
+ * @param handlerId - a unique ID returned by `editor.context.on` API.
611
+ * Callback that was previously registered will be removed and will no more be invoked when the event occurs.
612
+ */
613
+ off(eventName: EditorEvent, handlerId: EventHandlerId): void;
347
614
  }
348
615
 
349
616
  /**
@@ -364,7 +631,7 @@ export declare class Editor {
364
631
  * Generally, calling any setter or method is treated as an edit; but simple getters may be safely called at any time.
365
632
  *
366
633
  * Example of typical usage:
367
- * ```javascript
634
+ * ```js
368
635
  * // Assume insertImage() is called from your UI code, and given a Blob containing image data
369
636
  * async function insertImage(blob) {
370
637
  * // This function was invoked from the UI iframe, so we can make any edits we want synchronously here.
@@ -473,8 +740,11 @@ export declare class Editor {
473
740
  makeStroke(options?: Partial<SolidColorStroke>): SolidColorStroke;
474
741
  /**
475
742
  * @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
743
+ * invisible until its `fullContent` property's `text` is set. Creates point text, so the node's width will automatically
477
744
  * adjust to accommodate whatever text is set.
745
+ *
746
+ * Note: the registration point of this text node is not guaranteed to be at the top-left of the bounding box of its
747
+ * insertion parent. Recommend using `setPositionInParent` over `translation` to set the position.
478
748
  */
479
749
  createText(): TextNode;
480
750
  /**
@@ -489,6 +759,28 @@ export declare class Editor {
489
759
 
490
760
  export declare const editor: ExpressEditor;
491
761
 
762
+ /**
763
+ * <InlineAlert slots="text" variant="warning"/>
764
+ *
765
+ * **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`.
766
+ *
767
+ * @experimental
768
+ * This enum represents the supported editor events.
769
+ */
770
+ export declare enum EditorEvent {
771
+ selectionChange = "selectionChange"
772
+ }
773
+
774
+ /**
775
+ * <InlineAlert slots="text" variant="warning"/>
776
+ *
777
+ * **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`.
778
+ *
779
+ * @experimental
780
+ * This type represents function signature for the editor event handler callback.
781
+ */
782
+ export declare type EditorEventHandler = () => void;
783
+
492
784
  /**
493
785
  * An EllipseNode represents an ellipse object in the scenegraph.
494
786
  */
@@ -513,6 +805,16 @@ export declare class EllipseNode extends FillableNode {
513
805
  set ry(value: number);
514
806
  }
515
807
 
808
+ /**
809
+ * <InlineAlert slots="text" variant="warning"/>
810
+ *
811
+ * **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`.
812
+ *
813
+ * @experimental
814
+ * This type represents unique id of each event handler callback that is registered.
815
+ */
816
+ export declare type EventHandlerId = string;
817
+
516
818
  declare const expressApiModule: ApiModuleExport;
517
819
  export default expressApiModule;
518
820
 
@@ -520,6 +822,8 @@ declare class ExpressColorUtils extends ColorUtils {}
520
822
 
521
823
  declare class ExpressEditor extends Editor {}
522
824
 
825
+ declare class ExpressFonts extends Fonts {}
826
+
523
827
  /**
524
828
  * An ExpressRootNode represents the root node of the document's "scenegraph" artwork tree. The root contains a collection
525
829
  * of {@link pages}. Each page contains one or more artboards, arranged in a timeline sequence. All the visual content of
@@ -559,6 +863,7 @@ export declare class FillableNode extends StrokableNode implements IFillableNode
559
863
 
560
864
  /**
561
865
  * <InlineAlert slots="text" variant="warning"/>
866
+ *
562
867
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
563
868
  *
564
869
  * The fill rule, aka "winding rule," specifies how the interior area of a path is determined in cases where the path is
@@ -571,9 +876,11 @@ declare enum FillRule {
571
876
 
572
877
  /**
573
878
  * <InlineAlert slots="text" variant="warning"/>
879
+ *
574
880
  * *Do not depend on the literal string values of these constants*, as they may change. Always reference the enum identifiers in your code.
575
881
  *
576
882
  * <InlineAlert slots="text" variant="warning"/>
883
+ *
577
884
  * *Additional fill types may be added in the future.* If your code has different branches or cases depending on fill type,
578
885
  * always have a default/fallback case to handle any unknown values you may encounter.
579
886
  */
@@ -582,11 +889,58 @@ declare enum FillType {
582
889
  color = "Color"
583
890
  }
584
891
 
892
+ /**
893
+ * <InlineAlert slots="text" variant="warning"/>
894
+ *
895
+ * **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`.
896
+ *
897
+ * @experimental
898
+ * Represents a font in the document.
899
+ *
900
+ * Note: not every font encountered in the existing content is available for editing.
901
+ * Check the `availableForEditing` property to be sure.
902
+ */
903
+ export declare type Font = AvailableFont | UnavailableFont;
904
+
905
+ /**
906
+ * The Fonts class provides methods to work with fonts.
907
+ */
908
+ export declare class Fonts {
909
+ /**
910
+ * <InlineAlert slots="text" variant="warning"/>
911
+ *
912
+ * **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`.
913
+ *
914
+ * @experimental
915
+ * Get an {@link AvailableFont} that exactly matches the given PostScript name, if any. Only fonts that the user has permission to use
916
+ * for editing content are returned, so the result of this call is always safe to apply to a {@link TextContentModel}'s styles.
917
+ *
918
+ * @param postscriptName - The PostScript name of the font.
919
+ * @returns The Font object if found and available for editing, otherwise undefined.
920
+ */
921
+ fromPostscriptName(postscriptName: string): Promise<AvailableFont | undefined>;
922
+ }
923
+
924
+ export declare const fonts: ExpressFonts;
925
+
926
+ /**
927
+ * A GridCellNode represents the MediaContainerNode aspect of a grid cell. Unlike other MediaContainerNodes,
928
+ * GridCellNodes cannot be translated or rotated directly. This implementation translates and rotates the
929
+ * MediaRectangle child of the GridCellNode when those actions are applied.
930
+ */
931
+ export declare class GridCellNode extends MediaContainerNode {}
932
+
585
933
  /**
586
934
  * A GridLayoutNode represents a grid layout in the scenegraph. The GridLayoutNode is used to create
587
935
  * a layout grid that other content can be placed into.
588
936
  */
589
937
  export declare class GridLayoutNode extends Node implements Readonly<IRectangularNode> {
938
+ /**
939
+ * The Grid's regular children. Does not include rectangles and skips over media constainer nodes to return fill grandchildren.
940
+ * 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.
941
+ * The children cannot be added or removed.
942
+ */
943
+ get allChildren(): Readonly<Iterable<Node>>;
590
944
  /**
591
945
  * The background fill of the GridLayout.
592
946
  */
@@ -688,6 +1042,8 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
688
1042
  /**
689
1043
  * 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
1044
  * removed from their previous parent, if any – or if an item is already in *this* list, its index is simply changed.
1045
+ *
1046
+ * @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
1047
  */
692
1048
  append(...items: T[]): void;
693
1049
  /**
@@ -698,18 +1054,24 @@ export declare class ItemList<T extends ListItem> extends RestrictedItemList<T>
698
1054
  * Replace `oldItem` with `newItem` in this list. Throws if `oldItem` is not a member of this list.
699
1055
  * `newItem` is removed from its previous parent, if any – or if it's already in *this* list, its index is simply
700
1056
  * changed. No-op if both arguments are the same item.
1057
+ *
1058
+ * @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
1059
  */
702
1060
  replace(oldItem: T, newItem: T): void;
703
1061
  /**
704
1062
  * Insert `newItem` so it is immediately before `before` in this list: places `newItem` at the index that `before` used
705
1063
  * to occupy, shifting `before` and all later items to higher indices. `newItem` is removed from its previous parent,
706
1064
  * if any – or if it's already in *this* list, its index is simply changed. No-op if both arguments are the same item.
1065
+ *
1066
+ * @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
1067
  */
708
1068
  insertBefore(newItem: T, before: T): void;
709
1069
  /**
710
1070
  * Insert `newItem` so it is immediately after `after` in this list: places `newItem` at the index one higher than `after`,
711
1071
  * shifting all later items to higher indices (the index of `after` remains unchanged). `newItem` is removed from its previous parent,
712
1072
  * if any – or if it's already in *this* list, its index is simply changed. No-op if both arguments are the same item.
1073
+ *
1074
+ * @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
1075
  */
714
1076
  insertAfter(newItem: T, after: T): void;
715
1077
  }
@@ -993,6 +1355,17 @@ export declare interface Point {
993
1355
  y: number;
994
1356
  }
995
1357
 
1358
+ /**
1359
+ * <InlineAlert slots="text" variant="warning"/>
1360
+ *
1361
+ * **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`.
1362
+ *
1363
+ * @experimental
1364
+ */
1365
+ export declare interface PointTextLayout {
1366
+ type: TextType.autoWidth;
1367
+ }
1368
+
996
1369
  /**
997
1370
  * ReadOnlyItemList represents an ordered list of API objects, representing items that are all children of the
998
1371
  * same parent node. (The reverse is not necessarily true, however: this list might not include all
@@ -1144,9 +1517,11 @@ declare class RestrictedItemList<T extends ListItem> extends ReadOnlyItemList<T>
1144
1517
 
1145
1518
  /**
1146
1519
  * <InlineAlert slots="text" variant="warning"/>
1520
+ *
1147
1521
  * *Do not depend on the literal string values of these constants*, as they may change. Always reference the enum identifiers in your code.
1148
1522
  *
1149
1523
  * <InlineAlert slots="text" variant="warning"/>
1524
+ *
1150
1525
  * *Additional node types may be added in the future.* If your code has different branches or cases depending on node type,
1151
1526
  * always have a default/fallback case to handle any unknown values you may encounter.
1152
1527
  */
@@ -1155,7 +1530,6 @@ declare enum SceneNodeType {
1155
1530
  rectangle = "Rectangle",
1156
1531
  ellipse = "Ellipse",
1157
1532
  path = "Path",
1158
- text = "Text",
1159
1533
  linkedAsset = "LinkedAsset",
1160
1534
  group = "Group",
1161
1535
  artboard = "ab:Artboard",
@@ -1173,8 +1547,12 @@ declare enum SceneNodeType {
1173
1547
  solidColorShape = "SolidColorShape",
1174
1548
  /** Type of StrokeShapeNode, representing a stroke-only prepackaged shape that appears as a leaf node in the UI */
1175
1549
  strokeShape = "StrokeShape",
1550
+ /** Type of MediaContainerNode which is a child of a GridLayout, representing one of the Grid's cells*/
1551
+ gridCell = "GridCell",
1176
1552
  /** 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"
1553
+ gridLayout = "GridLayout",
1554
+ /** Type of TextNode, representing a non-threaded text or a threaded text frame */
1555
+ text = "Text"
1178
1556
  }
1179
1557
 
1180
1558
  /**
@@ -1255,6 +1633,7 @@ export declare interface Stroke {
1255
1633
 
1256
1634
  /**
1257
1635
  * <InlineAlert slots="text" variant="warning"/>
1636
+ *
1258
1637
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
1259
1638
  *
1260
1639
  * A stroke's {@link Stroke.position} determines how the thickness of the stroke is aligned along a shape's path outline.
@@ -1273,9 +1652,11 @@ export declare class StrokeShapeNode extends StrokableNode {}
1273
1652
 
1274
1653
  /**
1275
1654
  * <InlineAlert slots="text" variant="warning"/>
1655
+ *
1276
1656
  * *Do not depend on the literal string values of these constants*, as they may change. Always reference the enum identifiers in your code.
1277
1657
  *
1278
1658
  * <InlineAlert slots="text" variant="warning"/>
1659
+ *
1279
1660
  * *Additional stroke types may be added in the future.* If your code has different branches or cases depending on stroke type,
1280
1661
  * always have a default/fallback case to handle any unknown values you may encounter.
1281
1662
  */
@@ -1286,8 +1667,21 @@ declare enum StrokeType {
1286
1667
  color = "Color"
1287
1668
  }
1288
1669
 
1670
+ /**
1671
+ * Represents a range of characters defined by a length (and implicitly started at the end of the previous range).
1672
+ */
1673
+ declare interface StyleRange {
1674
+ /**
1675
+ * The length or number of characters in which character styles will be applied.
1676
+ * Note: since characters are represented as UTF-16 code units, some symbols
1677
+ * such as emojis are considered to have a length of 2.
1678
+ */
1679
+ length: number;
1680
+ }
1681
+
1289
1682
  /**
1290
1683
  * <InlineAlert slots="text" variant="warning"/>
1684
+ *
1291
1685
  * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
1292
1686
  */
1293
1687
  declare enum TextAlignment {
@@ -1297,22 +1691,180 @@ declare enum TextAlignment {
1297
1691
  }
1298
1692
 
1299
1693
  /**
1300
- * A TextNode represents a text object in the scenegraph.
1694
+ * Represents a complete piece of text content flow, which may be split across multiple {@link TextNode} frames for display.
1695
+ * Use this model to get or modify the text string and the style ranges applied to it.
1696
+ */
1697
+ export declare class TextContentModel {
1698
+ /**
1699
+ * <InlineAlert slots="text" variant="warning"/>
1700
+ *
1701
+ * **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`.
1702
+ *
1703
+ * @experimental
1704
+ * A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is
1705
+ * moved to a different part of the document.
1706
+ *
1707
+ * To determine if two TextNodes are connected to the same TextContentModel,
1708
+ * check if both models have the same id.
1709
+ * Comparing two models using `===` will always fail.
1710
+ */
1711
+ get id(): string;
1712
+ /**
1713
+ * <InlineAlert slots="text" variant="warning"/>
1714
+ *
1715
+ * **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`.
1716
+ *
1717
+ * @experimental
1718
+ * Get ordered list of all {@link TextNode}s that display this text content in the scenegraph. The text content
1719
+ * 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
1720
+ * text content may not be visible at all, if the last {@link TextNode} "frame" is not large enough to accommodate it.
1721
+ *
1722
+ * If there are multiple {@link TextNode}s, all of them must be configured to use {@link AreaTextLayout}.
1723
+ */
1724
+ get allTextNodes(): Readonly<Iterable<TextNode>>;
1725
+ /**
1726
+ * The complete text string, which may span multiple {@link TextNode} "frames" in the scenegraph.
1727
+ */
1728
+ get text(): string;
1729
+ set text(textContent: string);
1730
+ /**
1731
+ * <InlineAlert slots="text" variant="warning"/>
1732
+ *
1733
+ * **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`.
1734
+ *
1735
+ * @experimental
1736
+ * The character style ranges of this text content.
1737
+ */
1738
+ get characterStyleRanges(): readonly CharacterStylesRange[];
1739
+ set characterStyleRanges(styles: readonly CharacterStylesRangeInput[]);
1740
+ /**
1741
+ * <InlineAlert slots="text" variant="warning"/>
1742
+ *
1743
+ * **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`.
1744
+ *
1745
+ * @experimental
1746
+ * Apply one or more styles to the characters in the given range, leaving other styles in this range unchanged. Does
1747
+ * not modify any styles in the text outside this range.
1748
+ * @param styles - The styles to apply.
1749
+ * @param range - The start and length of character sequence to which the styles should be applied.
1750
+ * If not specified the styles will be applied to the entire piece of text content flow.
1751
+ */
1752
+ applyCharacterStyles(
1753
+ styles: CharacterStylesInput,
1754
+ range?: {
1755
+ start: number;
1756
+ length: number;
1757
+ }
1758
+ ): void;
1759
+ }
1760
+
1761
+ /**
1762
+ * A TextNode represents a text display frame in the scenegraph. It may display an entire piece of text, or sometimes just
1763
+ * a subset of longer text that flows across multiple TextNode "frames". Because of this, the TextNode does not directly hold
1764
+ * the text content and styles – instead it refers to a {@link TextContentModel}, which may be shared across multiple TextNodes.
1301
1765
  */
1302
1766
  export declare class TextNode extends Node {
1303
1767
  /**
1304
- * The text string of the node.
1768
+ * The model containing the complete text string and its styles, only part of which may be visible within the bounds of
1769
+ * this specific TextNode "frame." The full text content flow may be split across multiple frames, and/or it may be clipped if a
1770
+ * fixed-size frame using {@link AreaTextLayout} does not fit all the (remaining) text.
1771
+ *
1772
+ * Note: When traversing the scenegraph in search of text content, bear in mind that multiple TextNodes may refer to the
1773
+ * same single {@link TextContentModel}; this can give the impression that the same text is duplicated multiple times when it is
1774
+ * not. Use {@link TextContentModel}.id to determine whether a given piece of text content is unique or if it's already been
1775
+ * encountered before.
1776
+ */
1777
+ get fullContent(): TextContentModel;
1778
+ /**
1779
+ * <InlineAlert slots="text" variant="warning"/>
1780
+ *
1781
+ * **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`.
1782
+ *
1783
+ * @experimental
1784
+ * The next TextNode that text overflowing this node will spill into, if any. If undefined and this TextNode is fixed size
1785
+ * ({@link AreaTextLayout}), any text content that does not fit within this node's area will be clipped.
1786
+ *
1787
+ * To get *all* TextNodes that the text content may be split across, use `TextNode.fullContent.allTextNodes`.
1788
+ */
1789
+ get nextTextNode(): TextNode | undefined;
1790
+ /**
1791
+ * The text string content which is partially *or* fully displayed in this TextNode "frame."
1792
+ * WARNING: If a piece of text content flows across several TextNodes, *each* TextNode's `text` getter will return
1793
+ * the *entire* text content string.
1794
+ * @deprecated - Use the text getter on {@link TextContentModel} instead. Access it via `TextNode.fullContent.text`.
1305
1795
  */
1306
1796
  get text(): string;
1307
1797
  /**
1308
- * Sets the text content of the text node.
1798
+ * Sets the text content of the TextNode.
1799
+ * WARNING: If a piece of text content flows across several TextNodes,
1800
+ * *each* TextNode's `text` setter will sets the *entire* text content string.
1801
+ * @deprecated - Use the text setter on {@link TextContentModel} instead. Access it via `TextNode.fullContent.text`.
1309
1802
  */
1310
1803
  set text(textContent: string);
1311
1804
  /**
1312
- * The horizontal text alignment of the text node. Alignment is always the same across this node's entire text content.
1805
+ * The horizontal text alignment of the TextNode. Alignment is always the same across this node's entire text content.
1313
1806
  */
1314
1807
  get textAlignment(): TextAlignment;
1315
1808
  set textAlignment(alignment: TextAlignment);
1809
+ /**
1810
+ * <InlineAlert slots="text" variant="warning"/>
1811
+ *
1812
+ * **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`.
1813
+ *
1814
+ * @experimental
1815
+ * @returns The list of visual effects applied to the TextNode.
1816
+ */
1817
+ get visualEffects(): readonly VisualEffectType[];
1818
+ /**
1819
+ * <InlineAlert slots="text" variant="warning"/>
1820
+ *
1821
+ * **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`.
1822
+ *
1823
+ * @experimental
1824
+ * @returns The layout mode of the TextNode "frame."
1825
+ */
1826
+ get layout(): Readonly<PointTextLayout | AutoHeightTextLayout | AreaTextLayout | UnsupportedTextLayout>;
1827
+ /**
1828
+ * <InlineAlert slots="text" variant="warning"/>
1829
+ *
1830
+ * **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`.
1831
+ *
1832
+ * @experimental
1833
+ * Sets the layout mode of the TextNode "frame."
1834
+ *
1835
+ * If this TextNode is part of a multi-frame text content flow, it must be configured to use {@link AreaTextLayout}. Other
1836
+ * layout modes are only available for single-frame text.
1837
+ *
1838
+ * @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.
1839
+ * @throws if TextNode is part of a multi-frame text content flow and the layout is not {@link AreaTextLayout}.
1840
+ */
1841
+ set layout(layout: PointTextLayout | AutoHeightTextLayout | AreaTextLayout);
1842
+ }
1843
+
1844
+ /**
1845
+ * <InlineAlert slots="text" variant="warning"/>
1846
+ *
1847
+ * *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
1848
+ */
1849
+ declare enum TextType {
1850
+ /**
1851
+ * Point text
1852
+ */
1853
+ autoWidth = 0,
1854
+ /**
1855
+ * Soft bottom
1856
+ */
1857
+ autoHeight = 1,
1858
+ area = 2,
1859
+ magicFit = 3,
1860
+ circular = 4
1861
+ }
1862
+
1863
+ /**
1864
+ * Font the current user does not have access or licensing permissions to create / edit content with.
1865
+ */
1866
+ export declare class UnavailableFont extends BaseFont {
1867
+ get availableForEditing(): false;
1316
1868
  }
1317
1869
 
1318
1870
  /**
@@ -1320,6 +1872,32 @@ export declare class TextNode extends Node {
1320
1872
  */
1321
1873
  export declare class UnknownNode extends Node {}
1322
1874
 
1875
+ /**
1876
+ * <InlineAlert slots="text" variant="warning"/>
1877
+ *
1878
+ * **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`.
1879
+ *
1880
+ * @experimental
1881
+ */
1882
+ export declare interface UnsupportedTextLayout {
1883
+ type: TextType.magicFit | TextType.circular;
1884
+ }
1885
+
1886
+ /**
1887
+ * <InlineAlert slots="text" variant="warning"/>
1888
+ *
1889
+ * **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`.
1890
+ *
1891
+ * @experimental
1892
+ * Visual effects that can be applied to a text node.
1893
+ */
1894
+ declare enum VisualEffectType {
1895
+ generativeTextEffects = "GenerativeTextEffects",
1896
+ outline = "Outline",
1897
+ shadow = "Shadow",
1898
+ shapeDecoration = "ShapeDecoration"
1899
+ }
1900
+
1323
1901
  /**
1324
1902
  * A "node" represents an object in the scenegraph, the document's visual content tree. This class represents any node
1325
1903
  * 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
  */
@@ -519,7 +518,6 @@ declare namespace Constants {
519
518
  export { Constants };
520
519
 
521
520
  /**
522
- * @experimental - Experimental API
523
521
  * Interface for the current platform
524
522
  */
525
523
  export declare interface CurrentPlatformPayload {
@@ -599,7 +597,6 @@ export declare interface DevFlags {
599
597
  }
600
598
 
601
599
  /**
602
- * @experimental - Experimental API
603
600
  * Denotes the device class
604
601
  */
605
602
  export declare enum DeviceClass {
@@ -683,9 +680,13 @@ export declare type DisableDragToDocument = () => void;
683
680
  */
684
681
  declare interface Document_2 {
685
682
  /**
686
- * Add image/gif/Ps/Ai files to the current page
683
+ * Add image/Ps/Ai files to the current page
687
684
  */
688
685
  addImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
686
+ /**
687
+ * Add GIF files to the current page
688
+ */
689
+ addAnimatedImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
689
690
  /**
690
691
  * Add video to the current page
691
692
  */
@@ -1231,7 +1232,6 @@ export declare interface PdfRenditionOptions extends RenditionOptions {
1231
1232
  }
1232
1233
 
1233
1234
  /**
1234
- * @experimental - Experimental API
1235
1235
  * Denotes the enum for current environment
1236
1236
  */
1237
1237
  export declare enum PlatformEnvironment {
@@ -1246,7 +1246,6 @@ export declare enum PlatformEnvironment {
1246
1246
  }
1247
1247
 
1248
1248
  /**
1249
- * @experimental - Experimental API
1250
1249
  * Denotes the type of platform
1251
1250
  */
1252
1251
  export declare enum PlatformType {
@@ -1273,7 +1272,7 @@ export declare enum PlatformType {
1273
1272
  /**
1274
1273
  * Firefox Browser
1275
1274
  */
1276
- fireforxBrowser = "firefoxBrowser",
1275
+ firefoxBrowser = "firefoxBrowser",
1277
1276
  /**
1278
1277
  * Edge Browser
1279
1278
  */