@adobe/ccweb-add-on-sdk-types 1.27.0 → 1.28.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 +1 -1
- package/sandbox/express-document-sdk.d.ts +135 -59
- package/ui/ui-sdk.d.ts +4 -2
package/package.json
CHANGED
|
@@ -84,6 +84,7 @@ declare namespace ApiConstants {
|
|
|
84
84
|
TextLayout,
|
|
85
85
|
TextScriptStyle,
|
|
86
86
|
EditorEvent,
|
|
87
|
+
ResizeBehavior,
|
|
87
88
|
VisualEffectType,
|
|
88
89
|
TextStyleSource,
|
|
89
90
|
ParagraphListType,
|
|
@@ -553,6 +554,22 @@ export declare class ColorUtils {
|
|
|
553
554
|
|
|
554
555
|
export declare const colorUtils: ExpressColorUtilsWrapper;
|
|
555
556
|
|
|
557
|
+
/**
|
|
558
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
559
|
+
*
|
|
560
|
+
* **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`.
|
|
561
|
+
*
|
|
562
|
+
* @experimental
|
|
563
|
+
* An interface for arbitrary resize operations regardless of whether given a width or height when using {@link Node.resize}.
|
|
564
|
+
*/
|
|
565
|
+
declare interface CommonResizeOptions {
|
|
566
|
+
/**
|
|
567
|
+
* Whether to try to avoid scaling the content's visual styling (e.g. stroke width, corner detailing, etc.).
|
|
568
|
+
* Note that some kinds of content may not be able to avoid rescaling in some scenarios.
|
|
569
|
+
*/
|
|
570
|
+
avoidScalingVisualDetailsIfPossible: boolean;
|
|
571
|
+
}
|
|
572
|
+
|
|
556
573
|
/**
|
|
557
574
|
* A ComplexShapeNode is a complex prepackaged shape that appears as a leaf node in the UI, even if it is composed
|
|
558
575
|
* of multiple separate paths.
|
|
@@ -849,13 +866,7 @@ export declare class ExpressContext extends Context {
|
|
|
849
866
|
* Entry point for Express specific APIs that read or modify the document's content.
|
|
850
867
|
*/
|
|
851
868
|
export declare class ExpressEditor extends Editor {
|
|
852
|
-
/**
|
|
853
|
-
* User's current selection context
|
|
854
|
-
*/
|
|
855
869
|
get context(): ExpressContext;
|
|
856
|
-
/**
|
|
857
|
-
* @returns the root of the document.
|
|
858
|
-
*/
|
|
859
870
|
get documentRoot(): ExpressRootNode;
|
|
860
871
|
}
|
|
861
872
|
|
|
@@ -980,6 +991,17 @@ export declare const fonts: ExpressFontsWrapper;
|
|
|
980
991
|
* media rectangle child when those actions are applied.
|
|
981
992
|
*/
|
|
982
993
|
export declare class GridCellNode extends Node implements IMediaContainerNode {
|
|
994
|
+
/**
|
|
995
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
996
|
+
*
|
|
997
|
+
* **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`.
|
|
998
|
+
*
|
|
999
|
+
* @experimental
|
|
1000
|
+
* Proxy resizing of the MediaRectangleNode *inside* this grid cell. The enclosing grid layout keeps
|
|
1001
|
+
* the crop window (and thus the overall GridCellNode/MediaContainerNode bounds) fixed in position.
|
|
1002
|
+
* *Warning:* This will not change the bounds reported by this GridCellNode itself.
|
|
1003
|
+
*/
|
|
1004
|
+
resize(options: ResizeOptions): void;
|
|
983
1005
|
/**
|
|
984
1006
|
* Always throws as it's not possible to clone a single grid slot.
|
|
985
1007
|
* Use the parent grid container instead.
|
|
@@ -1449,60 +1471,9 @@ declare class Node extends VisualNode implements INodeBounds {
|
|
|
1449
1471
|
* **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`.
|
|
1450
1472
|
*
|
|
1451
1473
|
* @experimental
|
|
1452
|
-
*
|
|
1453
|
-
* preserve its existing aspect ratio, keeping its top-left corner ({@link topLeftLocal}) at a fixed location.
|
|
1454
|
-
*
|
|
1455
|
-
* Scaling changes the size of visual styling elements such as stroke width, corner detailing, and font size.
|
|
1456
|
-
* Contrast this to *resizing* operations (such as {@link resizeToFitWithin}), which adjust the bounding box of an
|
|
1457
|
-
* element while trying to preserve the existing size of visual detailing such as strokes, corners, and fonts.
|
|
1458
|
-
*
|
|
1459
|
-
* Rescaling becomes baked into the updated values of fields such as stroke weight, rectangle width, etc. (it is not
|
|
1460
|
-
* a separate, persistent scale factor multiplier).
|
|
1474
|
+
* Resizes this node based on the given {@link ResizeOptions}.
|
|
1461
1475
|
*/
|
|
1462
|
-
|
|
1463
|
-
/**
|
|
1464
|
-
* <InlineAlert slots="text" variant="warning"/>
|
|
1465
|
-
*
|
|
1466
|
-
* **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`.
|
|
1467
|
-
*
|
|
1468
|
-
* @experimental
|
|
1469
|
-
* Changes the height to the given value by visually *scaling* the entire content larger or smaller on both axes to
|
|
1470
|
-
* preserve its existing aspect ratio. See {@link rescaleProportionalToWidth} documentation for additional explanation.
|
|
1471
|
-
*/
|
|
1472
|
-
rescaleProportionalToHeight(height: number): void;
|
|
1473
|
-
/**
|
|
1474
|
-
* <InlineAlert slots="text" variant="warning"/>
|
|
1475
|
-
*
|
|
1476
|
-
* **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`.
|
|
1477
|
-
*
|
|
1478
|
-
* @experimental
|
|
1479
|
-
* Resizes the node to fit entirely *within* a box of the given dimensions, keeping its top-left corner ({@link topLeftLocal})
|
|
1480
|
-
* at a fixed location. Nodes with a fixed aspect ratio may leave unused space on one axis as a result, but nodes
|
|
1481
|
-
* with flexible aspect ratio will be resized to the exact box size specified.
|
|
1482
|
-
*
|
|
1483
|
-
* Resizing attempts to preserve the existing size of visual styling elements such as stroke width, corner detailing,
|
|
1484
|
-
* and font size as much as possible. Contrast with *rescaling* (such as {@link rescaleProportionalToWidth}), which
|
|
1485
|
-
* always changes the size of visual detailing in exact proportion to the change in overall bounding box size. This
|
|
1486
|
-
* API may still produce *some* degree of rescaling if necessary for certain shapes with fixed corner/edge detailing
|
|
1487
|
-
* to fit the box better.
|
|
1488
|
-
*
|
|
1489
|
-
* @see resizeToCover
|
|
1490
|
-
*/
|
|
1491
|
-
resizeToFitWithin(width: number, height: number): void;
|
|
1492
|
-
/**
|
|
1493
|
-
* <InlineAlert slots="text" variant="warning"/>
|
|
1494
|
-
*
|
|
1495
|
-
* **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`.
|
|
1496
|
-
*
|
|
1497
|
-
* @experimental
|
|
1498
|
-
* Resizes the node to completely *cover* a box of the given dimensions, keeping its top-left corner ({@link topLeftLocal})
|
|
1499
|
-
* at a fixed location. Nodes with a fixed aspect ratio may extend outside the box on one axis as a result, but
|
|
1500
|
-
* nodes with flexible aspect ratio will be resized to the exact box size specified. See {@link resizeToFitWithin}
|
|
1501
|
-
* documentation for additional explanation.
|
|
1502
|
-
*
|
|
1503
|
-
* @see resizeToFitWithin
|
|
1504
|
-
*/
|
|
1505
|
-
resizeToCover(width: number, height: number): void;
|
|
1476
|
+
resize(options: ResizeOptions): void;
|
|
1506
1477
|
/**
|
|
1507
1478
|
* Creates a copy of this node and its entire subtree of descendants.
|
|
1508
1479
|
*
|
|
@@ -1845,6 +1816,111 @@ declare interface RemoveListStyleInput extends BaseParagraphListStyle {
|
|
|
1845
1816
|
type: ParagraphListType.none;
|
|
1846
1817
|
}
|
|
1847
1818
|
|
|
1819
|
+
/**
|
|
1820
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1821
|
+
*
|
|
1822
|
+
* **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`.
|
|
1823
|
+
*
|
|
1824
|
+
* @experimental
|
|
1825
|
+
* An interface for rescaling the node based on a given height when using {@link Node.resize}.
|
|
1826
|
+
*/
|
|
1827
|
+
declare interface RescaleProportionalToHeightOptions extends CommonResizeOptions {
|
|
1828
|
+
behavior: ResizeBehavior.proportional;
|
|
1829
|
+
height: number;
|
|
1830
|
+
/** Instead of providing a width, it will be calculated by multiplying the given height by the current aspect ratio. */
|
|
1831
|
+
width?: never;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
/**
|
|
1835
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1836
|
+
*
|
|
1837
|
+
* **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`.
|
|
1838
|
+
*
|
|
1839
|
+
* @experimental
|
|
1840
|
+
* An interface for rescaling the node based on a given width when using {@link Node.resize}.
|
|
1841
|
+
*/
|
|
1842
|
+
declare interface RescaleProportionalToWidthOptions extends CommonResizeOptions {
|
|
1843
|
+
behavior: ResizeBehavior.proportional;
|
|
1844
|
+
width: number;
|
|
1845
|
+
/** Instead of providing a height, it will be calculated by multiplying the given width by the current aspect ratio. */
|
|
1846
|
+
height?: never;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
/**
|
|
1850
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1851
|
+
*
|
|
1852
|
+
* **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`.
|
|
1853
|
+
*
|
|
1854
|
+
* @experimental
|
|
1855
|
+
* An enum for controlling the behavior of {@link Node.resize}.
|
|
1856
|
+
*/
|
|
1857
|
+
export declare enum ResizeBehavior {
|
|
1858
|
+
/**
|
|
1859
|
+
* Resizes the node to fit entirely *within* a box of the given dimensions, keeping its {@link topLeftLocal}
|
|
1860
|
+
* at a fixed location. Nodes with a fixed aspect ratio may leave unused space on one axis as a result,
|
|
1861
|
+
* but nodes with flexible aspect ratio will be resized to the exact box size specified.
|
|
1862
|
+
*/
|
|
1863
|
+
contain = "contain",
|
|
1864
|
+
/**
|
|
1865
|
+
* Resizes the node to completely *cover* a box of the given dimensions, keeping its {@link topLeftLocal}
|
|
1866
|
+
* at a fixed location. Nodes with a fixed aspect ratio may extend outside the box on one axis as a result,
|
|
1867
|
+
* but nodes with flexible aspect ratio will be resized to the exact box size specified.
|
|
1868
|
+
*/
|
|
1869
|
+
cover = "cover",
|
|
1870
|
+
/**
|
|
1871
|
+
* Resizes the node to the given width or height while preserving its current aspect ratio, keeping its
|
|
1872
|
+
* {@link topLeftLocal} at a fixed location.
|
|
1873
|
+
*/
|
|
1874
|
+
proportional = "proportional"
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
/**
|
|
1878
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1879
|
+
*
|
|
1880
|
+
* **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`.
|
|
1881
|
+
*
|
|
1882
|
+
* @experimental
|
|
1883
|
+
* A type union for providing the necessary arguments to {@link Node.resize}.
|
|
1884
|
+
*
|
|
1885
|
+
* Note that some nodes only support proportional resizing. In some cases this is always true (e.g. images) while in
|
|
1886
|
+
* other cases it is due to the current visual details (e.g. the stroke being too thick to shrink the size of a shape).
|
|
1887
|
+
*/
|
|
1888
|
+
export declare type ResizeOptions =
|
|
1889
|
+
| RescaleProportionalToWidthOptions
|
|
1890
|
+
| RescaleProportionalToHeightOptions
|
|
1891
|
+
| ResizeUsingWidthOptions
|
|
1892
|
+
| ResizeUsingHeightOptions;
|
|
1893
|
+
|
|
1894
|
+
/**
|
|
1895
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1896
|
+
*
|
|
1897
|
+
* **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`.
|
|
1898
|
+
*
|
|
1899
|
+
* @experimental
|
|
1900
|
+
* An interface for resizing the node based on a given height when using {@link Node.resize}.
|
|
1901
|
+
*/
|
|
1902
|
+
declare interface ResizeUsingHeightOptions extends CommonResizeOptions {
|
|
1903
|
+
behavior: ResizeBehavior.contain | ResizeBehavior.cover;
|
|
1904
|
+
height: number;
|
|
1905
|
+
/** If a width is not provided, it will be calculated by multiplying the given height by the current aspect ratio. */
|
|
1906
|
+
width?: number;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
/**
|
|
1910
|
+
* <InlineAlert slots="text" variant="warning"/>
|
|
1911
|
+
*
|
|
1912
|
+
* **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`.
|
|
1913
|
+
*
|
|
1914
|
+
* @experimental
|
|
1915
|
+
* An interface for resizing the node based on a given width when using {@link Node.resize}.
|
|
1916
|
+
*/
|
|
1917
|
+
declare interface ResizeUsingWidthOptions extends CommonResizeOptions {
|
|
1918
|
+
behavior: ResizeBehavior.contain | ResizeBehavior.cover;
|
|
1919
|
+
width: number;
|
|
1920
|
+
/** If a height is not provided, it will be calculated by multiplying the given width by the current aspect ratio. */
|
|
1921
|
+
height?: number;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1848
1924
|
/**
|
|
1849
1925
|
* Base for ItemLists that restrict how items are added to the list, but freely allow items to be removed and
|
|
1850
1926
|
* reordered. The {@link ItemList} subclass adds more capabilities, however.
|
package/ui/ui-sdk.d.ts
CHANGED
|
@@ -1315,7 +1315,8 @@ export declare interface JpgRenditionOptions extends RenditionOptions {
|
|
|
1315
1315
|
*/
|
|
1316
1316
|
quality?: number;
|
|
1317
1317
|
/**
|
|
1318
|
-
*
|
|
1318
|
+
* The desired dimensions for the image rendition.
|
|
1319
|
+
* NOTE: Only downscaling is supported on mobile and chrome OS devices.
|
|
1319
1320
|
*/
|
|
1320
1321
|
requestedSize?: {
|
|
1321
1322
|
width?: number;
|
|
@@ -1750,7 +1751,8 @@ export declare interface PngRenditionOptions extends RenditionOptions {
|
|
|
1750
1751
|
*/
|
|
1751
1752
|
backgroundColor?: number;
|
|
1752
1753
|
/**
|
|
1753
|
-
*
|
|
1754
|
+
* The desired dimensions for the image rendition.
|
|
1755
|
+
* NOTE: Only downscaling is supported on mobile and chrome OS devices.
|
|
1754
1756
|
*/
|
|
1755
1757
|
requestedSize?: {
|
|
1756
1758
|
width?: number;
|