@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,219 @@
|
|
|
1
|
+
import type { Document } from './Document';
|
|
2
|
+
import type { Layer } from './Layer';
|
|
3
|
+
import type { LayerCompRecaptureOptions } from './types/LayerCompTypes';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a single layer comp in the document.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/}
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```javascript
|
|
11
|
+
* // Access layer comps
|
|
12
|
+
* const doc = app.activeDocument;
|
|
13
|
+
* const layerComp = doc.layerComps[0];
|
|
14
|
+
* console.log(`Layer comp: ${layerComp.name}`);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```javascript
|
|
19
|
+
* // Create and apply a layer comp
|
|
20
|
+
* const doc = app.activeDocument;
|
|
21
|
+
* const comp = await doc.layerComps.add("My Design", "A great design", true, true, true);
|
|
22
|
+
* await comp.apply();
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @minVersion 24.0
|
|
26
|
+
*/
|
|
27
|
+
export class LayerComp {
|
|
28
|
+
/**
|
|
29
|
+
* @ignore
|
|
30
|
+
*/
|
|
31
|
+
constructor(id: number, docId: number);
|
|
32
|
+
/**
|
|
33
|
+
* @ignore
|
|
34
|
+
*/
|
|
35
|
+
private get _directRef();
|
|
36
|
+
/**
|
|
37
|
+
* The class name of the referenced LayerComp object
|
|
38
|
+
*
|
|
39
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#typename}
|
|
40
|
+
* @minVersion 24.0
|
|
41
|
+
*/
|
|
42
|
+
get typename(): 'LayerComp';
|
|
43
|
+
/**
|
|
44
|
+
* For use with batchPlay operations. This layer comp ID, along with its document ID
|
|
45
|
+
* can be used to represent this layer comp for the lifetime of this document or the layer comp.
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#id}
|
|
48
|
+
* @minVersion 24.0
|
|
49
|
+
*/
|
|
50
|
+
get id(): number;
|
|
51
|
+
/**
|
|
52
|
+
* The ID of the document of this layer comp.
|
|
53
|
+
*
|
|
54
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#docid}
|
|
55
|
+
* @minVersion 24.0
|
|
56
|
+
*/
|
|
57
|
+
get docId(): number;
|
|
58
|
+
/**
|
|
59
|
+
* Owner document of this layer comp
|
|
60
|
+
*
|
|
61
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#parent}
|
|
62
|
+
* @minVersion 24.0
|
|
63
|
+
*/
|
|
64
|
+
get parent(): Document;
|
|
65
|
+
/**
|
|
66
|
+
* The name of the layer comp.
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#name}
|
|
69
|
+
* @minVersion 24.0
|
|
70
|
+
*/
|
|
71
|
+
get name(): string;
|
|
72
|
+
set name(name: string);
|
|
73
|
+
/**
|
|
74
|
+
* The description of the layer comp.
|
|
75
|
+
*
|
|
76
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#comment}
|
|
77
|
+
* @minVersion 24.0
|
|
78
|
+
*/
|
|
79
|
+
get comment(): string | null;
|
|
80
|
+
set comment(comment: string | null);
|
|
81
|
+
/**
|
|
82
|
+
* If true, the layer comp is currently selected in the Layer Comps panel.
|
|
83
|
+
*
|
|
84
|
+
* Note: selected does not mean that this layer comp is applied to document.
|
|
85
|
+
*
|
|
86
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#selected}
|
|
87
|
+
* @minVersion 24.0
|
|
88
|
+
*/
|
|
89
|
+
get selected(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* If true, the layer comp will remember the layers' appearance (layer style) settings.
|
|
92
|
+
*
|
|
93
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#appearance}
|
|
94
|
+
* @minVersion 24.0
|
|
95
|
+
*/
|
|
96
|
+
get appearance(): boolean;
|
|
97
|
+
set appearance(value: boolean);
|
|
98
|
+
/**
|
|
99
|
+
* If true, the layer comp will remember layers' positions.
|
|
100
|
+
*
|
|
101
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#position}
|
|
102
|
+
* @minVersion 24.0
|
|
103
|
+
*/
|
|
104
|
+
get position(): boolean;
|
|
105
|
+
set position(value: boolean);
|
|
106
|
+
/**
|
|
107
|
+
* If true, the layer comp will remember layers' visibilities.
|
|
108
|
+
*
|
|
109
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#visibility}
|
|
110
|
+
* @minVersion 24.0
|
|
111
|
+
*/
|
|
112
|
+
get visibility(): boolean;
|
|
113
|
+
set visibility(value: boolean);
|
|
114
|
+
/**
|
|
115
|
+
* If true, the layer comp will remember which of the Smart Object's layer comps are set in the Properties panel.
|
|
116
|
+
*
|
|
117
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#childcomp}
|
|
118
|
+
* @minVersion 24.0
|
|
119
|
+
*/
|
|
120
|
+
get childComp(): boolean;
|
|
121
|
+
set childComp(value: boolean);
|
|
122
|
+
/**
|
|
123
|
+
* Applies the layer comp to the document.
|
|
124
|
+
*
|
|
125
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#apply}
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```javascript
|
|
129
|
+
* // Apply the first layer comp
|
|
130
|
+
* await app.activeDocument.layerComps[0].apply();
|
|
131
|
+
* ```
|
|
132
|
+
*
|
|
133
|
+
* @async
|
|
134
|
+
* @minVersion 24.0
|
|
135
|
+
*/
|
|
136
|
+
apply(): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Updates the recorded states of the layers for this layer comp.
|
|
139
|
+
*
|
|
140
|
+
* Applies to all layers and all properties supported by this layer comp.
|
|
141
|
+
*
|
|
142
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#recapture}
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```javascript
|
|
146
|
+
* // Recapture all properties for all layers
|
|
147
|
+
* await app.activeDocument.layerComps[0].recapture();
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @async
|
|
151
|
+
* @minVersion 24.0
|
|
152
|
+
*/
|
|
153
|
+
recapture(): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Updates the recorded states of the layers for this layer comp.
|
|
156
|
+
*
|
|
157
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#recapture}
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```javascript
|
|
161
|
+
* // Recapture only visibility for specific layers
|
|
162
|
+
* const layers = [app.activeDocument.layers[0], app.activeDocument.layers[1]];
|
|
163
|
+
* await app.activeDocument.layerComps[0].recapture({ visibility: true }, layers);
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* @async
|
|
167
|
+
* @param argument what properties to recapture.
|
|
168
|
+
* @param layers if this argument is passed then only specified layers will be recaptured.
|
|
169
|
+
*/
|
|
170
|
+
recapture(arg: LayerCompRecaptureOptions, layers?: Layer[]): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Deletes this object from document.
|
|
173
|
+
*
|
|
174
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#remove}
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```javascript
|
|
178
|
+
* // Delete a layer comp
|
|
179
|
+
* await app.activeDocument.layerComps[0].remove();
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* @async
|
|
183
|
+
* @minVersion 24.0
|
|
184
|
+
*/
|
|
185
|
+
remove(): Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Resets the layer comp state to the document state.
|
|
188
|
+
*
|
|
189
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#resetlayercomp}
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```javascript
|
|
193
|
+
* // Reset layer comp to current document state
|
|
194
|
+
* await app.activeDocument.layerComps[0].resetLayerComp();
|
|
195
|
+
* ```
|
|
196
|
+
*
|
|
197
|
+
* @async
|
|
198
|
+
* @minVersion 24.0
|
|
199
|
+
*/
|
|
200
|
+
resetLayerComp(): Promise<void>;
|
|
201
|
+
/**
|
|
202
|
+
* Duplicates this layer comp
|
|
203
|
+
*
|
|
204
|
+
* @returns newly created layer comp
|
|
205
|
+
*
|
|
206
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/layercomp/#duplicate}
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```javascript
|
|
210
|
+
* // Duplicate a layer comp
|
|
211
|
+
* const newComp = await app.activeDocument.layerComps[0].duplicate();
|
|
212
|
+
* newComp.name = "Copy of " + app.activeDocument.layerComps[0].name;
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* @async
|
|
216
|
+
* @minVersion 24.0
|
|
217
|
+
*/
|
|
218
|
+
duplicate(): Promise<LayerComp>;
|
|
219
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type { SubPathItems } from './collections/SubPathItems';
|
|
2
|
+
import type * as Constants from './Constants';
|
|
3
|
+
import type { Document } from './Document';
|
|
4
|
+
import type { Layer } from './Layer';
|
|
5
|
+
import type { SolidColor } from './objects/SolidColor';
|
|
6
|
+
/**
|
|
7
|
+
* A path or drawing object, such as the outline of a shape or a straight or curved line,
|
|
8
|
+
* which contains sub paths defining its geometry.
|
|
9
|
+
*
|
|
10
|
+
* Access through the collection in the {@link Document.pathItems} property. For example, this selects a named path item:
|
|
11
|
+
*
|
|
12
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/}
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```javascript
|
|
16
|
+
* const currentPathItem = app.activeDocument.pathItems.getByName("myPath");
|
|
17
|
+
* currentPathItem.select()
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Create these objects by passing a set of SubPathInfo objects to the {@link PathItems.add}() method. This method creates
|
|
21
|
+
* a {@link SubPathItem} object for each {@link SubPathInfo} object, and creates and returns a new {@link PathItem} object for the
|
|
22
|
+
* path represented by all of the subpaths.
|
|
23
|
+
*
|
|
24
|
+
* @minVersion 23.3
|
|
25
|
+
*/
|
|
26
|
+
export class PathItem {
|
|
27
|
+
/**
|
|
28
|
+
* @ignore
|
|
29
|
+
*/
|
|
30
|
+
constructor(id: number, docId: number);
|
|
31
|
+
/**
|
|
32
|
+
* The class name of the referenced object: *"PathItem"*.
|
|
33
|
+
*
|
|
34
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#typename}
|
|
35
|
+
* @minVersion 23.3
|
|
36
|
+
*/
|
|
37
|
+
get typename(): 'PathItem';
|
|
38
|
+
/**
|
|
39
|
+
* For use with batchPlay operations. This pathItem ID, along with its document ID
|
|
40
|
+
* can be used to represent this pathItem for the lifetime of this document.
|
|
41
|
+
*
|
|
42
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#id}
|
|
43
|
+
* @minVersion 23.3
|
|
44
|
+
*/
|
|
45
|
+
get id(): number;
|
|
46
|
+
/**
|
|
47
|
+
* The ID of the document of this pathItem.
|
|
48
|
+
*
|
|
49
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#docid}
|
|
50
|
+
* @minVersion 23.3
|
|
51
|
+
*/
|
|
52
|
+
get docId(): number;
|
|
53
|
+
/**
|
|
54
|
+
* The document in which the path resides.
|
|
55
|
+
*
|
|
56
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#parent}
|
|
57
|
+
* @minVersion 23.3
|
|
58
|
+
*/
|
|
59
|
+
get parent(): Document;
|
|
60
|
+
/**
|
|
61
|
+
* The specific kind of path.
|
|
62
|
+
*
|
|
63
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#kind}
|
|
64
|
+
* @minVersion 23.3
|
|
65
|
+
*/
|
|
66
|
+
get kind(): Constants.PathKind;
|
|
67
|
+
set kind(kind: Constants.PathKind);
|
|
68
|
+
/**
|
|
69
|
+
* Name of this path
|
|
70
|
+
*
|
|
71
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#name}
|
|
72
|
+
* @minVersion 23.3
|
|
73
|
+
*/
|
|
74
|
+
get name(): string;
|
|
75
|
+
set name(name: string);
|
|
76
|
+
/**
|
|
77
|
+
* The contained {@link SubPathItem}s in this path.
|
|
78
|
+
*
|
|
79
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#subpathitems}
|
|
80
|
+
* @minVersion 23.3
|
|
81
|
+
*/
|
|
82
|
+
get subPathItems(): SubPathItems;
|
|
83
|
+
/**
|
|
84
|
+
* Deselects this `pathItem` object.
|
|
85
|
+
*
|
|
86
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#deselect}
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```javascript
|
|
90
|
+
* const path = app.activeDocument.pathItems[0];
|
|
91
|
+
* await path.deselect();
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* @minVersion 23.3
|
|
95
|
+
*/
|
|
96
|
+
deselect(): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Duplicates the `pathItem` object with the new name, returning the duplicate.
|
|
99
|
+
*
|
|
100
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#duplicate}
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```javascript
|
|
104
|
+
* const originalPath = app.activeDocument.pathItems[0];
|
|
105
|
+
* const duplicatePath = await originalPath.duplicate("Copy of " + originalPath.name);
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* @minVersion 23.3
|
|
109
|
+
*/
|
|
110
|
+
duplicate(name?: string): Promise<PathItem>;
|
|
111
|
+
/**
|
|
112
|
+
* Fills the area enclosed by this path.
|
|
113
|
+
*
|
|
114
|
+
* `opacity` is a percentage, in the `[0.0 ... 100.0]` range.
|
|
115
|
+
*
|
|
116
|
+
* `feather` is in pixels, in the `[0.0 ... 250.0]` range.
|
|
117
|
+
*
|
|
118
|
+
* If `wholePath` is true, all subpaths are used when doing the fill.
|
|
119
|
+
*
|
|
120
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#fillpath}
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```javascript
|
|
124
|
+
* const path = app.activeDocument.pathItems[0];
|
|
125
|
+
* const fillColor = new SolidColor();
|
|
126
|
+
* fillColor.rgb.red = 255;
|
|
127
|
+
* fillColor.rgb.green = 0;
|
|
128
|
+
* fillColor.rgb.blue = 0;
|
|
129
|
+
* await path.fillPath(fillColor, constants.ColorBlendMode.NORMAL, 100, false, 0, true, true);
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* @minVersion 23.3
|
|
133
|
+
*/
|
|
134
|
+
fillPath(
|
|
135
|
+
fillColor?: SolidColor,
|
|
136
|
+
mode?: Constants.ColorBlendMode,
|
|
137
|
+
opacity?: number,
|
|
138
|
+
preserveTransparency?: boolean,
|
|
139
|
+
feather?: number,
|
|
140
|
+
wholePath?: boolean,
|
|
141
|
+
antiAlias?: boolean,
|
|
142
|
+
): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Makes this the clipping path for this document.
|
|
145
|
+
*
|
|
146
|
+
* `flatness` tells the PostScript printer how to approximate curves in the path.
|
|
147
|
+
*
|
|
148
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#makeclippingpath}
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```javascript
|
|
152
|
+
* const path = app.activeDocument.pathItems.getByName("ClipPath");
|
|
153
|
+
* await path.makeClippingPath(2);
|
|
154
|
+
* ```
|
|
155
|
+
*
|
|
156
|
+
* @minVersion 23.3
|
|
157
|
+
*/
|
|
158
|
+
makeClippingPath(flatness?: number): Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Makes a selection object whose border is this path.
|
|
161
|
+
*
|
|
162
|
+
* `feather` is in pixels, in the range [0.0...250.0]
|
|
163
|
+
*
|
|
164
|
+
* `operation`, by default, is `SelectionType.REPLACE`
|
|
165
|
+
*
|
|
166
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#makeselection}
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```javascript
|
|
170
|
+
* const path = app.activeDocument.pathItems[0];
|
|
171
|
+
* await path.makeSelection(5, true, constants.SelectionType.REPLACE);
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* @minVersion 23.3
|
|
175
|
+
*/
|
|
176
|
+
makeSelection(feather?: number, antiAlias?: boolean, operation?: Constants.SelectionType): Promise<void>;
|
|
177
|
+
/**
|
|
178
|
+
* Deletes this object.
|
|
179
|
+
*
|
|
180
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#remove}
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```javascript
|
|
184
|
+
* const path = app.activeDocument.pathItems[0];
|
|
185
|
+
* await path.remove();
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @minVersion 23.3
|
|
189
|
+
*/
|
|
190
|
+
remove(): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Makes this the active or selected `PathItem` object.
|
|
193
|
+
*
|
|
194
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#select}
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```javascript
|
|
198
|
+
* const path = app.activeDocument.pathItems.getByName("myPath");
|
|
199
|
+
* await path.select();
|
|
200
|
+
* ```
|
|
201
|
+
*
|
|
202
|
+
* @minVersion 23.3
|
|
203
|
+
*/
|
|
204
|
+
select(): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Strokes the path with the specified tool
|
|
207
|
+
*
|
|
208
|
+
* `tool` is optional, and by default will use `ToolType.PENCIL`
|
|
209
|
+
*
|
|
210
|
+
* `simulatePressure` is false by default.
|
|
211
|
+
*
|
|
212
|
+
* If the tool is `ToolType.CLONESTAMP` or `ToolType.HEALINGBRUSH`, `sourceOrigin` must be provided as a
|
|
213
|
+
* an object with x and y properties (in pixels) to indicate the location of the stroke source. `sourceLayer`
|
|
214
|
+
* is optional, and by default will use the active layer in the document.
|
|
215
|
+
*
|
|
216
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathitem/#strokepath}
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```javascript
|
|
220
|
+
* // Stroke a path with the brush tool
|
|
221
|
+
* const path = app.activeDocument.pathItems[0];
|
|
222
|
+
* await path.strokePath(constants.ToolType.BRUSH, false);
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```javascript
|
|
227
|
+
* // Stroke with clone stamp tool
|
|
228
|
+
* const path = app.activeDocument.pathItems[0];
|
|
229
|
+
* await path.strokePath(
|
|
230
|
+
* constants.ToolType.CLONESTAMP,
|
|
231
|
+
* false,
|
|
232
|
+
* {x: 100, y: 100},
|
|
233
|
+
* app.activeDocument.layers[0]
|
|
234
|
+
* );
|
|
235
|
+
* ```
|
|
236
|
+
*
|
|
237
|
+
* @minVersion 23.3
|
|
238
|
+
*/
|
|
239
|
+
strokePath(tool?: Constants.ToolType, simulatePressure?: boolean, sourceOrigin?: {
|
|
240
|
+
x: number;
|
|
241
|
+
y: number;
|
|
242
|
+
}, sourceLayer?: Layer): Promise<void>;
|
|
243
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type * as Constants from './Constants';
|
|
2
|
+
import type { SubPathItem } from './SubPathItem';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the anchor and control-handle endpoints for a path segment. Each point (the anchor point, left-direction
|
|
5
|
+
* point, and right-direction point) is an array containing X and Y position coordinates.
|
|
6
|
+
*
|
|
7
|
+
* - Use the `PathPoint` object to retrieve information about the points that describe existing path segments. The
|
|
8
|
+
* properties are read-only. Access {@link PathPoint} objects through the {@link SubPathItem.pathPoints} property.
|
|
9
|
+
*
|
|
10
|
+
* - Use {@link PathPointInfo} with {@link PathItems.add}() to create path points. The properties are writeable.
|
|
11
|
+
*
|
|
12
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathpoint/}
|
|
13
|
+
*
|
|
14
|
+
* For paths that are straight segments (not curved), the coordinates of all three points are the same. For curved
|
|
15
|
+
* segments, the coordinates are different. The difference between the anchor point and the left or right
|
|
16
|
+
* direction points determines the arc of the curve. Use the left direction point to bend the curve "outward" or
|
|
17
|
+
* make it convex; or use the right direction point to bend the curve "inward" or make it concave.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Access path points from a path
|
|
22
|
+
* const path = app.activeDocument.pathItems[0];
|
|
23
|
+
* const subPath = path.subPathItems[0];
|
|
24
|
+
* subPath.pathPoints.forEach(point => {
|
|
25
|
+
* console.log(`Anchor: ${point.anchor}, Kind: ${point.kind}`);
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* Added in Photoshop 23.3*
|
|
30
|
+
*/
|
|
31
|
+
export class PathPoint {
|
|
32
|
+
/**
|
|
33
|
+
* @ignore
|
|
34
|
+
*/
|
|
35
|
+
constructor(index: number, subPathIndex: number, pathId: number, docId: number);
|
|
36
|
+
/**
|
|
37
|
+
* The class name of the referenced object: *"PathPoint"*.
|
|
38
|
+
*
|
|
39
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathpoint/#typename}
|
|
40
|
+
* @minVersion 23.3
|
|
41
|
+
*/
|
|
42
|
+
get typename(): 'PathPoint';
|
|
43
|
+
/**
|
|
44
|
+
* The containing SubPath object.
|
|
45
|
+
*
|
|
46
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathpoint/#parent}
|
|
47
|
+
* @minVersion 23.3
|
|
48
|
+
*/
|
|
49
|
+
get parent(): SubPathItem;
|
|
50
|
+
/**
|
|
51
|
+
* The coordinates of the anchor point of the curve, in `[horizontal, vertical]` format.
|
|
52
|
+
*
|
|
53
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathpoint/#anchor}
|
|
54
|
+
* @minVersion 23.3
|
|
55
|
+
*/
|
|
56
|
+
get anchor(): number[];
|
|
57
|
+
/**
|
|
58
|
+
* The role (corner or smooth) this point plays in the containing path segment.
|
|
59
|
+
*
|
|
60
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathpoint/#kind}
|
|
61
|
+
* @minVersion 23.3
|
|
62
|
+
*/
|
|
63
|
+
get kind(): Constants.PointKind;
|
|
64
|
+
/**
|
|
65
|
+
* The location of the left-direction endpoint ('in' position), in `[horizontal, vertical]` format.
|
|
66
|
+
*
|
|
67
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathpoint/#leftdirection}
|
|
68
|
+
* @minVersion 23.3
|
|
69
|
+
*/
|
|
70
|
+
get leftDirection(): number[];
|
|
71
|
+
/**
|
|
72
|
+
* The location of the right-direction endpoint ('out' position), in `[horizontal, vertical]` format.
|
|
73
|
+
*
|
|
74
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/pathpoint/#rightdirection}
|
|
75
|
+
* @minVersion 23.3
|
|
76
|
+
*/
|
|
77
|
+
get rightDirection(): number[];
|
|
78
|
+
}
|