@adobe/ccweb-add-on-sdk-types 1.2.1 → 1.4.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/README.md CHANGED
@@ -10,11 +10,8 @@ This package exports type definitions for [@adobe/create-ccweb-add-on](https://w
10
10
 
11
11
  ## Usage Notes
12
12
 
13
- For TypeScript add-on projects created using [@adobe/create-ccweb-add-on](https://www.npmjs.com/package/@adobe/create-ccweb-add-on), this package is pre-installed. Additionally, the below files are included in the add-on project (based on the selected runtime):
13
+ This package contains Add-on SDK type definitions. However, in itself this package is unusable. You must install [@types/adobe\_\_ccweb-add-on-sdk](https://www.npmjs.com/package/@types/adobe__ccweb-add-on-sdk) instead, to use the Add-on SDK type definitions in your Add-on project.
14
14
 
15
- - [add-on-ui-sdk.d.ts](https://github.com/adobe/create-ccweb-add-on/blob/main/packages/wxp-sdk-types/add-on-ui-sdk.d.ts)
16
- - [add-on-sandbox-sdk.d.ts](https://github.com/adobe/create-ccweb-add-on/blob/main/packages/wxp-sdk-types/add-on-sandbox-sdk.d.ts)
17
-
18
- However, if you are installing this package on your existing add-on project, ensure to include the above type definition files in your `src` directory.
15
+ For add-on projects created using [@adobe/create-ccweb-add-on](https://www.npmjs.com/package/@adobe/create-ccweb-add-on), [@types/adobe\_\_ccweb-add-on-sdk](https://www.npmjs.com/package/@types/adobe__ccweb-add-on-sdk) is pre-installed.
19
16
 
20
17
  For more information about developing Adobe Express add-ons, check out the [documentation](https://developer.adobe.com/express/add-ons/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/ccweb-add-on-sdk-types",
3
- "version": "1.2.1",
3
+ "version": "1.4.0",
4
4
  "author": "Adobe",
5
5
  "license": "MIT",
6
6
  "description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
@@ -121,6 +121,11 @@ export declare class BaseNode {
121
121
  */
122
122
  get allChildren(): Readonly<Iterable<BaseNode>>;
123
123
 
124
+ /**
125
+ * A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is
126
+ * moved to a different part of the document.
127
+ */
128
+ get id(): string;
124
129
  /**
125
130
  * The node's type.
126
131
  */
@@ -421,6 +426,14 @@ export declare class Editor {
421
426
  * @returns a stroke configured with the given options.
422
427
  */
423
428
  makeStroke(options?: Partial<Stroke>): Stroke;
429
+ /**
430
+ * @returns a path node with a default stroke and no initial fill.
431
+ * @param path - a string representing any [SVG path element](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths).
432
+ * Note that the path data will be normalized, and therefore the `path` getter may return a different SVG string from the path creation input.
433
+ * For example, "M 10 80 Q 52.5 10, 95 80 T 180 80" becomes "M 10 80 C 38.33 33.33 66.67 33.33 95 80...".
434
+ * Throws if the input is empty or is not legal SVG path syntax.
435
+ */
436
+ createPath(path: string): PathNode;
424
437
  /**
425
438
  * @returns a text node with default styles. The text content is initially empty, so the text node will be
426
439
  * invisible until its `text` property is set. Creates point text, so the node's width will automatically
@@ -908,14 +921,16 @@ export declare class PageNode extends BaseNode implements Readonly<IRectangularN
908
921
  export declare class PathNode extends FillableNode {
909
922
  /**
910
923
  * The path definition as an SVG string. The path data is read-only and cannot be modified via this API yet.
911
- * Example: "M 0 0 L 10 15".
924
+ * Note that the path data will be normalized, and therefore the `path` getter may return a different SVG string from the path creation input.
925
+ * For example, "M 10 80 Q 52.5 10, 95 80 T 180 80" becomes "M 10 80 C 38.33 33.33 66.67 33.33 95 80...".
912
926
  */
913
927
  get path(): string;
914
928
  /**
915
929
  * The fill rule specifies how the interior area of a path is determined in cases where the path is self-intersecting or
916
- * has multiple disjoint parts. This value is read-only and cannot be modified via this API yet.
930
+ * has multiple disjoint parts. The default value is nonZero.
917
931
  */
918
932
  get fillRule(): FillRule;
933
+ set fillRule(fillRule: FillRule);
919
934
  }
920
935
 
921
936
  /**
package/ui/ui-sdk.d.ts CHANGED
@@ -25,7 +25,7 @@
25
25
  /**
26
26
  * Base interface for all type of add-ons
27
27
  */
28
- export declare interface AddOn {
28
+ export declare interface AddOn extends AddOnBase {
29
29
  /**
30
30
  * Represents the current add-on runtime
31
31
  */
@@ -40,6 +40,11 @@ export declare interface AddOn {
40
40
  readonly clientStorage: ClientStorage;
41
41
  }
42
42
 
43
+ /**
44
+ * Interface that represents the APIs directly exposed by the AddOn interface
45
+ */
46
+ declare interface AddOnBase {}
47
+
43
48
  /**
44
49
  * @public
45
50
  * The main API Interface exposed by this SDK to the consuming Add-on code.
@@ -221,7 +226,6 @@ declare interface ApplicationBase {
221
226
  showModalDialog(dialogOptions: CustomDialogOptions): Promise<CustomDialogResult>;
222
227
 
223
228
  /**
224
- * @experimental - Experimental API
225
229
  * Triggers/Starts the in-app monetization upgrade flow
226
230
  * @returns if the user is premium user or not
227
231
  */
@@ -462,6 +466,7 @@ declare namespace Constants {
462
466
  ButtonType,
463
467
  RuntimeType,
464
468
  BleedUnit,
469
+ VideoResolution,
465
470
  AuthorizationStatus
466
471
  };
467
472
  }
@@ -477,7 +482,6 @@ export declare interface CurrentUser {
477
482
  userId(): Promise<string>;
478
483
 
479
484
  /**
480
- * @experimental - Experimental API
481
485
  * @returns if the current user is a premium user
482
486
  */
483
487
  isPremiumUser(): Promise<boolean>;
@@ -591,9 +595,9 @@ export declare type DisableDragToDocument = () => void;
591
595
  */
592
596
  declare interface Document_2 {
593
597
  /**
594
- * Add image/gif to the current page
598
+ * Add image/gif/Ps/Ai files to the current page
595
599
  */
596
- addImage(blob: Blob): Promise<void>;
600
+ addImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
597
601
  /**
598
602
  * Add video to the current page
599
603
  */
@@ -607,7 +611,6 @@ declare interface Document_2 {
607
611
  */
608
612
  createRenditions(renditionOptions: RenditionOptions, renditionIntent?: RenditionIntent): Promise<Rendition[]>;
609
613
  /**
610
- * @experimental - Experimental API
611
614
  * Get metadata of all or range of pages of the document
612
615
  */
613
616
  getPagesMetadata(options: PageMetadataOptions): Promise<PageMetadata[]>;
@@ -749,8 +752,8 @@ export declare interface JpgRenditionOptions extends RenditionOptions {
749
752
  * Requested size
750
753
  */
751
754
  requestedSize?: {
752
- width: number;
753
- height: number;
755
+ width?: number;
756
+ height?: number;
754
757
  };
755
758
  }
756
759
 
@@ -822,6 +825,21 @@ export declare interface MediaAttributes {
822
825
  title: string;
823
826
  }
824
827
 
828
+ export declare interface Mp4RenditionOptions extends RenditionOptions {
829
+ /**
830
+ * mp4 rendition format
831
+ */
832
+ format: RenditionFormat.mp4;
833
+ /**
834
+ * Video resolution
835
+ */
836
+ resolution?: VideoResolution;
837
+ /**
838
+ * Custom Resolution (in pixel)
839
+ */
840
+ customResolution?: number;
841
+ }
842
+
825
843
  /**
826
844
  * OAuth 2.0 middleware for handling user sign-in.
827
845
  */
@@ -907,15 +925,78 @@ export declare interface PageRendition extends Rendition {
907
925
  metadata: PageMetadata;
908
926
  }
909
927
 
928
+ /**
929
+ * Represents a PDF Page box
930
+ */
931
+ export declare interface PdfPageBox {
932
+ /**
933
+ * Margins for a box
934
+ */
935
+ margins: PdfPageBoxMargins;
936
+ }
937
+
938
+ /**
939
+ * All the PDF Page boxes (MediaBox, BleedBox, CropBox, TrimBox)
940
+ */
941
+ export declare interface PdfPageBoxes {
942
+ /**
943
+ * Media box
944
+ */
945
+ mediaBox?: PdfPageBox;
946
+ /**
947
+ * Bleed box
948
+ */
949
+ bleedBox?: PdfPageBox;
950
+ /**
951
+ * Crop box
952
+ */
953
+ cropBox?: PdfPageBox;
954
+ /**
955
+ * Trim box
956
+ */
957
+ trimBox?: PdfPageBox;
958
+ }
959
+
960
+ /**
961
+ * Margins for a PDF page box
962
+ */
963
+ export declare interface PdfPageBoxMargins {
964
+ /**
965
+ * Top margin
966
+ */
967
+ top?: Bleed;
968
+ /**
969
+ * Bottom margin
970
+ */
971
+ bottom?: Bleed;
972
+ /**
973
+ * Left margin
974
+ */
975
+ left?: Bleed;
976
+ /**
977
+ * Right margin
978
+ */
979
+ right?: Bleed;
980
+ }
981
+
910
982
  export declare interface PdfRenditionOptions extends RenditionOptions {
911
983
  /**
912
984
  * PDF rendition format
913
985
  */
914
986
  format: RenditionFormat.pdf;
915
987
  /**
916
- * Bleed for the page. If undefined, then no bleed (zero).
988
+ * Bleed for the page.
989
+ * If bleed is defined, then CropBox and TrimBox will be the size of the express document. BleedBox and MediaBox will be equal to each other,
990
+ * and they will expand on all sides (left, top, right, bottom) with the amount/unit specified by bleed.
991
+ * If undefined, then no bleed (zero).
917
992
  */
918
993
  bleed?: Bleed;
994
+ /**
995
+ * Exposes ability to customize each PDF Page Box (MediaBox, BleedBox, CropBox, TrimBox) dimensions,
996
+ * by defining how much it should expand on each side beyond the express document page size.
997
+ * If pageBoxes are defined, then PdfRenditionOptions.bleed is ignored.
998
+ */
999
+ pageBoxes?: PdfPageBoxes;
919
1000
  }
920
1001
 
921
1002
  export declare interface PngRenditionOptions extends RenditionOptions {
@@ -933,8 +1014,8 @@ export declare interface PngRenditionOptions extends RenditionOptions {
933
1014
  * Requested size
934
1015
  */
935
1016
  requestedSize?: {
936
- width: number;
937
- height: number;
1017
+ width?: number;
1018
+ height?: number;
938
1019
  };
939
1020
  }
940
1021
 
@@ -1065,7 +1146,11 @@ export declare enum RenditionIntent {
1065
1146
  /**
1066
1147
  * Intent to preview the content
1067
1148
  */
1068
- preview = "preview"
1149
+ preview = "preview",
1150
+ /**
1151
+ * Intent to export and print the content
1152
+ */
1153
+ print = "print"
1069
1154
  }
1070
1155
 
1071
1156
  export declare interface RenditionOptions {
@@ -1221,4 +1306,26 @@ export declare enum Variant {
1221
1306
  custom = "custom"
1222
1307
  }
1223
1308
 
1309
+ /**
1310
+ * Video resolution options for the mp4 renditions
1311
+ */
1312
+ export declare enum VideoResolution {
1313
+ /**
1314
+ * SD 480p video resolution
1315
+ */
1316
+ sd480p = "480p",
1317
+ /**
1318
+ * HD 720p video resolution
1319
+ */
1320
+ hd720p = "720p",
1321
+ /**
1322
+ * FHD 1080p video resolution
1323
+ */
1324
+ fhd1080p = "1080p",
1325
+ /**
1326
+ * Custom video resolution
1327
+ */
1328
+ custom = "custom"
1329
+ }
1330
+
1224
1331
  export {};