@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.
Files changed (88) hide show
  1. package/README.md +138 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +7049 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist-readmes/README.md +383 -0
  6. package/dist-runtime/runtime-code.cjs +17124 -0
  7. package/dist-runtime/runtime-code.d.cts +9 -0
  8. package/dist-schemas/@adobe-uxp-types/photoshop/src/index.d.ts +16 -0
  9. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/all-types.d.ts +65 -0
  10. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Actions.d.ts +230 -0
  11. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Channel.d.ts +120 -0
  12. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/ColorSampler.d.ts +105 -0
  13. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Constants.d.ts +1648 -0
  14. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/CoreModules.d.ts +922 -0
  15. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/CountItem.d.ts +86 -0
  16. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Document.d.ts +931 -0
  17. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Guide.d.ts +105 -0
  18. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/HistoryState.d.ts +74 -0
  19. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/ImagingModule.d.ts +559 -0
  20. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Layer.d.ts +1073 -0
  21. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/LayerComp.d.ts +219 -0
  22. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Objects.d.ts +7 -0
  23. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/PathItem.d.ts +243 -0
  24. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/PathPoint.d.ts +78 -0
  25. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Photoshop.d.ts +317 -0
  26. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Selection.d.ts +557 -0
  27. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/SubPathItem.d.ts +69 -0
  28. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/TextItem.d.ts +213 -0
  29. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Channels.d.ts +81 -0
  30. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/ColorSamplers.d.ts +97 -0
  31. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/CountItems.d.ts +130 -0
  32. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Documents.d.ts +95 -0
  33. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Guides.d.ts +76 -0
  34. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/HistoryStates.d.ts +56 -0
  35. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/LayerComps.d.ts +92 -0
  36. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Layers.d.ts +68 -0
  37. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/PathItems.d.ts +65 -0
  38. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/PathPoints.d.ts +50 -0
  39. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/SubPathItems.d.ts +50 -0
  40. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/TextFonts.d.ts +43 -0
  41. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/Colors.d.ts +225 -0
  42. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ConversionOptions.d.ts +213 -0
  43. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ImagingBounds.d.ts +53 -0
  44. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/PathPointInfo.d.ts +84 -0
  45. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SaveOptions.d.ts +376 -0
  46. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SolidColor.d.ts +118 -0
  47. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SubPathInfo.d.ts +47 -0
  48. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/TextFont.d.ts +49 -0
  49. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/Tool.d.ts +23 -0
  50. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/Preferences.d.ts +121 -0
  51. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesBase.d.ts +9 -0
  52. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesCursors.d.ts +37 -0
  53. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesFileHandling.d.ts +58 -0
  54. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesGeneral.d.ts +77 -0
  55. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesGuidesGridsAndSlices.d.ts +51 -0
  56. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesHistory.d.ts +69 -0
  57. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesInterface.d.ts +46 -0
  58. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesPerformance.d.ts +42 -0
  59. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesTools.d.ts +44 -0
  60. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesTransparencyAndGamut.d.ts +38 -0
  61. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesType.d.ts +44 -0
  62. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesUnitsAndRulers.d.ts +44 -0
  63. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/CharacterStyle.d.ts +254 -0
  64. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/ParagraphStyle.d.ts +114 -0
  65. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/TextWarpStyle.d.ts +48 -0
  66. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/ApplyImageTypes.d.ts +107 -0
  67. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/CalculationsTypes.d.ts +119 -0
  68. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/DocumentTypes.d.ts +80 -0
  69. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/LayerCompTypes.d.ts +91 -0
  70. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/LayerTypes.d.ts +153 -0
  71. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/SharedTypes.d.ts +6 -0
  72. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/TextTypes.d.ts +218 -0
  73. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/util/colorTypes.d.ts +61 -0
  74. package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/util/unit.d.ts +45 -0
  75. package/dist-schemas/@adobe-uxp-types/uxp/src/index.d.ts +21 -0
  76. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/all-types.d.ts +3 -0
  77. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/dialog.d.ts +26 -0
  78. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/entrypoints.d.ts +385 -0
  79. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/host.d.ts +28 -0
  80. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/os.d.ts +56 -0
  81. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/other.d.ts +7 -0
  82. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/shell.d.ts +54 -0
  83. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/storage.d.ts +1216 -0
  84. package/dist-schemas/@adobe-uxp-types/uxp/src/internal/versions.d.ts +18 -0
  85. package/dist-schemas/@bubblydoo/uxp-toolkit/dist/commands-library/index.d.ts +109 -0
  86. package/dist-schemas/@bubblydoo/uxp-toolkit/dist/index.d.ts +153 -0
  87. package/dist-schemas/@bubblydoo/uxp-toolkit/dist/psLayerRef-BJKcxKbm.d.ts +66 -0
  88. package/package.json +51 -0
@@ -0,0 +1,317 @@
1
+ import type { File } from 'uxp';
2
+ import type { Action, ActionSet } from './Actions';
3
+ import type { Documents } from './collections/Documents';
4
+ import type { TextFonts } from './collections/TextFonts';
5
+ import type { ColorSampler } from './ColorSampler';
6
+ import type * as Constants from './Constants';
7
+ import type { Document } from './Document';
8
+ import type { Guide } from './Guide';
9
+ import type { Layer } from './Layer';
10
+ import type { LayerComp } from './LayerComp';
11
+ import type { PathPointInfo } from './objects/PathPointInfo';
12
+ import type { SolidColor } from './objects/SolidColor';
13
+ import type { SubPathInfo } from './objects/SubPathInfo';
14
+ import type { Tool } from './objects/Tool';
15
+ import type { Preferences } from './preferences/Preferences';
16
+ import type { Selection } from './Selection';
17
+ import type { DocumentCreateOptions } from './types/DocumentTypes';
18
+
19
+ /**
20
+ * The top level application object, root of the Photoshop DOM.
21
+ *
22
+ * From here you can access open documents, tools, UI elements and run commands or menu items.
23
+ *
24
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/}
25
+ *
26
+ * @example
27
+ * ```js
28
+ * const {app} = require('photoshop');
29
+ * ```
30
+ */
31
+ export class Photoshop {
32
+ /**
33
+ * @ignore
34
+ */
35
+ constructor();
36
+ currentDialogMode: Constants.DialogModes;
37
+ /**
38
+ * Allows for polyfills into the Document class
39
+ */
40
+ Document: Document;
41
+ /**
42
+ * Allows for polyfills into the Layer class
43
+ */
44
+ Layer: Layer;
45
+ /**
46
+ * Allows for polyfills into the Action Set class
47
+ */
48
+ ActionSet: ActionSet;
49
+ /**
50
+ * Allows for polyfills into the Action class
51
+ */
52
+ Action: Action;
53
+ /**
54
+ * Allows for polyfills into the Guide class
55
+ */
56
+ Guide: Guide;
57
+ /**
58
+ * Allows for polyfills into the Application object
59
+ */
60
+ Photoshop: Photoshop;
61
+ /**
62
+ * Allows for polyfills into the LayerComp class
63
+ */
64
+ LayerComp: LayerComp;
65
+ /**
66
+ * Allows for polyfills into the Selection class
67
+ */
68
+ Selection: Selection;
69
+
70
+ PathPointInfo: PathPointInfo;
71
+
72
+ SubPathInfo: SubPathInfo;
73
+
74
+ ColorSampler: ColorSampler;
75
+ /**
76
+ * The class name of the referenced object: *"Photoshop"*.
77
+ * @minVersion 23.0
78
+ */
79
+ get typename(): 'Photoshop';
80
+ /**
81
+ * Disabled validation checks, use at your own risk!
82
+ */
83
+ set validation(enable: boolean);
84
+ /**
85
+ * Exposes SolidColor class for constructing objects
86
+ */
87
+ SolidColor: typeof SolidColor;
88
+ /**
89
+ * Contains Photoshop preferences grouped into several categories similar to the Preferences dialog.
90
+ * @minVersion 24.0
91
+ */
92
+ get preferences(): Preferences;
93
+ /**
94
+ * The dialog mode for the application, which controls what types of
95
+ * dialogs should be displayed when your code is interacting with Photoshop.
96
+ * @minVersion 23.0
97
+ */
98
+ get displayDialogs(): Constants.DialogModes;
99
+ set displayDialogs(mode: Constants.DialogModes);
100
+ /**
101
+ * The current document that has the application's focus.
102
+ *
103
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#activedocument}
104
+ * @minVersion 23.0
105
+ */
106
+ get activeDocument(): Document;
107
+ /**
108
+ * Set the current active document to the provided Document.
109
+ *
110
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#activedocument}
111
+ * @minVersion 23.0
112
+ */
113
+ set activeDocument(doc: Document);
114
+ /**
115
+ * List of installed color profiles, for RGB and Gray modes.
116
+ * @param colorMode Specify which color mode's profiles to list. (default: "RGB", options: "Gray")
117
+ * @minVersion 24.1
118
+ */
119
+ getColorProfiles: (colorMode?: string) => string[];
120
+ /**
121
+ * Current selected tool. For now, the Tool class is an object with
122
+ * only an `id` field. In the future, we aim to provide tools with their own classes.
123
+ * @minVersion 23.0
124
+ */
125
+ get currentTool(): Tool;
126
+ /**
127
+ * Returns the action tree shown in Actions panel, as an array of ActionSets, each containing Actions.
128
+ *
129
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#actiontree}
130
+ * @minVersion 23.0
131
+ */
132
+ get actionTree(): ActionSet[];
133
+ /**
134
+ * A list of the documents currently open.
135
+ *
136
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#documents}
137
+ * @minVersion 23.0
138
+ */
139
+ get documents(): Documents;
140
+ /**
141
+ * The foreground color (used to paint, fill, and stroke selections). [(24.2)](/ps_reference/changelog#other-fixes)
142
+ *
143
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#foregroundcolor}
144
+ * @minVersion 23.0
145
+ */
146
+ get foregroundColor(): SolidColor;
147
+ set foregroundColor(color: SolidColor);
148
+ /**
149
+ * Convert the given value from one unit to another. Available units are:
150
+ * Constants.Units.{CM, MM, INCHES, PIXELS, POINTS, PICAS}.
151
+ * Use {@link Document.resolution} when converting from or to PIXELS.
152
+ * For example, use this routine for converting a document's width from pixels to inches.
153
+ *
154
+ * ```javascript
155
+ * // convert the current document's width to inches
156
+ * const exportDoc = psApp.activeDocument;
157
+ * let widthInInches = psApp.convertUnits(exportDoc.width,
158
+ * Constants.Units.PIXELS,
159
+ * Constant.Units.INCHES,
160
+ * exportDoc.resolution);
161
+ *
162
+ * ```
163
+ * @param fromValue The value that is to be converted.
164
+ * @param fromUnits The unit that the fromValue is in. Use {@link Constants.Units} for valid values.
165
+ * @param toUnits The unit that the return value is in. Use {@link Constants.Units} for valid values.
166
+ * @param resolution The pixels per inch value to use when converting to and from pixel values.
167
+ * @minVersion 23.4
168
+ */
169
+ convertUnits: (fromValue: number, fromUnits: Constants.Units, toUnits: Constants.Units, resolution?: number) => number;
170
+ /**
171
+ * The background color and color style for documents. [(24.2)](/ps_reference/changelog#other-fixes)
172
+ *
173
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#backgroundcolor}
174
+ * @minVersion 23.0
175
+ */
176
+ get backgroundColor(): SolidColor;
177
+ set backgroundColor(color: SolidColor);
178
+ /**
179
+ * The fonts installed on this system.
180
+ *
181
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#fonts}
182
+ * @minVersion 23.0
183
+ */
184
+ get fonts(): TextFonts;
185
+ /**
186
+ * Shows an alert in Photoshop with the given message.
187
+ *
188
+ * @param message The message to display in the alert.
189
+ *
190
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#showalert}
191
+ * @minVersion 23.0
192
+ */
193
+ showAlert: (message: string) => Promise<void>;
194
+ /**
195
+ * At the heart of all our APIs is batchPlay. It is the evolution of executeAction. It accepts
196
+ * ActionDescriptors deserialized from JS objects, and can play multiple descriptors sequentially
197
+ * without updating the UI. This API is subject to change and may be accessible in other ways in the future.
198
+ *
199
+ * @param commands Array of action descriptors to execute.
200
+ * @param options Options for batchPlay execution.
201
+ *
202
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#batchplay}
203
+ * @minVersion 23.0
204
+ */
205
+ batchPlay: (commands: any, options: any) => Promise<Array<import('./CoreModules').ActionDescriptor>>;
206
+ /**
207
+ * Brings application to focus, useful when your script ends, or requires an input.
208
+ *
209
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#bringtofront}
210
+ * @minVersion 23.0
211
+ */
212
+ bringToFront: () => void;
213
+ /**
214
+ * Opens the specified document and returns the model.
215
+ *
216
+ * Note that this API requires a UXPFileEntry object as its argument.
217
+ *
218
+ * @param entry File entry to open, or undefined to show the open dialog.
219
+ *
220
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#open}
221
+ *
222
+ * @example
223
+ * ```js
224
+ * // Open a file given entry
225
+ * let entry = await require('uxp').storage.localFileSystem.getFileForOpening()
226
+ * const document = await app.open(entry);
227
+ * ```
228
+ *
229
+ * @example
230
+ * ```js
231
+ * // Show open file dialog
232
+ * const document = await app.open();
233
+ * ```
234
+ *
235
+ * @async
236
+ * @minVersion 23.0
237
+ */
238
+ open: (entry?: File) => Promise<Document>;
239
+ /**
240
+ * Create a new document.
241
+ *
242
+ * No options will create a document of 7 x 5 inches at 300 pixels per inch.
243
+ * This is the same as the "Default Photoshop Size" preset.
244
+ *
245
+ * An object with a 'preset' string parameter can be used to specify any of
246
+ * the other presets that come installed with Photoshop or created by users.
247
+ *
248
+ * An object with one or more parameters can also be supplied. Any parameter
249
+ * missing will be set to the default of: width 2100 pixels, height 1500 pixels,
250
+ * resolution 300 pixels per inch, mode: RGB, and a fill of white with
251
+ * no transparency.
252
+ *
253
+ * Updates: [(26.9)](https://developer.adobe.com/photoshop/uxp/2022/ps_reference/changelog/#photoshop-269-july-2025)
254
+ *
255
+ * @param options An object literal containing the option values.
256
+ *
257
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#createdocument}
258
+ *
259
+ * @example
260
+ * ```js
261
+ * // "Default Photoshop Size" 7x5 inches at 300ppi
262
+ * let defaultDoc = await app.createDocument({
263
+ * preset: "Default Photoshop Size"
264
+ * });
265
+ * ```
266
+ *
267
+ * @example
268
+ * ```js
269
+ * let transparentDoc = await app.createDocument({
270
+ * width: 800, height: 600, resolution: 300, mode: "RGBColorMode", fill: "transparent"
271
+ * });
272
+ * ```
273
+ *
274
+ * @example
275
+ * ```js
276
+ * const redColor = new SolidColor();
277
+ * redColor.rgb.green = 0;
278
+ * redColor.rgb.blue = 0;
279
+ * let fillColorDoc = await app.createDocument({
280
+ * mode: "RGBColorMode", fillColor: redColor
281
+ * });
282
+ * ```
283
+ *
284
+ * @async
285
+ * @minVersion 23.0
286
+ */
287
+ createDocument: (options?: DocumentCreateOptions) => Promise<Document | null>;
288
+ /**
289
+ * Force an update to the following panels: Layers, Channels, and Paths.
290
+ *
291
+ * The primary use case is within the handler function of a slider control.
292
+ * Normally, the panels will not update until after the handle is released.
293
+ *
294
+ * Note: this function will have no apparent effect outside of a tracking context like a slider handle.
295
+ * Inside a plain loop (encapsulated in `executeAsModal`),
296
+ * a slight pause can be used to demonstrate the need to refresh.
297
+ *
298
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/photoshop/#updateui}
299
+ *
300
+ * @example
301
+ * ```js
302
+ * // Inside slider handler function.
303
+ * await app.activeDocument.createPixelLayer();
304
+ * await app.updateUI();
305
+ * ```
306
+ *
307
+ * @async
308
+ * @minVersion 26.0
309
+ */
310
+ updateUI: () => Promise<void>;
311
+ }
312
+
313
+ /**
314
+ * Root of the DOM, the `app` object where you can access application settings,
315
+ * open documents and reach rest of the APIs
316
+ */
317
+ export const app: Photoshop;