@adobe/ccweb-add-on-sdk-types 1.20.1 → 1.21.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 +2 -2
- package/sandbox/express-document-sdk.d.ts +7 -0
- package/ui/ui-sdk.d.ts +65 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/ccweb-add-on-sdk-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"author": "Adobe",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"tslib": "2.7.0",
|
|
42
42
|
"gl-matrix": "3.3.0",
|
|
43
|
-
"@swc/helpers": "0.5.
|
|
43
|
+
"@swc/helpers": "0.5.17"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "18.18.2",
|
|
@@ -1211,6 +1211,11 @@ export declare class MediaContainerNode extends Node {
|
|
|
1211
1211
|
* (as well as its maskShape sibling node).
|
|
1212
1212
|
*/
|
|
1213
1213
|
export declare abstract class MediaRectangleNode extends Node implements Readonly<IRectangularNode> {
|
|
1214
|
+
/**
|
|
1215
|
+
* Get {@link AddOnData} reference for managing private metadata attached to the media resource displayed by this node.
|
|
1216
|
+
* The same media resource may be reused in multiple places in the document, and all share the same AddOnData state.
|
|
1217
|
+
*/
|
|
1218
|
+
get mediaAddOnData(): AddOnData;
|
|
1214
1219
|
/**
|
|
1215
1220
|
* Current width of the "full frame" uncropped media, which may not be fully visible due to cropping/clipping by the
|
|
1216
1221
|
* enclosing media container's maskShape. This size may be different from the original image/video size in pixels, but
|
|
@@ -1785,6 +1790,8 @@ declare enum SceneNodeType {
|
|
|
1785
1790
|
mediaContainer = "MediaContainer",
|
|
1786
1791
|
/** Type of MediaContainerNode's "media rectangle" child when it is holding an image */
|
|
1787
1792
|
imageRectangle = "ImageRectangle",
|
|
1793
|
+
/** Type of MediaContainerNode's "media rectangle" child when it is holding an unknown media type */
|
|
1794
|
+
unknownMediaRectangle = "UnknownMediaRectangle",
|
|
1788
1795
|
/** Type of PageNode */
|
|
1789
1796
|
page = "Page",
|
|
1790
1797
|
/** Type of ComplexShapeNode, representing a complex prepackaged shape with fill and stroke, that appears as a leaf node in the UI */
|
package/ui/ui-sdk.d.ts
CHANGED
|
@@ -151,6 +151,10 @@ export declare enum AppEvent {
|
|
|
151
151
|
* triggered when drag is complete on the currently dragged element.
|
|
152
152
|
*/
|
|
153
153
|
dragend = "dragend",
|
|
154
|
+
/**
|
|
155
|
+
* triggered when drag is cancelled on the currently dragged element.
|
|
156
|
+
*/
|
|
157
|
+
dragcancel = "dragcancel",
|
|
154
158
|
|
|
155
159
|
/**
|
|
156
160
|
* triggered when the document id is available in the application.
|
|
@@ -186,6 +190,7 @@ declare interface AppEventsTypeMap {
|
|
|
186
190
|
[AppEvent.reset]: undefined;
|
|
187
191
|
[AppEvent.dragstart]: AppDragStartEventData;
|
|
188
192
|
[AppEvent.dragend]: AppDragEndEventData;
|
|
193
|
+
[AppEvent.dragcancel]: undefined;
|
|
189
194
|
|
|
190
195
|
[AppEvent.documentIdAvailable]: DocumentIdAvailableEventData;
|
|
191
196
|
[AppEvent.documentLinkAvailable]: DocumentLinkAvailableEventData;
|
|
@@ -215,6 +220,11 @@ export declare interface Application extends ApplicationBase {
|
|
|
215
220
|
* Represents the active document of the host application
|
|
216
221
|
*/
|
|
217
222
|
readonly document: Document_2;
|
|
223
|
+
/**
|
|
224
|
+
* @experimental - Experimental API
|
|
225
|
+
* Invoke command/actions in an add-on and handle response.
|
|
226
|
+
*/
|
|
227
|
+
readonly command: Command;
|
|
218
228
|
/**
|
|
219
229
|
* OAuth 2.0 middleware for handling user authorization.
|
|
220
230
|
*/
|
|
@@ -661,6 +671,25 @@ export declare enum ColorPickerPlacement {
|
|
|
661
671
|
right = "right"
|
|
662
672
|
}
|
|
663
673
|
|
|
674
|
+
/**
|
|
675
|
+
* @experimental - Experimental API
|
|
676
|
+
* Provides APIs to handle command execution in the add-on.
|
|
677
|
+
*/
|
|
678
|
+
export declare interface Command {
|
|
679
|
+
/**
|
|
680
|
+
* @experimental - Experimental API
|
|
681
|
+
* Register a handler for handling command execution in the add-on.
|
|
682
|
+
*
|
|
683
|
+
* _Note:_ This is similar to a JavaScript event handler.
|
|
684
|
+
* If there are multiple handlers registered for a command,
|
|
685
|
+
* each will be invoked when the host application triggers the command.
|
|
686
|
+
* In most of the cases, one handler per command is the way to go.
|
|
687
|
+
* @param command - Command triggered from the host application.
|
|
688
|
+
* @param handler - Handler for command execution.
|
|
689
|
+
*/
|
|
690
|
+
register(command: string, handler: (params: Record<string, unknown>) => unknown): void;
|
|
691
|
+
}
|
|
692
|
+
|
|
664
693
|
declare namespace Constants {
|
|
665
694
|
export {
|
|
666
695
|
Range_2 as Range,
|
|
@@ -860,15 +889,15 @@ declare interface Document_2 {
|
|
|
860
889
|
/**
|
|
861
890
|
* Add image/Ps/Ai files to the current page
|
|
862
891
|
*/
|
|
863
|
-
addImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
892
|
+
addImage(blob: Blob, attributes?: MediaAttributes, importAddOnData?: ImportAddOnData): Promise<void>;
|
|
864
893
|
/**
|
|
865
894
|
* Add GIF files to the current page
|
|
866
895
|
*/
|
|
867
|
-
addAnimatedImage(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
896
|
+
addAnimatedImage(blob: Blob, attributes?: MediaAttributes, importAddOnData?: ImportAddOnData): Promise<void>;
|
|
868
897
|
/**
|
|
869
898
|
* Add video to the current page
|
|
870
899
|
*/
|
|
871
|
-
addVideo(blob: Blob, attributes?: MediaAttributes): Promise<void>;
|
|
900
|
+
addVideo(blob: Blob, attributes?: MediaAttributes, importAddOnData?: ImportAddOnData): Promise<void>;
|
|
872
901
|
/**
|
|
873
902
|
* Add audio to the current page
|
|
874
903
|
*/
|
|
@@ -882,6 +911,11 @@ declare interface Document_2 {
|
|
|
882
911
|
* Get metadata of all or range of pages of the document
|
|
883
912
|
*/
|
|
884
913
|
getPagesMetadata(options: PageMetadataOptions): Promise<PageMetadata[]>;
|
|
914
|
+
/**
|
|
915
|
+
* @experimental - Experimental API
|
|
916
|
+
* Get the currently selected page ids.
|
|
917
|
+
*/
|
|
918
|
+
getSelectedPageIds(): Promise<string[]>;
|
|
885
919
|
/**
|
|
886
920
|
* Get document id
|
|
887
921
|
*/
|
|
@@ -1068,6 +1102,10 @@ export declare enum EntrypointType {
|
|
|
1068
1102
|
* Widget entrypoint type.
|
|
1069
1103
|
*/
|
|
1070
1104
|
WIDGET = "widget",
|
|
1105
|
+
/**
|
|
1106
|
+
* Command entrypoint type.
|
|
1107
|
+
*/
|
|
1108
|
+
COMMAND = "command",
|
|
1071
1109
|
/**
|
|
1072
1110
|
* Script entrypoint type.
|
|
1073
1111
|
* add-ons with script entrypoint type can use only the document sandbox APIs.
|
|
@@ -1188,6 +1226,24 @@ export declare enum FrameRate {
|
|
|
1188
1226
|
fps60 = 60
|
|
1189
1227
|
}
|
|
1190
1228
|
|
|
1229
|
+
/**
|
|
1230
|
+
* Represents the add-on data for a node.
|
|
1231
|
+
* Note: This support is not present for PSD/AI assets.
|
|
1232
|
+
*/
|
|
1233
|
+
export declare interface ImportAddOnData {
|
|
1234
|
+
/**
|
|
1235
|
+
* The node add-on data which will persist on the image frame even if the image content is replaced with a
|
|
1236
|
+
* different one. This data can be accessed later via the MediaContainerNode.addOnData API.
|
|
1237
|
+
*/
|
|
1238
|
+
nodeAddOnData?: Record<string, string>;
|
|
1239
|
+
/**
|
|
1240
|
+
* The media add-on data which will reset if the image is replaced with a different one. All copies of the
|
|
1241
|
+
* same image in the document will share the same mediaAddOnData. This data can be accessed later via the
|
|
1242
|
+
* MediaRectangleNode.mediaAddOnData API.
|
|
1243
|
+
*/
|
|
1244
|
+
mediaAddOnData?: Record<string, string>;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1191
1247
|
/**
|
|
1192
1248
|
* Type of input dialog data passed from the add-on.
|
|
1193
1249
|
*/
|
|
@@ -1912,7 +1968,11 @@ export declare enum RuntimeType {
|
|
|
1912
1968
|
/**
|
|
1913
1969
|
* Add-On's document model sandbox - JS runtime that hosts add-on code that has direct access to the full model.
|
|
1914
1970
|
*/
|
|
1915
|
-
documentSandbox = "documentSandbox"
|
|
1971
|
+
documentSandbox = "documentSandbox",
|
|
1972
|
+
/**
|
|
1973
|
+
* Runtime that hosts the add-on command logic.
|
|
1974
|
+
*/
|
|
1975
|
+
command = "command"
|
|
1916
1976
|
}
|
|
1917
1977
|
|
|
1918
1978
|
/**
|
|
@@ -2072,5 +2132,4 @@ export declare enum VideoResolution {
|
|
|
2072
2132
|
custom = "custom"
|
|
2073
2133
|
}
|
|
2074
2134
|
|
|
2075
|
-
export {
|
|
2076
|
-
|
|
2135
|
+
export {};
|