@adobe/ccweb-add-on-sdk-types 1.3.0 → 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 +2 -5
- package/package.json +1 -1
- package/sandbox/express-document-sdk.d.ts +17 -2
- package/ui/ui-sdk.d.ts +113 -11
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
|
-
|
|
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
|
-
-
|
|
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
|
@@ -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
|
-
*
|
|
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.
|
|
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
|
@@ -226,7 +226,6 @@ declare interface ApplicationBase {
|
|
|
226
226
|
showModalDialog(dialogOptions: CustomDialogOptions): Promise<CustomDialogResult>;
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
|
-
* @experimental - Experimental API
|
|
230
229
|
* Triggers/Starts the in-app monetization upgrade flow
|
|
231
230
|
* @returns if the user is premium user or not
|
|
232
231
|
*/
|
|
@@ -467,6 +466,7 @@ declare namespace Constants {
|
|
|
467
466
|
ButtonType,
|
|
468
467
|
RuntimeType,
|
|
469
468
|
BleedUnit,
|
|
469
|
+
VideoResolution,
|
|
470
470
|
AuthorizationStatus
|
|
471
471
|
};
|
|
472
472
|
}
|
|
@@ -482,7 +482,6 @@ export declare interface CurrentUser {
|
|
|
482
482
|
userId(): Promise<string>;
|
|
483
483
|
|
|
484
484
|
/**
|
|
485
|
-
* @experimental - Experimental API
|
|
486
485
|
* @returns if the current user is a premium user
|
|
487
486
|
*/
|
|
488
487
|
isPremiumUser(): Promise<boolean>;
|
|
@@ -596,9 +595,9 @@ export declare type DisableDragToDocument = () => void;
|
|
|
596
595
|
*/
|
|
597
596
|
declare interface Document_2 {
|
|
598
597
|
/**
|
|
599
|
-
* Add image/gif to the current page
|
|
598
|
+
* Add image/gif/Ps/Ai files to the current page
|
|
600
599
|
*/
|
|
601
|
-
addImage(blob: Blob): Promise<void>;
|
|
600
|
+
addImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
602
601
|
/**
|
|
603
602
|
* Add video to the current page
|
|
604
603
|
*/
|
|
@@ -612,7 +611,6 @@ declare interface Document_2 {
|
|
|
612
611
|
*/
|
|
613
612
|
createRenditions(renditionOptions: RenditionOptions, renditionIntent?: RenditionIntent): Promise<Rendition[]>;
|
|
614
613
|
/**
|
|
615
|
-
* @experimental - Experimental API
|
|
616
614
|
* Get metadata of all or range of pages of the document
|
|
617
615
|
*/
|
|
618
616
|
getPagesMetadata(options: PageMetadataOptions): Promise<PageMetadata[]>;
|
|
@@ -754,8 +752,8 @@ export declare interface JpgRenditionOptions extends RenditionOptions {
|
|
|
754
752
|
* Requested size
|
|
755
753
|
*/
|
|
756
754
|
requestedSize?: {
|
|
757
|
-
width
|
|
758
|
-
height
|
|
755
|
+
width?: number;
|
|
756
|
+
height?: number;
|
|
759
757
|
};
|
|
760
758
|
}
|
|
761
759
|
|
|
@@ -827,6 +825,21 @@ export declare interface MediaAttributes {
|
|
|
827
825
|
title: string;
|
|
828
826
|
}
|
|
829
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
|
+
|
|
830
843
|
/**
|
|
831
844
|
* OAuth 2.0 middleware for handling user sign-in.
|
|
832
845
|
*/
|
|
@@ -912,15 +925,78 @@ export declare interface PageRendition extends Rendition {
|
|
|
912
925
|
metadata: PageMetadata;
|
|
913
926
|
}
|
|
914
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
|
+
|
|
915
982
|
export declare interface PdfRenditionOptions extends RenditionOptions {
|
|
916
983
|
/**
|
|
917
984
|
* PDF rendition format
|
|
918
985
|
*/
|
|
919
986
|
format: RenditionFormat.pdf;
|
|
920
987
|
/**
|
|
921
|
-
* Bleed for the page.
|
|
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).
|
|
922
992
|
*/
|
|
923
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;
|
|
924
1000
|
}
|
|
925
1001
|
|
|
926
1002
|
export declare interface PngRenditionOptions extends RenditionOptions {
|
|
@@ -938,8 +1014,8 @@ export declare interface PngRenditionOptions extends RenditionOptions {
|
|
|
938
1014
|
* Requested size
|
|
939
1015
|
*/
|
|
940
1016
|
requestedSize?: {
|
|
941
|
-
width
|
|
942
|
-
height
|
|
1017
|
+
width?: number;
|
|
1018
|
+
height?: number;
|
|
943
1019
|
};
|
|
944
1020
|
}
|
|
945
1021
|
|
|
@@ -1070,7 +1146,11 @@ export declare enum RenditionIntent {
|
|
|
1070
1146
|
/**
|
|
1071
1147
|
* Intent to preview the content
|
|
1072
1148
|
*/
|
|
1073
|
-
preview = "preview"
|
|
1149
|
+
preview = "preview",
|
|
1150
|
+
/**
|
|
1151
|
+
* Intent to export and print the content
|
|
1152
|
+
*/
|
|
1153
|
+
print = "print"
|
|
1074
1154
|
}
|
|
1075
1155
|
|
|
1076
1156
|
export declare interface RenditionOptions {
|
|
@@ -1226,4 +1306,26 @@ export declare enum Variant {
|
|
|
1226
1306
|
custom = "custom"
|
|
1227
1307
|
}
|
|
1228
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
|
+
|
|
1229
1331
|
export {};
|