@bubblydoo/photoshop-mcp 0.0.2
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 +138 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7049 -0
- package/dist/index.js.map +1 -0
- package/dist-readmes/README.md +383 -0
- package/dist-runtime/runtime-code.cjs +17124 -0
- package/dist-runtime/runtime-code.d.cts +9 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/index.d.ts +16 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/all-types.d.ts +65 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Actions.d.ts +230 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Channel.d.ts +120 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/ColorSampler.d.ts +105 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Constants.d.ts +1648 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/CoreModules.d.ts +922 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/CountItem.d.ts +86 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Document.d.ts +931 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Guide.d.ts +105 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/HistoryState.d.ts +74 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/ImagingModule.d.ts +559 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Layer.d.ts +1073 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/LayerComp.d.ts +219 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Objects.d.ts +7 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/PathItem.d.ts +243 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/PathPoint.d.ts +78 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Photoshop.d.ts +317 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Selection.d.ts +557 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/SubPathItem.d.ts +69 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/TextItem.d.ts +213 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Channels.d.ts +81 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/ColorSamplers.d.ts +97 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/CountItems.d.ts +130 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Documents.d.ts +95 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Guides.d.ts +76 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/HistoryStates.d.ts +56 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/LayerComps.d.ts +92 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Layers.d.ts +68 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/PathItems.d.ts +65 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/PathPoints.d.ts +50 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/SubPathItems.d.ts +50 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/TextFonts.d.ts +43 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/Colors.d.ts +225 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ConversionOptions.d.ts +213 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ImagingBounds.d.ts +53 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/PathPointInfo.d.ts +84 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SaveOptions.d.ts +376 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SolidColor.d.ts +118 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SubPathInfo.d.ts +47 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/TextFont.d.ts +49 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/Tool.d.ts +23 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/Preferences.d.ts +121 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesBase.d.ts +9 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesCursors.d.ts +37 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesFileHandling.d.ts +58 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesGeneral.d.ts +77 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesGuidesGridsAndSlices.d.ts +51 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesHistory.d.ts +69 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesInterface.d.ts +46 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesPerformance.d.ts +42 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesTools.d.ts +44 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesTransparencyAndGamut.d.ts +38 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesType.d.ts +44 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesUnitsAndRulers.d.ts +44 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/CharacterStyle.d.ts +254 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/ParagraphStyle.d.ts +114 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/TextWarpStyle.d.ts +48 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/ApplyImageTypes.d.ts +107 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/CalculationsTypes.d.ts +119 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/DocumentTypes.d.ts +80 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/LayerCompTypes.d.ts +91 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/LayerTypes.d.ts +153 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/SharedTypes.d.ts +6 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/TextTypes.d.ts +218 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/util/colorTypes.d.ts +61 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/util/unit.d.ts +45 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/index.d.ts +21 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/all-types.d.ts +3 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/dialog.d.ts +26 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/entrypoints.d.ts +385 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/host.d.ts +28 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/os.d.ts +56 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/other.d.ts +7 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/shell.d.ts +54 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/storage.d.ts +1216 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/versions.d.ts +18 -0
- package/dist-schemas/@bubblydoo/uxp-toolkit/dist/commands-library/index.d.ts +109 -0
- package/dist-schemas/@bubblydoo/uxp-toolkit/dist/index.d.ts +153 -0
- package/dist-schemas/@bubblydoo/uxp-toolkit/dist/psLayerRef-BJKcxKbm.d.ts +66 -0
- package/package.json +51 -0
|
@@ -0,0 +1,1073 @@
|
|
|
1
|
+
import type * as Unit from '../util/unit';
|
|
2
|
+
import type { Layers } from './collections/Layers';
|
|
3
|
+
import type * as Constants from './Constants';
|
|
4
|
+
import type { Document } from './Document';
|
|
5
|
+
import type { ImagingBounds } from './objects/ImagingBounds';
|
|
6
|
+
import type { TextItem } from './TextItem';
|
|
7
|
+
import type { ApplyImageOptions } from './types/ApplyImageTypes';
|
|
8
|
+
/** @ignore */
|
|
9
|
+
export enum PSLayerKind {
|
|
10
|
+
any = 0,
|
|
11
|
+
pixel = 1,
|
|
12
|
+
adjustment = 2,
|
|
13
|
+
text = 3,
|
|
14
|
+
vector = 4,
|
|
15
|
+
smartObject = 5,
|
|
16
|
+
video = 6,
|
|
17
|
+
group = 7,
|
|
18
|
+
threeD = 8,
|
|
19
|
+
gradient = 9,
|
|
20
|
+
pattern = 10,
|
|
21
|
+
solidColor = 11,
|
|
22
|
+
background = 12,
|
|
23
|
+
groupEnd = 13,
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* An object within a document that contains visual elements of the image, equivalent to a layer in Photoshop.
|
|
27
|
+
*
|
|
28
|
+
* You can access layers in a document using Document.layers collection.
|
|
29
|
+
*
|
|
30
|
+
* If the object is representing a group layer, you can access it's children layers using Layer.layers property.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/}
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```js
|
|
36
|
+
* group.layers.forEach((layer) => {
|
|
37
|
+
* layer.visible = true;
|
|
38
|
+
* })
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export class Layer {
|
|
42
|
+
/**
|
|
43
|
+
* @ignore
|
|
44
|
+
*/
|
|
45
|
+
private setLocking;
|
|
46
|
+
/**
|
|
47
|
+
* The class name of the referenced object: *"Layer"*.
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#typename}
|
|
50
|
+
* @minVersion 23.0
|
|
51
|
+
*/
|
|
52
|
+
get typename(): 'Layer';
|
|
53
|
+
/**
|
|
54
|
+
* True if any property of this layer is locked.
|
|
55
|
+
*
|
|
56
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#locked}
|
|
57
|
+
* @minVersion 22.5
|
|
58
|
+
*/
|
|
59
|
+
get locked(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* When set to true, prevents edits to pixels and properties of this layer.
|
|
62
|
+
*
|
|
63
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#alllocked}
|
|
64
|
+
* @minVersion 22.5
|
|
65
|
+
*/
|
|
66
|
+
get allLocked(): boolean;
|
|
67
|
+
set allLocked(locking: boolean);
|
|
68
|
+
/**
|
|
69
|
+
* When set to true, prevents the pixels of this layer from being edited.
|
|
70
|
+
*
|
|
71
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#pixelslocked}
|
|
72
|
+
* @minVersion 22.5
|
|
73
|
+
*/
|
|
74
|
+
get pixelsLocked(): boolean;
|
|
75
|
+
set pixelsLocked(locking: boolean);
|
|
76
|
+
/**
|
|
77
|
+
* When set to true, prevents the layer from being moved.
|
|
78
|
+
*
|
|
79
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#positionlocked}
|
|
80
|
+
* @minVersion 22.5
|
|
81
|
+
*/
|
|
82
|
+
get positionLocked(): boolean;
|
|
83
|
+
set positionLocked(locking: boolean);
|
|
84
|
+
/**
|
|
85
|
+
* When set to true, prevents the transparent pixels from being edited.
|
|
86
|
+
*
|
|
87
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#transparentpixelslocked}
|
|
88
|
+
* @minVersion 22.5
|
|
89
|
+
*/
|
|
90
|
+
get transparentPixelsLocked(): boolean;
|
|
91
|
+
set transparentPixelsLocked(locking: boolean);
|
|
92
|
+
/**
|
|
93
|
+
* True when the layer is the special Background layer.
|
|
94
|
+
*
|
|
95
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#isbackgroundlayer}
|
|
96
|
+
* @minVersion 22.5
|
|
97
|
+
*/
|
|
98
|
+
get isBackgroundLayer(): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* True when the layer is visible.
|
|
101
|
+
*
|
|
102
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#visible}
|
|
103
|
+
* @minVersion 22.5
|
|
104
|
+
*/
|
|
105
|
+
get visible(): boolean;
|
|
106
|
+
set visible(visible: boolean);
|
|
107
|
+
/**
|
|
108
|
+
* The kind of the layer.
|
|
109
|
+
*
|
|
110
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#kind}
|
|
111
|
+
* @minVersion 22.5
|
|
112
|
+
*/
|
|
113
|
+
get kind(): Constants.LayerKind;
|
|
114
|
+
/**
|
|
115
|
+
* Bounds of the layer, including the effects.
|
|
116
|
+
*
|
|
117
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#bounds}
|
|
118
|
+
* @minVersion 22.5
|
|
119
|
+
*/
|
|
120
|
+
get bounds(): ImagingBounds;
|
|
121
|
+
/**
|
|
122
|
+
* Bounds of the layer excluding effects.
|
|
123
|
+
*
|
|
124
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#boundsnoeffects}
|
|
125
|
+
* @minVersion 22.5
|
|
126
|
+
*/
|
|
127
|
+
get boundsNoEffects(): ImagingBounds;
|
|
128
|
+
/**
|
|
129
|
+
* The master opacity of the layer, in percent.
|
|
130
|
+
*
|
|
131
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#opacity}
|
|
132
|
+
* @minVersion 22.5
|
|
133
|
+
*/
|
|
134
|
+
get opacity(): number;
|
|
135
|
+
set opacity(opacity: number);
|
|
136
|
+
/**
|
|
137
|
+
* The fill opacity of the layer, in percentage.
|
|
138
|
+
*
|
|
139
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#fillopacity}
|
|
140
|
+
* @minVersion 23.0
|
|
141
|
+
*/
|
|
142
|
+
get fillOpacity(): number;
|
|
143
|
+
set fillOpacity(opacity: number);
|
|
144
|
+
/**
|
|
145
|
+
* The density of the filter mask, in percentage.
|
|
146
|
+
*
|
|
147
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#filtermaskdensity}
|
|
148
|
+
* @minVersion 23.0
|
|
149
|
+
*/
|
|
150
|
+
get filterMaskDensity(): number;
|
|
151
|
+
set filterMaskDensity(density: number);
|
|
152
|
+
/**
|
|
153
|
+
* The feather of the filter mask between 0.0 and 1000.0.
|
|
154
|
+
*
|
|
155
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#filtermaskfeather}
|
|
156
|
+
* @minVersion 23.0
|
|
157
|
+
*/
|
|
158
|
+
get filterMaskFeather(): number;
|
|
159
|
+
set filterMaskFeather(feather: number);
|
|
160
|
+
/**
|
|
161
|
+
* The density of the layer mask, in percentage.
|
|
162
|
+
*
|
|
163
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#layermaskdensity}
|
|
164
|
+
* @minVersion 23.0
|
|
165
|
+
*/
|
|
166
|
+
get layerMaskDensity(): number;
|
|
167
|
+
set layerMaskDensity(density: number);
|
|
168
|
+
/**
|
|
169
|
+
* The feather of the layer mask between 0.0 and 1000.0.
|
|
170
|
+
*
|
|
171
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#layermaskfeather}
|
|
172
|
+
* @minVersion 23.0
|
|
173
|
+
*/
|
|
174
|
+
get layerMaskFeather(): number;
|
|
175
|
+
set layerMaskFeather(feather: number);
|
|
176
|
+
/**
|
|
177
|
+
* The density of the vector mask, in percentage.
|
|
178
|
+
*
|
|
179
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#vectormaskdensity}
|
|
180
|
+
* @minVersion 23.0
|
|
181
|
+
*/
|
|
182
|
+
get vectorMaskDensity(): number;
|
|
183
|
+
set vectorMaskDensity(density: number);
|
|
184
|
+
/**
|
|
185
|
+
* The feather of the vector mask between 0.0 and 1000.0.
|
|
186
|
+
*
|
|
187
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#vectormaskfeather}
|
|
188
|
+
* @minVersion 23.0
|
|
189
|
+
*/
|
|
190
|
+
get vectorMaskFeather(): number;
|
|
191
|
+
set vectorMaskFeather(feather: number);
|
|
192
|
+
/**
|
|
193
|
+
* Whether the layer is being used as a clipping mask. Releasing a clipping mask will also release the layers above.
|
|
194
|
+
*
|
|
195
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#isclippingmask}
|
|
196
|
+
* @minVersion 23.0
|
|
197
|
+
*/
|
|
198
|
+
get isClippingMask(): boolean;
|
|
199
|
+
set isClippingMask(clipped: boolean);
|
|
200
|
+
/**
|
|
201
|
+
* The blend mode of the layer.
|
|
202
|
+
*
|
|
203
|
+
* ***Fixes in Photoshop 24.2:***
|
|
204
|
+
* - *Now it will throw error when passing non-existent blend mode*
|
|
205
|
+
* - *Also will throw error if combination of document color mode, bit depth and blend mode is not possible
|
|
206
|
+
* instead of failing silently*
|
|
207
|
+
* - *Prior this version it was possible to set blend mode for background layer which turned it into regular
|
|
208
|
+
* layer as a side effect and also changed its ID. Not it will throw error instead since these side effects
|
|
209
|
+
* are not expected to happen*
|
|
210
|
+
*
|
|
211
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#blendmode}
|
|
212
|
+
* @minVersion 22.5
|
|
213
|
+
*/
|
|
214
|
+
get blendMode(): Constants.BlendMode;
|
|
215
|
+
set blendMode(blendMode: Constants.BlendMode);
|
|
216
|
+
/**
|
|
217
|
+
* Layers linked to this layer. See Layer.link
|
|
218
|
+
*
|
|
219
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#linkedlayers}
|
|
220
|
+
* @minVersion 22.5
|
|
221
|
+
*/
|
|
222
|
+
get linkedLayers(): Layers;
|
|
223
|
+
/**
|
|
224
|
+
* Name of the layer.
|
|
225
|
+
*
|
|
226
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#name}
|
|
227
|
+
* @minVersion 22.5
|
|
228
|
+
*/
|
|
229
|
+
get name(): string;
|
|
230
|
+
/**
|
|
231
|
+
* @ignore
|
|
232
|
+
* Set the name of the layer
|
|
233
|
+
*/
|
|
234
|
+
set name(name: string);
|
|
235
|
+
/**
|
|
236
|
+
* ID of the layer, can be used for making batchPlay calls.
|
|
237
|
+
*
|
|
238
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#id}
|
|
239
|
+
* @minVersion 22.5
|
|
240
|
+
*/
|
|
241
|
+
get id(): number;
|
|
242
|
+
/**
|
|
243
|
+
* The document that contains this layer.
|
|
244
|
+
*
|
|
245
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#document}
|
|
246
|
+
* @minVersion 23.0
|
|
247
|
+
*/
|
|
248
|
+
get document(): Document;
|
|
249
|
+
/**
|
|
250
|
+
* The group layer that contains this layer.
|
|
251
|
+
* It will return null if the layer is a top layer in the document.
|
|
252
|
+
*
|
|
253
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#parent}
|
|
254
|
+
* @minVersion 22.5
|
|
255
|
+
*/
|
|
256
|
+
get parent(): Layer | null;
|
|
257
|
+
/**
|
|
258
|
+
* @ignore
|
|
259
|
+
* The selection status of the layer.
|
|
260
|
+
* @minVersion 22.5
|
|
261
|
+
*/
|
|
262
|
+
get selected(): boolean;
|
|
263
|
+
set selected(select: boolean);
|
|
264
|
+
/**
|
|
265
|
+
* The object that contains properties and methods related to Text
|
|
266
|
+
* for Layers whose `kind` is equal to `LayerKind.TEXT`
|
|
267
|
+
* @minVersion 24.2
|
|
268
|
+
*/
|
|
269
|
+
get textItem(): TextItem;
|
|
270
|
+
/**
|
|
271
|
+
* @ignore
|
|
272
|
+
* We use ID to reference layers internally
|
|
273
|
+
*/
|
|
274
|
+
private readonly _id;
|
|
275
|
+
/**
|
|
276
|
+
* @ignore
|
|
277
|
+
* We use ID to reference the layer's document internally
|
|
278
|
+
*/
|
|
279
|
+
readonly _docId: number;
|
|
280
|
+
/**
|
|
281
|
+
* @ignore
|
|
282
|
+
*/
|
|
283
|
+
constructor(id: number, docId: number);
|
|
284
|
+
/**
|
|
285
|
+
* Applies the Add Noise filter.
|
|
286
|
+
*
|
|
287
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
288
|
+
*
|
|
289
|
+
* @minVersion 23.5
|
|
290
|
+
* @param amount Percentage of noise applied [0.1,400].
|
|
291
|
+
* @param distribution Distribution method to use.
|
|
292
|
+
* @param monochromatic Adds black and white noise if true.
|
|
293
|
+
* @async
|
|
294
|
+
*/
|
|
295
|
+
applyAddNoise(amount: number, distribution: Constants.NoiseDistribution, monochromatic: boolean): Promise<void>;
|
|
296
|
+
/**
|
|
297
|
+
* Applies the Average filter.
|
|
298
|
+
*
|
|
299
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
300
|
+
*
|
|
301
|
+
* @minVersion 23.5
|
|
302
|
+
* @async
|
|
303
|
+
*/
|
|
304
|
+
applyAverage(): Promise<void>;
|
|
305
|
+
/**
|
|
306
|
+
* Applies the Blur filter.
|
|
307
|
+
*
|
|
308
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
309
|
+
*
|
|
310
|
+
* @minVersion 23.5
|
|
311
|
+
* @async
|
|
312
|
+
*/
|
|
313
|
+
applyBlur(): Promise<void>;
|
|
314
|
+
/**
|
|
315
|
+
* Applies the Blur More filter.
|
|
316
|
+
*
|
|
317
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
318
|
+
*
|
|
319
|
+
* @minVersion 23.5
|
|
320
|
+
* @async
|
|
321
|
+
*/
|
|
322
|
+
applyBlurMore(): Promise<void>;
|
|
323
|
+
/**
|
|
324
|
+
* Applies the Clouds filter.
|
|
325
|
+
*
|
|
326
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
327
|
+
*
|
|
328
|
+
* @minVersion 23.5
|
|
329
|
+
* @async
|
|
330
|
+
*/
|
|
331
|
+
applyClouds(): Promise<void>;
|
|
332
|
+
/**
|
|
333
|
+
* Applies the Custom filter.
|
|
334
|
+
*
|
|
335
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
336
|
+
*
|
|
337
|
+
* @minVersion 23.5
|
|
338
|
+
* @param characteristics Square matrix (5 x 5) used to perform filter operation.
|
|
339
|
+
* @param scale The value by which to divide the sum of the pixel values included in the calculation
|
|
340
|
+
* @param offset The value to be added to the result of the scale calculation.
|
|
341
|
+
* @async
|
|
342
|
+
*/
|
|
343
|
+
applyCustomFilter(characteristics: number[], scale: number, offset: number): Promise<void>;
|
|
344
|
+
/**
|
|
345
|
+
* Applies the De-Interlace filter.
|
|
346
|
+
*
|
|
347
|
+
* Unsupported color modes: Indexed Color, Bitmap, CMYK 8 bits, CMYK 16 bits, Duotone 8 bits
|
|
348
|
+
*
|
|
349
|
+
* @minVersion 23.5
|
|
350
|
+
* @param eliminateFields Eliminate EVENFIELDS or ODDFIELDS field order.
|
|
351
|
+
* @param createFields Create fields by either DUPLICATION or INTERPOLATION.
|
|
352
|
+
* @async
|
|
353
|
+
*/
|
|
354
|
+
applyDeInterlace(eliminateFields: Constants.EliminateFields, createFields: Constants.CreateFields): Promise<void>;
|
|
355
|
+
/**
|
|
356
|
+
* Applies the Despeckle filter.
|
|
357
|
+
*
|
|
358
|
+
* Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits
|
|
359
|
+
*
|
|
360
|
+
* @minVersion 23.5
|
|
361
|
+
* @async
|
|
362
|
+
*/
|
|
363
|
+
applyDespeckle(): Promise<void>;
|
|
364
|
+
/**
|
|
365
|
+
* Applies the Difference Clouds filter.
|
|
366
|
+
*
|
|
367
|
+
* Unsupported color modes: Indexed Color, Bitmap, Lab 8 bits, Lab 16 bits
|
|
368
|
+
*
|
|
369
|
+
* @minVersion 23.5
|
|
370
|
+
* @async
|
|
371
|
+
*/
|
|
372
|
+
applyDifferenceClouds(): Promise<void>;
|
|
373
|
+
/**
|
|
374
|
+
* Applies the Diffuse Glow filter.
|
|
375
|
+
*
|
|
376
|
+
* Supported color modes: RGB 8 bits, Duotone 8 bits, Grayscale 8 bits, Multichannel 8 bits
|
|
377
|
+
*
|
|
378
|
+
* @minVersion 23.5
|
|
379
|
+
* @param graininess The amount of grain [0,10].
|
|
380
|
+
* @param glowAmount The glow amount [0,20].
|
|
381
|
+
* @param clearAmount The clear amount [0,20].
|
|
382
|
+
* @async
|
|
383
|
+
*/
|
|
384
|
+
applyDiffuseGlow(graininess: number, glowAmount: number, clearAmount: number): Promise<void>;
|
|
385
|
+
/**
|
|
386
|
+
* Applies the Displace filter using the specified horizontal
|
|
387
|
+
* and vertical scale, mapping type, treatment of undistorted
|
|
388
|
+
* areas, and path to the distortion image map.
|
|
389
|
+
*
|
|
390
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
391
|
+
*
|
|
392
|
+
* @minVersion 23.5
|
|
393
|
+
* @param horizontalScale How much to scale in the direction of width [-999,999].
|
|
394
|
+
* @param verticalScale How much to scale in the direction of height [-999,999].
|
|
395
|
+
* @param displacementType Describes how the displacement map fits the
|
|
396
|
+
* image if the image is not the same size as the map.
|
|
397
|
+
* @param undefinedAreas The method used to treat undistorted areas
|
|
398
|
+
* or areas left blank in an image to which the filter in the Distor
|
|
399
|
+
* category has been applied.
|
|
400
|
+
* @param displacementMapFile Path to the distortion image map.
|
|
401
|
+
* @async
|
|
402
|
+
*/
|
|
403
|
+
applyDisplace(
|
|
404
|
+
horizontalScale: number,
|
|
405
|
+
verticalScale: number,
|
|
406
|
+
displacementType: Constants.DisplacementMapType,
|
|
407
|
+
undefinedAreas: Constants.UndefinedAreas,
|
|
408
|
+
displacementMapFile: File,
|
|
409
|
+
): Promise<void>;
|
|
410
|
+
/**
|
|
411
|
+
* Applies the Dust & Scratches filter.
|
|
412
|
+
*
|
|
413
|
+
* Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits
|
|
414
|
+
*
|
|
415
|
+
* @minVersion 23.5
|
|
416
|
+
* @param radius The radius of the filter in pixels [1,100].
|
|
417
|
+
* @param threshold The lower the amount, the stronger the effect [0,255].
|
|
418
|
+
* @async
|
|
419
|
+
*/
|
|
420
|
+
applyDustAndScratches(radius: number, threshold: number): Promise<void>;
|
|
421
|
+
/**
|
|
422
|
+
* Applies the Gaussian Blur filter.
|
|
423
|
+
*
|
|
424
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
425
|
+
*
|
|
426
|
+
* @minVersion 23.5
|
|
427
|
+
* @param radius The radius of the filter in pixels [0.1,250].
|
|
428
|
+
* @async
|
|
429
|
+
*/
|
|
430
|
+
applyGaussianBlur(radius: number): Promise<void>;
|
|
431
|
+
/**
|
|
432
|
+
* Applies the Glass filter.
|
|
433
|
+
*
|
|
434
|
+
* Supported color modes: RGB 8 bits, Duotone 8 bits, Grayscale 8 bits, Multichannel 8 bits
|
|
435
|
+
*
|
|
436
|
+
* @minVersion 23.5
|
|
437
|
+
* @param distortion Change the amount the glass distorts the image [0,20].
|
|
438
|
+
* @param smoothness Change the smoothness of the glass [1,15].
|
|
439
|
+
* @param scaling The percentage value to scale by [50,200].
|
|
440
|
+
* @param invert Invert the glass (default: false).
|
|
441
|
+
* @param texture The type of glass texture.
|
|
442
|
+
* This argument is ignored if "textureFile" is provided. (default: TextureType.CANVAS)
|
|
443
|
+
* @param textureFile Mapping for glass distortion (optional).
|
|
444
|
+
* @async
|
|
445
|
+
*/
|
|
446
|
+
applyGlassEffect(
|
|
447
|
+
distortion: number,
|
|
448
|
+
smoothness: number,
|
|
449
|
+
scaling: number,
|
|
450
|
+
invert?: boolean,
|
|
451
|
+
texture?: Constants.TextureType,
|
|
452
|
+
textureFile?: File,
|
|
453
|
+
): Promise<void>;
|
|
454
|
+
/**
|
|
455
|
+
* Applies the High Pass filter.
|
|
456
|
+
*
|
|
457
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
458
|
+
*
|
|
459
|
+
* @minVersion 23.5
|
|
460
|
+
* @param radius The width of high pass filter (pixels) [0.1,1000].
|
|
461
|
+
* @async
|
|
462
|
+
*/
|
|
463
|
+
applyHighPass(radius: number): Promise<void>;
|
|
464
|
+
/**
|
|
465
|
+
* Applies the Lens Blur filter.
|
|
466
|
+
*
|
|
467
|
+
* Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits
|
|
468
|
+
*
|
|
469
|
+
* @minVersion 23.5
|
|
470
|
+
* @param source The source for the depth map (default: `DepthMapSource.NONE`)
|
|
471
|
+
* @param focalDistance The blur focal distance for the depth map [0,255] (default: `0`).
|
|
472
|
+
* @param invertDepthMask True if the depth map is inverted (default: `false`)
|
|
473
|
+
* @param shape The shape of the iris (default: `Geometry.HEXAGON`)
|
|
474
|
+
* @param radius The radius of the iris [0,100] (default: 15)
|
|
475
|
+
* @param bladeCurvature The blade curvature of the iris [0,100] (default: `0`)
|
|
476
|
+
* @param rotation The rotation of the iris [0,360] (default: `0`)
|
|
477
|
+
* @param brightness The brightness for the specular highlights [0,100] (default: `0`)
|
|
478
|
+
* @param threshold The threshold for the specular highlights [0,255] (default: `0`)
|
|
479
|
+
* @param amount The amount of noise [0,100] (default: `0`)
|
|
480
|
+
* @param distribution The distribution value for the noise (default: `NoiseDistribution.UNIFORM`)
|
|
481
|
+
* @param monochromatic True if the noise is monochromatic (default: `false`)
|
|
482
|
+
* @async
|
|
483
|
+
*/
|
|
484
|
+
applyLensBlur(
|
|
485
|
+
source?: Constants.DepthMapSource,
|
|
486
|
+
focalDistance?: number,
|
|
487
|
+
invertDepthMask?: boolean,
|
|
488
|
+
shape?: Constants.Geometry,
|
|
489
|
+
radius?: number,
|
|
490
|
+
bladeCurvature?: number,
|
|
491
|
+
rotation?: number,
|
|
492
|
+
brightness?: number,
|
|
493
|
+
threshold?: number,
|
|
494
|
+
amount?: number,
|
|
495
|
+
distribution?: Constants.NoiseDistribution,
|
|
496
|
+
monochromatic?: boolean,
|
|
497
|
+
): Promise<void>;
|
|
498
|
+
/**
|
|
499
|
+
* Applies the Lens Flare filter.
|
|
500
|
+
*
|
|
501
|
+
* Supported color modes: RGB 8 bits, RGB 16 bits, RGB 32 bits
|
|
502
|
+
*
|
|
503
|
+
* @minVersion 23.5
|
|
504
|
+
* @param brightness Percentage of brightness applied [10,300].
|
|
505
|
+
* @param flareCenter The flare center `{x: number, y: number}`.
|
|
506
|
+
* @param flareCenter.x The horizontal coordinate in pixels.
|
|
507
|
+
* @param flareCenter.y The vertical coordinate in pixels.
|
|
508
|
+
* @param lensType The lens type used to produce the effect (default: `LensType.ZOOMLENS`).
|
|
509
|
+
* @async
|
|
510
|
+
*/
|
|
511
|
+
applyLensFlare(brightness: number, flareCenter: {
|
|
512
|
+
x: number;
|
|
513
|
+
y: number;
|
|
514
|
+
}, lensType?: Constants.LensType): Promise<void>;
|
|
515
|
+
/**
|
|
516
|
+
* Applies the Maximum filter
|
|
517
|
+
*
|
|
518
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
519
|
+
*
|
|
520
|
+
* @minVersion 23.5
|
|
521
|
+
* @param radius The radius of the filter in pixels.<br/>
|
|
522
|
+
* Integer in the range [1,500] when using `SQUARENESS`.<br/>
|
|
523
|
+
* Float in the range [0.2,500] when using `ROUNDNESS`.<br/>
|
|
524
|
+
* @param preserveShape Favor hard corners or smooth curves around the edges<br/>
|
|
525
|
+
* (default: `PreserveShape.SQUARENESS`)
|
|
526
|
+
*/
|
|
527
|
+
applyMaximum(radius: number, preserveShape?: Constants.PreserveShape): Promise<void>;
|
|
528
|
+
/**
|
|
529
|
+
* Applies the Minimum filter
|
|
530
|
+
*
|
|
531
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
532
|
+
*
|
|
533
|
+
* @minVersion 23.5
|
|
534
|
+
* @param radius The radius of the filter in pixels.<br/>
|
|
535
|
+
* Integer in the range [1,500] when using `SQUARENESS`.<br/>
|
|
536
|
+
* Float in the range [0.2,500] when using `ROUNDNESS`.<br/>
|
|
537
|
+
* @param preserveShape Favor hard corners or smooth curves around the edges<br/>
|
|
538
|
+
* (default: `PreserveShape.SQUARENESS`)
|
|
539
|
+
*/
|
|
540
|
+
applyMinimum(radius: number, preserveShape?: Constants.PreserveShape): Promise<void>;
|
|
541
|
+
/**
|
|
542
|
+
* Applies the Median filter
|
|
543
|
+
*
|
|
544
|
+
* Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits
|
|
545
|
+
*
|
|
546
|
+
* @minVersion 23.5
|
|
547
|
+
* @param radius The radius of the filter in pixels [1,500]
|
|
548
|
+
*/
|
|
549
|
+
applyMedianNoise(radius: number): Promise<void>;
|
|
550
|
+
/**
|
|
551
|
+
* Applies the Motion Blur filter
|
|
552
|
+
*
|
|
553
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
554
|
+
*
|
|
555
|
+
* @minVersion 23.5
|
|
556
|
+
* @param angle The angle the blur effect will be applied at (degrees) [-360,360]
|
|
557
|
+
* @param distance The amount of blur [1,2000]
|
|
558
|
+
*/
|
|
559
|
+
applyMotionBlur(angle: number, distance: number): Promise<void>;
|
|
560
|
+
/**
|
|
561
|
+
* Applies the NTSC Colors filter
|
|
562
|
+
*
|
|
563
|
+
* Supported color modes: RGB 8 bits, RGB 16 bits, RGB 32 bits
|
|
564
|
+
*
|
|
565
|
+
* @minVersion 23.5
|
|
566
|
+
*/
|
|
567
|
+
applyNTSC(): Promise<void>;
|
|
568
|
+
/**
|
|
569
|
+
* Applies the Ocean Ripple filter
|
|
570
|
+
*
|
|
571
|
+
* Supported color modes: RGB 8 bits, Duotone 8 bits, Grayscale 8 bits, Multichannel 8 bits
|
|
572
|
+
*
|
|
573
|
+
* @minVersion 23.5
|
|
574
|
+
* @param size The Ripple size [1,15]
|
|
575
|
+
* @param magnitude The Ripple magnitude [1,20]
|
|
576
|
+
*/
|
|
577
|
+
applyOceanRipple(size: number, magnitude: number): Promise<void>;
|
|
578
|
+
/**
|
|
579
|
+
* Applies the Offset filter
|
|
580
|
+
*
|
|
581
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
582
|
+
*
|
|
583
|
+
* @minVersion 23.5
|
|
584
|
+
* @param horizontal The horizontal offset [-2 \* doc.width, 2 \* doc.width]
|
|
585
|
+
* @param vertical The vertical offset [-2 \* doc.height, 2 \* doc.height]
|
|
586
|
+
* @param undefinedAreas Method to use to fill the empty space left by the offset<br/>
|
|
587
|
+
* (default: `OffsetUndefinedAreas.WRAPAROUND`).
|
|
588
|
+
*/
|
|
589
|
+
applyOffset(horizontal: number, vertical: number, undefinedAreas?: Constants.OffsetUndefinedAreas): Promise<void>;
|
|
590
|
+
/**
|
|
591
|
+
* Applies the Twirl filter.
|
|
592
|
+
*
|
|
593
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
594
|
+
*
|
|
595
|
+
* @minVersion 23.5
|
|
596
|
+
* @param angle The amount of twirl to apply (degrees) [-999,999]
|
|
597
|
+
* @async
|
|
598
|
+
*/
|
|
599
|
+
applyTwirl(angle: number): Promise<void>;
|
|
600
|
+
/**
|
|
601
|
+
* Applies the Pinch filter.
|
|
602
|
+
*
|
|
603
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
604
|
+
*
|
|
605
|
+
* @minVersion 23.5
|
|
606
|
+
* @param amount The pinch amount. Negative value creates effect of expansion
|
|
607
|
+
* and positive creates effect of contraction. [-100,100]
|
|
608
|
+
* @async
|
|
609
|
+
*/
|
|
610
|
+
applyPinch(amount: number): Promise<void>;
|
|
611
|
+
/**
|
|
612
|
+
* Applies the Polar Coordinates filter.
|
|
613
|
+
*
|
|
614
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
615
|
+
*
|
|
616
|
+
* @minVersion 23.5
|
|
617
|
+
* @param conversion The conversion type.
|
|
618
|
+
* @async
|
|
619
|
+
*/
|
|
620
|
+
applyPolarCoordinates(conversion: Constants.PolarConversionType): Promise<void>;
|
|
621
|
+
/**
|
|
622
|
+
* Applies the Ripple filter.
|
|
623
|
+
*
|
|
624
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
625
|
+
*
|
|
626
|
+
* @minVersion 23.5
|
|
627
|
+
* @param amount The ripple amount. [-999,999]
|
|
628
|
+
* @param size The ripple size.
|
|
629
|
+
* @async
|
|
630
|
+
*/
|
|
631
|
+
applyRipple(amount: number, size: Constants.RippleSize): Promise<void>;
|
|
632
|
+
/**
|
|
633
|
+
* Applies the Sharpen filter.
|
|
634
|
+
*
|
|
635
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
636
|
+
*
|
|
637
|
+
* @minVersion 23.5
|
|
638
|
+
* @async
|
|
639
|
+
*/
|
|
640
|
+
applySharpen(): Promise<void>;
|
|
641
|
+
/**
|
|
642
|
+
* Applies the Sharpen Edges filter.
|
|
643
|
+
*
|
|
644
|
+
* Unsupported color modes: Indexed Color, Bitmap, RGB 32 bits, Grayscale 32 bits
|
|
645
|
+
*
|
|
646
|
+
* @minVersion 23.5
|
|
647
|
+
* @async
|
|
648
|
+
*/
|
|
649
|
+
applySharpenEdges(): Promise<void>;
|
|
650
|
+
/**
|
|
651
|
+
* Applies the Sharpen More filter.
|
|
652
|
+
*
|
|
653
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
654
|
+
*
|
|
655
|
+
* @minVersion 23.5
|
|
656
|
+
* @async
|
|
657
|
+
*/
|
|
658
|
+
applySharpenMore(): Promise<void>;
|
|
659
|
+
/**
|
|
660
|
+
* Applies the the Shear filter.
|
|
661
|
+
*
|
|
662
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
663
|
+
*
|
|
664
|
+
* @minVersion 23.5
|
|
665
|
+
* @param curve Specification of the shear curve in points as coordinates object with x, y properties
|
|
666
|
+
* e.g.in the format [{x:-20, y:1}, {x:30, y:128}]. Any number higher than 2 of coordinate objects can be specified.
|
|
667
|
+
* For "x" coordinate it is recommended to use range [-63,64] and for "y" coordinate use range [1,128].
|
|
668
|
+
* For bests results please make sure that first point has 0 at "y" axis and last point has 128 at "y" axis.
|
|
669
|
+
* Also sort points by "y" value in ascending order. Follow these rules to ensure that curve will be shown correctly
|
|
670
|
+
* in dialog UI.
|
|
671
|
+
* @param undefinedArea The treatment of areas left blank by the distortion.
|
|
672
|
+
* @async
|
|
673
|
+
*/
|
|
674
|
+
applyShear(
|
|
675
|
+
curve: Array<{
|
|
676
|
+
x: number;
|
|
677
|
+
y: number;
|
|
678
|
+
}>,
|
|
679
|
+
undefinedArea: Constants.UndefinedAreas,
|
|
680
|
+
): Promise<void>;
|
|
681
|
+
/**
|
|
682
|
+
* Applies the Smart Blur filter.
|
|
683
|
+
*
|
|
684
|
+
* Supported color modes: RGB 8 bits, CMYK 8 bits, Duotone 8 bits,
|
|
685
|
+
*
|
|
686
|
+
* Grayscale 8 bits, Lab 8 bits, Multichannel 8 bits
|
|
687
|
+
* @param radius The blur radius [0.1,100].
|
|
688
|
+
* @param threshold The blur threshold [0.1,100].
|
|
689
|
+
* @param blurQuality The smoothness or graininess of the blurred image.
|
|
690
|
+
* @param mode The smart blur mode.
|
|
691
|
+
* @async
|
|
692
|
+
* @minVersion 24.0
|
|
693
|
+
*/
|
|
694
|
+
applySmartBlur(
|
|
695
|
+
radius: number,
|
|
696
|
+
threshold: number,
|
|
697
|
+
blurQuality: Constants.SmartBlurQuality,
|
|
698
|
+
mode: Constants.SmartBlurMode,
|
|
699
|
+
): Promise<void>;
|
|
700
|
+
/**
|
|
701
|
+
* Applies the Spherize filter.
|
|
702
|
+
*
|
|
703
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
704
|
+
*
|
|
705
|
+
* @param amount The amount of distortion [-100,100].
|
|
706
|
+
* @param mode The distortion mode.
|
|
707
|
+
* @async
|
|
708
|
+
* @minVersion 24.0
|
|
709
|
+
*/
|
|
710
|
+
applySpherize(amount: number, mode: Constants.SpherizeMode): Promise<void>;
|
|
711
|
+
/**
|
|
712
|
+
* Applies the Unsharp Mask filter.
|
|
713
|
+
*
|
|
714
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
715
|
+
*
|
|
716
|
+
* @param amount The amount of sharpening (as a whole number percentage) [1,500].
|
|
717
|
+
* @param radius The radius in pixels [0.1,1000].
|
|
718
|
+
* @param threshold The contrast threshold [0,255].
|
|
719
|
+
* @async
|
|
720
|
+
* @minVersion 24.0
|
|
721
|
+
*/
|
|
722
|
+
applyUnSharpMask(amount: number, radius: number, threshold: number): Promise<void>;
|
|
723
|
+
/**
|
|
724
|
+
* Applies the Wave filter.
|
|
725
|
+
*
|
|
726
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
727
|
+
*
|
|
728
|
+
* @param generatorNumber The whole number of generators [1,999].
|
|
729
|
+
* @param minimumWavelength The minimum wave length [1,(maximum wave length - 1)] (whole number).
|
|
730
|
+
* @param maximumWavelength The maximum wave length [(minimum wave length + 1),999] (whole number).
|
|
731
|
+
* @param minimumAmplitude The minimum amplitude [1,(maximum amplitude - 1)] (whole number).
|
|
732
|
+
* @param maximumAmplitude The maximum amplitude [(minimum amplitude + 1),999] (whole number).
|
|
733
|
+
* @param horizontalScale The amount of horizontal scale (as a percentage) [1,100] (whole number).
|
|
734
|
+
* @param verticalScale The amount of vertical scale (as a percentage) [1,100] (whole number).
|
|
735
|
+
* @param waveType The wave type (optional).
|
|
736
|
+
* @param undefinedAreas The treatment of areas left blank by the distortion (optional).
|
|
737
|
+
* @param randomSeed The random seed (optional).
|
|
738
|
+
* @async
|
|
739
|
+
* @minVersion 24.0
|
|
740
|
+
*/
|
|
741
|
+
applyWave(
|
|
742
|
+
generatorNumber: number,
|
|
743
|
+
minimumWavelength: number,
|
|
744
|
+
maximumWavelength: number,
|
|
745
|
+
minimumAmplitude: number,
|
|
746
|
+
maximumAmplitude: number,
|
|
747
|
+
horizontalScale: number,
|
|
748
|
+
verticalScale: number,
|
|
749
|
+
waveType?: Constants.WaveType,
|
|
750
|
+
undefinedAreas?: Constants.UndefinedAreas,
|
|
751
|
+
randomSeed?: number,
|
|
752
|
+
): Promise<void>;
|
|
753
|
+
/**
|
|
754
|
+
* Applies the ZigZag filter.
|
|
755
|
+
*
|
|
756
|
+
* Unsupported color modes: Indexed Color, Bitmap
|
|
757
|
+
*
|
|
758
|
+
* @param amount The amount of zigzag [-100,100].
|
|
759
|
+
* @param ridges The number of ridges [0,20].
|
|
760
|
+
* @param style The zigzag style.
|
|
761
|
+
* @async
|
|
762
|
+
* @minVersion 24.0
|
|
763
|
+
*/
|
|
764
|
+
applyZigZag(amount: number, ridges: number, style: Constants.ZigZagType): Promise<void>;
|
|
765
|
+
/**
|
|
766
|
+
* The applyImage method lets you blend one image’s layer and channel (the source) with a this layer (the target).
|
|
767
|
+
* This will change pixels contained in this layer.
|
|
768
|
+
* Performs Image > Apply Image on the document. See the ApplyImageOptions
|
|
769
|
+
* object for more info and examples.
|
|
770
|
+
* @param applyImageOptions Option object for applyImage.
|
|
771
|
+
* @async
|
|
772
|
+
* @minVersion 24.5
|
|
773
|
+
*/
|
|
774
|
+
applyImage(applyImageOptions: ApplyImageOptions): Promise<void>;
|
|
775
|
+
/**
|
|
776
|
+
* Deletes this layer from the document.
|
|
777
|
+
*
|
|
778
|
+
* @returns Number of layer elements deleted.
|
|
779
|
+
*
|
|
780
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#delete}
|
|
781
|
+
*
|
|
782
|
+
* @example
|
|
783
|
+
* ```js
|
|
784
|
+
* const layers = document.layers
|
|
785
|
+
* layers && layers[0] && layers[0].delete()
|
|
786
|
+
* ```
|
|
787
|
+
*
|
|
788
|
+
* @minVersion 23.0
|
|
789
|
+
*/
|
|
790
|
+
delete(): void;
|
|
791
|
+
/**
|
|
792
|
+
* Duplicates the layer, creating a copy above it in layer stack,
|
|
793
|
+
* and returns the newly created layer.
|
|
794
|
+
*
|
|
795
|
+
* @param relativeObject If specified, duplicate to a different document or relative to another layer.
|
|
796
|
+
* @param insertionLocation Where to insert the duplicated layer.
|
|
797
|
+
* @param name Name for the duplicated layer.
|
|
798
|
+
*
|
|
799
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#duplicate}
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* ```js
|
|
803
|
+
* // duplicate a layer
|
|
804
|
+
* const copyLayer = await layer.duplicate()
|
|
805
|
+
* ```
|
|
806
|
+
*
|
|
807
|
+
* @example
|
|
808
|
+
* ```js
|
|
809
|
+
* // extract to a new document
|
|
810
|
+
* const exportDoc = psApp.documents[1]
|
|
811
|
+
* const exportedLayer = await layer.duplicate(exportDoc)
|
|
812
|
+
* ```
|
|
813
|
+
*
|
|
814
|
+
* @async
|
|
815
|
+
* @minVersion 23.0
|
|
816
|
+
*/
|
|
817
|
+
duplicate(
|
|
818
|
+
relativeObject?: Document | Layer,
|
|
819
|
+
insertionLocation?: Constants.ElementPlacement,
|
|
820
|
+
name?: string,
|
|
821
|
+
): Promise<Layer | null>;
|
|
822
|
+
/**
|
|
823
|
+
* Creates a link between this layer and the target layer if not already linked,
|
|
824
|
+
* and returns a list of layers linked to this layer.
|
|
825
|
+
*
|
|
826
|
+
* @param targetLayer The layer to link to.
|
|
827
|
+
*
|
|
828
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#link}
|
|
829
|
+
*
|
|
830
|
+
* @example
|
|
831
|
+
* ```js
|
|
832
|
+
* // link two layers together
|
|
833
|
+
* const linkedLayers = strokes.link(fillLayer)
|
|
834
|
+
* linkedLayers.forEach((layer) => console.log(layer.name))
|
|
835
|
+
* // "strokes"
|
|
836
|
+
* // "fillLayer"
|
|
837
|
+
* ```
|
|
838
|
+
*
|
|
839
|
+
* @minVersion 23.0
|
|
840
|
+
*/
|
|
841
|
+
link(targetLayer: Layer): Layer[];
|
|
842
|
+
/**
|
|
843
|
+
* Unlinks the layer from any existing links.
|
|
844
|
+
*
|
|
845
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#unlink}
|
|
846
|
+
*
|
|
847
|
+
* @example
|
|
848
|
+
* ```js
|
|
849
|
+
* // detach layer from any existing links
|
|
850
|
+
* await layer.unlink()
|
|
851
|
+
* ```
|
|
852
|
+
*
|
|
853
|
+
* @async
|
|
854
|
+
* @minVersion 23.0
|
|
855
|
+
*/
|
|
856
|
+
unlink(): Promise<void>;
|
|
857
|
+
/**
|
|
858
|
+
* Moves the layer relative to the layer specified in parameters.
|
|
859
|
+
* "placeAfter" places the layer below relativeObject.
|
|
860
|
+
* "placeBefore" places the layer above relativeObject.
|
|
861
|
+
* "placeInside" places the layer inside relativeObject if relativeObject is a group layer.
|
|
862
|
+
* `ElementPlacement.PLACEINSIDE` is only valid when `relativeObject.kind === LayerKind.group`
|
|
863
|
+
*
|
|
864
|
+
* @param relativeObject The layer to move relative to.
|
|
865
|
+
* @param insertLocation Where to place the layer.
|
|
866
|
+
*
|
|
867
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#move}
|
|
868
|
+
* @minVersion 23.0
|
|
869
|
+
*/
|
|
870
|
+
move(relativeObject: Layer, insertLocation: Constants.ElementPlacement): void;
|
|
871
|
+
/**
|
|
872
|
+
* Moves the layer to a position above the topmost layer or group.
|
|
873
|
+
*
|
|
874
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#bringtofront}
|
|
875
|
+
* @minVersion 23.0
|
|
876
|
+
*/
|
|
877
|
+
bringToFront(): void;
|
|
878
|
+
/**
|
|
879
|
+
* Moves the layer to the bottom. If the bottom layer is the
|
|
880
|
+
* background, it will move the layer to the position above the background.
|
|
881
|
+
* If it is in a group, it will move to the bottom of the group.
|
|
882
|
+
*
|
|
883
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#sendtoback}
|
|
884
|
+
* @minVersion 23.0
|
|
885
|
+
*/
|
|
886
|
+
sendToBack(): void;
|
|
887
|
+
/**
|
|
888
|
+
* Moves the layer (translation).
|
|
889
|
+
*
|
|
890
|
+
* @param horizontal Numeric value to offset layer by in pixels or percent.
|
|
891
|
+
* @param vertical Numeric value to offset layer by in pixels or percent.
|
|
892
|
+
*
|
|
893
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#translate}
|
|
894
|
+
*
|
|
895
|
+
* @example
|
|
896
|
+
* ```js
|
|
897
|
+
* // Translate the layer to the left by 200px
|
|
898
|
+
* await layer.translate(-200, 0)
|
|
899
|
+
* ```
|
|
900
|
+
*
|
|
901
|
+
* @example
|
|
902
|
+
* ```js
|
|
903
|
+
* // move the layer one height down
|
|
904
|
+
* let xOffsetPct = {_unit: "percentUnit", _value: 0};
|
|
905
|
+
* let yOffsetPct = {_unit: "percentUnit", _value: 100};
|
|
906
|
+
* await layer.translate(xOffsetPct, yOffsetPct);
|
|
907
|
+
* ```
|
|
908
|
+
*
|
|
909
|
+
* @async
|
|
910
|
+
* @minVersion 23.0
|
|
911
|
+
*/
|
|
912
|
+
translate(
|
|
913
|
+
horizontal: number | Unit.PercentValue | Unit.PixelValue,
|
|
914
|
+
vertical: number | Unit.PercentValue | Unit.PixelValue,
|
|
915
|
+
): Promise<void>;
|
|
916
|
+
/**
|
|
917
|
+
* Flips the layer on one or both axis.
|
|
918
|
+
*
|
|
919
|
+
* @param axis Which axis (or both) to flip the layer on.
|
|
920
|
+
* - "horizontal": flip layer on horizontal axis
|
|
921
|
+
* - "vertical": flip layer on vertical axis
|
|
922
|
+
* - "both": flip layer on both axes
|
|
923
|
+
*
|
|
924
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#flip}
|
|
925
|
+
*
|
|
926
|
+
* @example
|
|
927
|
+
* ```js
|
|
928
|
+
* // flip horizontally
|
|
929
|
+
* await layer.flip('horizontal');
|
|
930
|
+
* ```
|
|
931
|
+
*
|
|
932
|
+
* @async
|
|
933
|
+
* @minVersion 23.0
|
|
934
|
+
*/
|
|
935
|
+
flip(axis: 'horizontal' | 'vertical' | 'both'): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Scales the layer.
|
|
938
|
+
*
|
|
939
|
+
* Renamed from `resize` in ExtendScript.
|
|
940
|
+
*
|
|
941
|
+
* @param width Numeric percentage to scale layer horizontally.
|
|
942
|
+
* @param height Numeric percentage to scale layer vertically.
|
|
943
|
+
* @param anchor Anchor position to rotate around.
|
|
944
|
+
* @param options.interpolation Interpolation method to use when resampling the image.
|
|
945
|
+
*
|
|
946
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#scale}
|
|
947
|
+
*
|
|
948
|
+
* @example
|
|
949
|
+
* ```js
|
|
950
|
+
* await layer.scale(80, 80)
|
|
951
|
+
* // Scale the layer to be a quarter of the size relative to bottom left corner
|
|
952
|
+
* let anchorPos = require('photoshop').constants.AnchorPosition
|
|
953
|
+
* await layer.scale(50, 50, anchorPos.BOTTOMLEFT)
|
|
954
|
+
* ```
|
|
955
|
+
*
|
|
956
|
+
* @async
|
|
957
|
+
* @minVersion 23.0
|
|
958
|
+
*/
|
|
959
|
+
scale(
|
|
960
|
+
width: number | Unit.PercentValue,
|
|
961
|
+
height: number | Unit.PercentValue,
|
|
962
|
+
anchor?: Constants.AnchorPosition,
|
|
963
|
+
options?: {
|
|
964
|
+
interpolation?: Constants.InterpolationMethod;
|
|
965
|
+
},
|
|
966
|
+
): Promise<void>;
|
|
967
|
+
/**
|
|
968
|
+
* Rotates the layer.
|
|
969
|
+
*
|
|
970
|
+
* @param angle Angle to rotate the layer by in degrees.
|
|
971
|
+
* @param anchor Anchor position to rotate around.
|
|
972
|
+
* @param options.interpolation Interpolation method to use when resampling the image.
|
|
973
|
+
*
|
|
974
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#rotate}
|
|
975
|
+
*
|
|
976
|
+
* @example
|
|
977
|
+
* ```js
|
|
978
|
+
* // rotate 90 deg counter clockwise
|
|
979
|
+
* await layer.rotate(-90)
|
|
980
|
+
* // rotate 90 deg clockwise relative to top left corner
|
|
981
|
+
* let anchorPos = require('photoshop').constants.AnchorPosition
|
|
982
|
+
* await layer.rotate(90, anchorPos.TOPLEFT)
|
|
983
|
+
* ```
|
|
984
|
+
*
|
|
985
|
+
* @async
|
|
986
|
+
* @minVersion 23.0
|
|
987
|
+
*/
|
|
988
|
+
rotate(angle: number | Unit.AngleValue, anchor?: Constants.AnchorPosition, options?: {
|
|
989
|
+
interpolation?: Constants.InterpolationMethod;
|
|
990
|
+
}): Promise<void>;
|
|
991
|
+
/**
|
|
992
|
+
* Applies a skew to the layer.
|
|
993
|
+
*
|
|
994
|
+
* @param angleH Horizontal angle to skew by.
|
|
995
|
+
* @param angleV Vertical angle to skew by.
|
|
996
|
+
* @param options.interpolation Interpolation method to use when resampling the image.
|
|
997
|
+
*
|
|
998
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#skew}
|
|
999
|
+
*
|
|
1000
|
+
* @example
|
|
1001
|
+
* ```js
|
|
1002
|
+
* // parallelogram shape
|
|
1003
|
+
* await layer.skew(-15, 0)
|
|
1004
|
+
* ```
|
|
1005
|
+
*
|
|
1006
|
+
* @async
|
|
1007
|
+
* @minVersion 23.0
|
|
1008
|
+
*/
|
|
1009
|
+
skew(angleH: number | Unit.AngleValue, angleV: number | Unit.AngleValue, options?: {
|
|
1010
|
+
interpolation?: Constants.InterpolationMethod;
|
|
1011
|
+
}): Promise<void>;
|
|
1012
|
+
/**
|
|
1013
|
+
* Clears the layer pixels and does not copy to the clipboard.
|
|
1014
|
+
* If no pixel selection is found, select all pixels and clear.
|
|
1015
|
+
*
|
|
1016
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#clear}
|
|
1017
|
+
*
|
|
1018
|
+
* @async
|
|
1019
|
+
* @minVersion 23.0
|
|
1020
|
+
*/
|
|
1021
|
+
clear(): Promise<void>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Copies the layer to the clipboard. When the optional argument is set to true, a
|
|
1024
|
+
* merged copy is performed (that is, all visible layers are copied to the clipboard).
|
|
1025
|
+
*
|
|
1026
|
+
* @param merge Whether to perform a merged copy.
|
|
1027
|
+
*
|
|
1028
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#copy}
|
|
1029
|
+
*
|
|
1030
|
+
* @example
|
|
1031
|
+
* ```js
|
|
1032
|
+
* await layer.copy(true)
|
|
1033
|
+
* await layer.copy()
|
|
1034
|
+
* ```
|
|
1035
|
+
*
|
|
1036
|
+
* @async
|
|
1037
|
+
* @minVersion 23.0
|
|
1038
|
+
*/
|
|
1039
|
+
copy(merge?: boolean): Promise<void>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Cuts the layer contents to the clipboard. If no selection is found then select all the pixels and then cut.
|
|
1042
|
+
*
|
|
1043
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#cut}
|
|
1044
|
+
*
|
|
1045
|
+
* @async
|
|
1046
|
+
* @minVersion 23.0
|
|
1047
|
+
*/
|
|
1048
|
+
cut(): Promise<void>;
|
|
1049
|
+
/**
|
|
1050
|
+
* Merges layers. This operates on the currently selected layers. If multiple
|
|
1051
|
+
* layers are selected, they will be merged together. If one layer is selected,
|
|
1052
|
+
* it is merged down with the layer beneath. In this case, the layer below must
|
|
1053
|
+
* be a pixel layer. The merged layer will now be the active layer.
|
|
1054
|
+
*
|
|
1055
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layer/#merge}
|
|
1056
|
+
*
|
|
1057
|
+
* @async
|
|
1058
|
+
* @minVersion 23.0
|
|
1059
|
+
*/
|
|
1060
|
+
merge(): Promise<Layer>;
|
|
1061
|
+
/**
|
|
1062
|
+
* Converts the targeted contents in the layer into a flat, raster image.
|
|
1063
|
+
*
|
|
1064
|
+
* @async
|
|
1065
|
+
* @minVersion 23.0
|
|
1066
|
+
*/
|
|
1067
|
+
rasterize(target: Constants.RasterizeType): Promise<void>;
|
|
1068
|
+
/**
|
|
1069
|
+
* The layers inside this group layer.
|
|
1070
|
+
* @minVersion 23.0
|
|
1071
|
+
*/
|
|
1072
|
+
get layers(): Layers | null;
|
|
1073
|
+
}
|