@adobe/ccweb-add-on-sdk-types 1.7.0 → 1.9.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 -1
- package/sandbox/express-document-sdk.d.ts +79 -24
- package/ui/ui-sdk.d.ts +118 -0
- package/tsconfig.json +0 -28
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.9.0",
|
|
4
4
|
"author": "Adobe",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Type definitions for Adobe Creative Cloud Web Add-on SDK.",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"tslib": "2.6.2",
|
|
42
|
+
"@swc/helpers": "0.5.12",
|
|
42
43
|
"gl-matrix": "3.3.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
@@ -453,22 +453,24 @@ export declare class Editor {
|
|
|
453
453
|
*
|
|
454
454
|
* @param bitmapData - Encoded image data in PNG or JPEG format.
|
|
455
455
|
*/
|
|
456
|
-
loadBitmapImage(
|
|
456
|
+
loadBitmapImage(bitmapData: Blob): Promise<BitmapImage>;
|
|
457
457
|
/**
|
|
458
|
-
* Convenience helper to create a complete
|
|
459
|
-
* populated with default values.
|
|
458
|
+
* Convenience helper to create a complete SolidColorStroke value given just a
|
|
459
|
+
* subset of its fields. All other fields are populated with default values.
|
|
460
460
|
*
|
|
461
|
-
* See {@link
|
|
461
|
+
* See {@link SolidColorStroke} for more details on the `options` fields. Defaults:
|
|
462
462
|
* - `color` has default value {@link DEFAULT_STROKE_COLOR} if none is provided.
|
|
463
463
|
* - `width` has default value {@link DEFAULT_STROKE_WIDTH} if none is provided.
|
|
464
464
|
* - `position` has default value `center` if none is provided.
|
|
465
465
|
* - `dashPattern` has default value [] if none is provided.
|
|
466
466
|
* - `dashOffset` has default value 0 if none is provided. This field is ignored
|
|
467
467
|
* if no `dashPattern` was provided.
|
|
468
|
+
* - `type` has default value SolidColorStroke.type if none is provided. This field
|
|
469
|
+
* shouldn't be set to any other value.
|
|
468
470
|
*
|
|
469
471
|
* @returns a stroke configured with the given options.
|
|
470
472
|
*/
|
|
471
|
-
makeStroke(options?: Partial<
|
|
473
|
+
makeStroke(options?: Partial<SolidColorStroke>): SolidColorStroke;
|
|
472
474
|
/**
|
|
473
475
|
* @returns a text node with default styles. The text content is initially empty, so the text node will be
|
|
474
476
|
* invisible until its `text` property is set. Creates point text, so the node's width will automatically
|
|
@@ -534,7 +536,8 @@ export declare class ExpressRootNode extends BaseNode {
|
|
|
534
536
|
|
|
535
537
|
/**
|
|
536
538
|
* Base interface representing any fill in the scenegraph. See {@link FillableNode}.
|
|
537
|
-
*
|
|
539
|
+
* Currently, you can only create {@link ColorFill}s, but you might encounter
|
|
540
|
+
* other fill types when reading scenegraph content.
|
|
538
541
|
*/
|
|
539
542
|
export declare interface Fill {
|
|
540
543
|
/**
|
|
@@ -622,7 +625,6 @@ export declare class GroupNode extends Node implements ContainerNode {
|
|
|
622
625
|
*/
|
|
623
626
|
set maskShape(mask: FillableNode | undefined);
|
|
624
627
|
/**
|
|
625
|
-
* @override
|
|
626
628
|
* Note: If this group has a maskShape, group's bounds are always identical to the maskShape's, regardless of the
|
|
627
629
|
* group's other content.
|
|
628
630
|
*/
|
|
@@ -754,6 +756,9 @@ export declare class LineNode extends StrokableNode {
|
|
|
754
756
|
get startArrowHeadType(): ArrowHeadType;
|
|
755
757
|
/**
|
|
756
758
|
* The setter sets a default stroke on the line if it did not have one.
|
|
759
|
+
*
|
|
760
|
+
* @throws if the line's stroke is not a SolidColorStroke type.
|
|
761
|
+
* More complex stroke types do not support arrowheads.
|
|
757
762
|
*/
|
|
758
763
|
set startArrowHeadType(type: ArrowHeadType);
|
|
759
764
|
/**
|
|
@@ -764,6 +769,9 @@ export declare class LineNode extends StrokableNode {
|
|
|
764
769
|
get endArrowHeadType(): ArrowHeadType;
|
|
765
770
|
/**
|
|
766
771
|
* The setter sets a default stroke on the line if it did not have one.
|
|
772
|
+
*
|
|
773
|
+
* @throws if the line's stroke is not a SolidColorStroke type.
|
|
774
|
+
* More complex stroke types do not support arrowheads.
|
|
767
775
|
*/
|
|
768
776
|
set endArrowHeadType(type: ArrowHeadType);
|
|
769
777
|
}
|
|
@@ -781,7 +789,7 @@ export declare interface ListItem {}
|
|
|
781
789
|
*/
|
|
782
790
|
export declare class MediaContainerNode extends Node {
|
|
783
791
|
/**
|
|
784
|
-
* The rectangular node representing the entire, uncropped bounds of the media (e.g. image or video). The media's position and
|
|
792
|
+
* The rectangular node representing the entire, uncropped bounds of the media (e.g. image, GIFs, or video). The media's position and
|
|
785
793
|
* rotation can be changed, but it cannot be resized yet via this API. Media types other than images will yield a plain Node object
|
|
786
794
|
* for now.
|
|
787
795
|
*/
|
|
@@ -792,6 +800,14 @@ export declare class MediaContainerNode extends Node {
|
|
|
792
800
|
* different shape via this API.
|
|
793
801
|
*/
|
|
794
802
|
get maskShape(): FillableNode;
|
|
803
|
+
/**
|
|
804
|
+
* Replace existing media inline. The new media is sized to completely fill the bounds of the existing maskShape; if the
|
|
805
|
+
* media's aspect ratio differs from the maskShape's, the media will be cropped by the maskShape on either the left/right
|
|
806
|
+
* or top/bottom edges. Currently only supports images as the new media, but previous media can be of any type.
|
|
807
|
+
*
|
|
808
|
+
* @param media - New content to display. Currently must be a {@link BitmapImage}.
|
|
809
|
+
*/
|
|
810
|
+
replaceMedia(media: BitmapImage): void;
|
|
795
811
|
}
|
|
796
812
|
|
|
797
813
|
/**
|
|
@@ -912,7 +928,7 @@ export declare class PageList extends RestrictedItemList<PageNode> {
|
|
|
912
928
|
* @param geometry - The size of the new page.
|
|
913
929
|
*
|
|
914
930
|
*/
|
|
915
|
-
addPage(
|
|
931
|
+
addPage(inputGeometry: RectangleGeometry): PageNode;
|
|
916
932
|
}
|
|
917
933
|
|
|
918
934
|
/**
|
|
@@ -1174,23 +1190,16 @@ export declare class SolidColorShapeNode extends Node {
|
|
|
1174
1190
|
}
|
|
1175
1191
|
|
|
1176
1192
|
/**
|
|
1177
|
-
*
|
|
1193
|
+
* Represents a solid-color stroke, with optional dashes.
|
|
1194
|
+
*
|
|
1195
|
+
* The most convenient way to create a solid-color stroke is via `Editor.makeStroke()`. This also futureproofs
|
|
1196
|
+
* your code in case any other required fields are added to the Stroke descriptor in the future.
|
|
1178
1197
|
*/
|
|
1179
|
-
export declare
|
|
1198
|
+
export declare interface SolidColorStroke extends Stroke {
|
|
1180
1199
|
/**
|
|
1181
|
-
* The stroke
|
|
1200
|
+
* The stroke type.
|
|
1182
1201
|
*/
|
|
1183
|
-
|
|
1184
|
-
get stroke(): Readonly<Stroke> | undefined;
|
|
1185
|
-
}
|
|
1186
|
-
|
|
1187
|
-
/**
|
|
1188
|
-
* Represents a stroke in the scenegraph. See {@link StrokableNode}.
|
|
1189
|
-
*
|
|
1190
|
-
* The most convenient way to create a stroke is via `Editor.makeStroke()`. This also futureproofs your code in case any
|
|
1191
|
-
* other required fields are added to the Stroke descriptor in the future.
|
|
1192
|
-
*/
|
|
1193
|
-
export declare interface Stroke {
|
|
1202
|
+
readonly type: StrokeType.color;
|
|
1194
1203
|
/**
|
|
1195
1204
|
* The color of a stroke.
|
|
1196
1205
|
*/
|
|
@@ -1216,6 +1225,34 @@ export declare interface Stroke {
|
|
|
1216
1225
|
position: StrokePosition;
|
|
1217
1226
|
}
|
|
1218
1227
|
|
|
1228
|
+
/**
|
|
1229
|
+
* SolidColorStroke with 'type' property as optional.
|
|
1230
|
+
*/
|
|
1231
|
+
export declare type SolidColorStrokeWithOptionalType = Omit<SolidColorStroke, "type"> &
|
|
1232
|
+
Partial<Pick<SolidColorStroke, "type">>;
|
|
1233
|
+
|
|
1234
|
+
/**
|
|
1235
|
+
* Base class for a Node that can have its own stroke.
|
|
1236
|
+
*/
|
|
1237
|
+
export declare class StrokableNode extends Node implements IStrokableNode {
|
|
1238
|
+
/**
|
|
1239
|
+
* The stroke applied to the shape, if any.
|
|
1240
|
+
* Only {@link SolidColorStroke} values are supported by the setter, but the "type" field is optional
|
|
1241
|
+
* for backward compatibility. Throws if another type is provided.
|
|
1242
|
+
*/
|
|
1243
|
+
set stroke(stroke: SolidColorStrokeWithOptionalType | undefined);
|
|
1244
|
+
get stroke(): Readonly<Stroke> | undefined;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* Base interface representing any stroke in the scenegraph. See {@link StrokableNode}.
|
|
1249
|
+
* Currently, you can only create {@link SolidColorStroke}s, but you might encounter
|
|
1250
|
+
* other stroke types when reading from scenegraph content.
|
|
1251
|
+
*/
|
|
1252
|
+
export declare interface Stroke {
|
|
1253
|
+
readonly type: StrokeType;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1219
1256
|
/**
|
|
1220
1257
|
* <InlineAlert slots="text" variant="warning"/>
|
|
1221
1258
|
* *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
|
|
@@ -1234,6 +1271,21 @@ declare enum StrokePosition {
|
|
|
1234
1271
|
*/
|
|
1235
1272
|
export declare class StrokeShapeNode extends StrokableNode {}
|
|
1236
1273
|
|
|
1274
|
+
/**
|
|
1275
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1276
|
+
* *Do not depend on the literal string values of these constants*, as they may change. Always reference the enum identifiers in your code.
|
|
1277
|
+
*
|
|
1278
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1279
|
+
* *Additional stroke types may be added in the future.* If your code has different branches or cases depending on stroke type,
|
|
1280
|
+
* always have a default/fallback case to handle any unknown values you may encounter.
|
|
1281
|
+
*/
|
|
1282
|
+
declare enum StrokeType {
|
|
1283
|
+
/**
|
|
1284
|
+
* A solid-color stroke, with optional dashes.
|
|
1285
|
+
*/
|
|
1286
|
+
color = "Color"
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1237
1289
|
/**
|
|
1238
1290
|
* <InlineAlert slots="text" variant="warning"/>
|
|
1239
1291
|
* *Do not depend on the literal numeric values of these constants*, as they may change. Always reference the enum identifiers in your code.
|
|
@@ -1249,9 +1301,12 @@ declare enum TextAlignment {
|
|
|
1249
1301
|
*/
|
|
1250
1302
|
export declare class TextNode extends Node {
|
|
1251
1303
|
/**
|
|
1252
|
-
* The text string of the node
|
|
1304
|
+
* The text string of the node.
|
|
1253
1305
|
*/
|
|
1254
1306
|
get text(): string;
|
|
1307
|
+
/**
|
|
1308
|
+
* Sets the text content of the text node.
|
|
1309
|
+
*/
|
|
1255
1310
|
set text(textContent: string);
|
|
1256
1311
|
/**
|
|
1257
1312
|
* The horizontal text alignment of the text node. Alignment is always the same across this node's entire text content.
|
package/ui/ui-sdk.d.ts
CHANGED
|
@@ -134,6 +134,10 @@ export declare enum AppEvent {
|
|
|
134
134
|
* triggered when the regional format is changed in the application.
|
|
135
135
|
*/
|
|
136
136
|
formatchange = "formatchange",
|
|
137
|
+
/**
|
|
138
|
+
* triggered when the sdk is reset.
|
|
139
|
+
*/
|
|
140
|
+
reset = "reset",
|
|
137
141
|
/**
|
|
138
142
|
* triggered when drag is started on the currently dragged element.
|
|
139
143
|
*/
|
|
@@ -162,6 +166,7 @@ declare interface AppEventsTypeMap {
|
|
|
162
166
|
[AppEvent.themechange]: AppThemeChangeEventData;
|
|
163
167
|
[AppEvent.localechange]: AppLocaleChangeEventData;
|
|
164
168
|
[AppEvent.formatchange]: AppFormatChangeEventData;
|
|
169
|
+
[AppEvent.reset]: undefined;
|
|
165
170
|
[AppEvent.dragstart]: AppDragStartEventData;
|
|
166
171
|
[AppEvent.dragend]: AppDragEndEventData;
|
|
167
172
|
|
|
@@ -253,6 +258,12 @@ declare interface ApplicationBase {
|
|
|
253
258
|
* @returns if the user is premium user or not
|
|
254
259
|
*/
|
|
255
260
|
startPremiumUpgradeIfFreeUser(): Promise<boolean>;
|
|
261
|
+
/**
|
|
262
|
+
* @experimental - Experimental API
|
|
263
|
+
* Get information regarding current platform.
|
|
264
|
+
* @returns the details regarding the current platform.
|
|
265
|
+
*/
|
|
266
|
+
getCurrentPlatform(): Promise<CurrentPlatformPayload>;
|
|
256
267
|
}
|
|
257
268
|
|
|
258
269
|
/**
|
|
@@ -499,11 +510,37 @@ declare namespace Constants {
|
|
|
499
510
|
MediaTabs,
|
|
500
511
|
ElementsTabs,
|
|
501
512
|
PanelActionType,
|
|
513
|
+
PlatformEnvironment,
|
|
514
|
+
DeviceClass,
|
|
515
|
+
PlatformType,
|
|
502
516
|
AuthorizationStatus
|
|
503
517
|
};
|
|
504
518
|
}
|
|
505
519
|
export { Constants };
|
|
506
520
|
|
|
521
|
+
/**
|
|
522
|
+
* @experimental - Experimental API
|
|
523
|
+
* Interface for the current platform
|
|
524
|
+
*/
|
|
525
|
+
export declare interface CurrentPlatformPayload {
|
|
526
|
+
/**
|
|
527
|
+
* Purchases are NOT allowed in the {@link PlatformEnvironment.app} as of now
|
|
528
|
+
*/
|
|
529
|
+
inAppPurchaseAllowed: boolean;
|
|
530
|
+
/**
|
|
531
|
+
* Denotes the platform type
|
|
532
|
+
*/
|
|
533
|
+
platform: PlatformType;
|
|
534
|
+
/**
|
|
535
|
+
* Denotes the current environment
|
|
536
|
+
*/
|
|
537
|
+
environment: PlatformEnvironment;
|
|
538
|
+
/**
|
|
539
|
+
* Denotes the device class
|
|
540
|
+
*/
|
|
541
|
+
deviceClass: DeviceClass;
|
|
542
|
+
}
|
|
543
|
+
|
|
507
544
|
/**
|
|
508
545
|
* Represents the current logged-in user accessing the host application
|
|
509
546
|
*/
|
|
@@ -561,6 +598,25 @@ export declare interface DevFlags {
|
|
|
561
598
|
simulateFreeUser: boolean;
|
|
562
599
|
}
|
|
563
600
|
|
|
601
|
+
/**
|
|
602
|
+
* @experimental - Experimental API
|
|
603
|
+
* Denotes the device class
|
|
604
|
+
*/
|
|
605
|
+
export declare enum DeviceClass {
|
|
606
|
+
/**
|
|
607
|
+
* Mobile Device
|
|
608
|
+
*/
|
|
609
|
+
mobile = "mobile",
|
|
610
|
+
/**
|
|
611
|
+
* Tablet Device
|
|
612
|
+
*/
|
|
613
|
+
tablet = "tablet",
|
|
614
|
+
/**
|
|
615
|
+
* Desktop
|
|
616
|
+
*/
|
|
617
|
+
desktop = "desktop"
|
|
618
|
+
}
|
|
619
|
+
|
|
564
620
|
/**
|
|
565
621
|
* Represents the Modal Dialog that the add-on has presented to the user.
|
|
566
622
|
*/
|
|
@@ -1174,6 +1230,68 @@ export declare interface PdfRenditionOptions extends RenditionOptions {
|
|
|
1174
1230
|
pageBoxes?: PdfPageBoxes;
|
|
1175
1231
|
}
|
|
1176
1232
|
|
|
1233
|
+
/**
|
|
1234
|
+
* @experimental - Experimental API
|
|
1235
|
+
* Denotes the enum for current environment
|
|
1236
|
+
*/
|
|
1237
|
+
export declare enum PlatformEnvironment {
|
|
1238
|
+
/**
|
|
1239
|
+
* App Environment
|
|
1240
|
+
*/
|
|
1241
|
+
app = "app",
|
|
1242
|
+
/**
|
|
1243
|
+
* Web Environment
|
|
1244
|
+
*/
|
|
1245
|
+
web = "web"
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* @experimental - Experimental API
|
|
1250
|
+
* Denotes the type of platform
|
|
1251
|
+
*/
|
|
1252
|
+
export declare enum PlatformType {
|
|
1253
|
+
/**
|
|
1254
|
+
* iOS
|
|
1255
|
+
*/
|
|
1256
|
+
iOS = "ios",
|
|
1257
|
+
/**
|
|
1258
|
+
* iPad
|
|
1259
|
+
*/
|
|
1260
|
+
iPadOS = "ipad",
|
|
1261
|
+
/**
|
|
1262
|
+
* Chrome OS
|
|
1263
|
+
*/
|
|
1264
|
+
chromeOS = "chromeOS",
|
|
1265
|
+
/**
|
|
1266
|
+
* Android
|
|
1267
|
+
*/
|
|
1268
|
+
android = "android",
|
|
1269
|
+
/**
|
|
1270
|
+
* Chrome Browser
|
|
1271
|
+
*/
|
|
1272
|
+
chromeBrowser = "chromeBrowser",
|
|
1273
|
+
/**
|
|
1274
|
+
* Firefox Browser
|
|
1275
|
+
*/
|
|
1276
|
+
fireforxBrowser = "firefoxBrowser",
|
|
1277
|
+
/**
|
|
1278
|
+
* Edge Browser
|
|
1279
|
+
*/
|
|
1280
|
+
edgeBrowser = "edgeBrowser",
|
|
1281
|
+
/**
|
|
1282
|
+
* Samsung Browser
|
|
1283
|
+
*/
|
|
1284
|
+
samsungBrowser = "samsumgBrowser",
|
|
1285
|
+
/**
|
|
1286
|
+
* Safari Browser
|
|
1287
|
+
*/
|
|
1288
|
+
safariBrowser = "safariBrowser",
|
|
1289
|
+
/**
|
|
1290
|
+
* Unknown Platform
|
|
1291
|
+
*/
|
|
1292
|
+
unknown = "unknown"
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1177
1295
|
export declare interface PngRenditionOptions extends RenditionOptions {
|
|
1178
1296
|
/**
|
|
1179
1297
|
* PNG rendition format
|
package/tsconfig.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"allowSyntheticDefaultImports": true,
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"declarationMap": true,
|
|
6
|
-
"emitDecoratorMetadata": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"experimentalDecorators": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"importHelpers": true,
|
|
11
|
-
"incremental": true,
|
|
12
|
-
"isolatedModules": true,
|
|
13
|
-
"module": "ESNext",
|
|
14
|
-
"moduleResolution": "node",
|
|
15
|
-
"noImplicitOverride": false,
|
|
16
|
-
"noUnusedLocals": true,
|
|
17
|
-
"outDir": "dist",
|
|
18
|
-
"preserveConstEnums": true,
|
|
19
|
-
"sourceMap": true,
|
|
20
|
-
"strict": true,
|
|
21
|
-
"target": "ESNext",
|
|
22
|
-
"useUnknownInCatchVariables": false
|
|
23
|
-
},
|
|
24
|
-
"exclude": ["node_modules"],
|
|
25
|
-
"ts-node": {
|
|
26
|
-
"files": true
|
|
27
|
-
}
|
|
28
|
-
}
|