@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,9 @@
1
+ import * as uxpToolkit from '@bubblydoo/uxp-toolkit';
2
+ import * as uxpToolkitCommands from '@bubblydoo/uxp-toolkit/commands';
3
+
4
+ declare const _default: {
5
+ uxpToolkit: typeof uxpToolkit;
6
+ uxpToolkitCommands: typeof uxpToolkitCommands;
7
+ };
8
+
9
+ export { _default as default };
@@ -0,0 +1,16 @@
1
+ import { constants } from './internal/dom/Constants';
2
+ import { action, core } from './internal/dom/CoreModules';
3
+ import { imaging } from './internal/dom/ImagingModule';
4
+ import { app } from './internal/dom/Photoshop';
5
+
6
+ export type * from './internal/all-types';
7
+ export { action, app, constants, core, imaging };
8
+
9
+ const _default: {
10
+ app: typeof app;
11
+ core: typeof core;
12
+ action: typeof action;
13
+ constants: typeof constants;
14
+ imaging: typeof imaging;
15
+ };
16
+ export default _default;
@@ -0,0 +1,65 @@
1
+ export type * from './dom/Actions';
2
+ export type * from './dom/Channel';
3
+ export type * from './dom/collections/Channels';
4
+ export type * from './dom/collections/ColorSamplers';
5
+ export type * from './dom/collections/CountItems';
6
+ export type * from './dom/collections/Documents';
7
+ export type * from './dom/collections/Guides';
8
+ export type * from './dom/collections/HistoryStates';
9
+ export type * from './dom/collections/LayerComps';
10
+ export type * from './dom/collections/Layers';
11
+ export type * from './dom/collections/PathItems';
12
+ export type * from './dom/collections/PathPoints';
13
+ export type * from './dom/collections/SubPathItems';
14
+ export type * from './dom/collections/TextFonts';
15
+ export type * from './dom/ColorSampler';
16
+ export type * from './dom/Constants';
17
+ export type * from './dom/CoreModules';
18
+ export type * from './dom/CountItem';
19
+ export type * from './dom/Document';
20
+ export type * from './dom/Guide';
21
+ export type * from './dom/HistoryState';
22
+ export type * from './dom/ImagingModule';
23
+ export type * from './dom/Layer';
24
+ export type * from './dom/LayerComp';
25
+ export type * from './dom/Objects';
26
+ export type * from './dom/objects/Colors';
27
+ export type * from './dom/objects/ConversionOptions';
28
+ export type * from './dom/objects/ImagingBounds';
29
+ export type * from './dom/objects/PathPointInfo';
30
+ export type * from './dom/objects/SaveOptions';
31
+ export type * from './dom/objects/SolidColor';
32
+ export type * from './dom/objects/SubPathInfo';
33
+ export type * from './dom/objects/TextFont';
34
+ export type * from './dom/objects/Tool';
35
+ export type * from './dom/PathItem';
36
+ export type * from './dom/PathPoint';
37
+ export type * from './dom/Photoshop';
38
+ export type * from './dom/preferences/Preferences';
39
+ export type * from './dom/preferences/PreferencesBase';
40
+ export type * from './dom/preferences/PreferencesCursors';
41
+ export type * from './dom/preferences/PreferencesFileHandling';
42
+ export type * from './dom/preferences/PreferencesGeneral';
43
+ export type * from './dom/preferences/PreferencesGuidesGridsAndSlices';
44
+ export type * from './dom/preferences/PreferencesHistory';
45
+ export type * from './dom/preferences/PreferencesInterface';
46
+ export type * from './dom/preferences/PreferencesPerformance';
47
+ export type * from './dom/preferences/PreferencesTools';
48
+ export type * from './dom/preferences/PreferencesTransparencyAndGamut';
49
+ export type * from './dom/preferences/PreferencesType';
50
+ export type * from './dom/preferences/PreferencesUnitsAndRulers';
51
+ export type * from './dom/Selection';
52
+ export type * from './dom/SubPathItem';
53
+ export type * from './dom/text/CharacterStyle';
54
+ export type * from './dom/text/ParagraphStyle';
55
+ export type * from './dom/text/TextWarpStyle';
56
+ export type * from './dom/TextItem';
57
+ export type * from './dom/types/ApplyImageTypes';
58
+ export type * from './dom/types/CalculationsTypes';
59
+ export type * from './dom/types/DocumentTypes';
60
+ export type * from './dom/types/LayerCompTypes';
61
+ export type * from './dom/types/LayerTypes';
62
+ export type * from './dom/types/SharedTypes';
63
+ export type * from './dom/types/TextTypes';
64
+ export type * from './util/colorTypes';
65
+ export type * from './util/unit';
@@ -0,0 +1,230 @@
1
+ /**
2
+ * Photoshop Actions
3
+ *
4
+ * Handles the content in Actions panel.
5
+ * Actions panel will have a hierarchy of Action Sets that contain a list of Actions
6
+ *
7
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/}
8
+ *
9
+ * @example
10
+ * ```js
11
+ * // Play all actions in a set
12
+ * const actionSet = app.actionTree[0]; // Get first action set
13
+ * await actionSet.play();
14
+ * ```
15
+ *
16
+ * @example
17
+ * ```js
18
+ * // Duplicate an action set
19
+ * const actionSet = app.actionTree[0];
20
+ * const copiedSet = actionSet.duplicate();
21
+ * console.log(copiedSet.name); // Copy of [original name]
22
+ * ```
23
+ */
24
+ export class ActionSet {
25
+ /**
26
+ * The class name of the referenced object: *"ActionSet"*.
27
+ *
28
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#typename}
29
+ * @minVersion 23.0
30
+ */
31
+ get typename(): 'ActionSet';
32
+ /**
33
+ * Zero-based index of this Action Set in the Actions palette
34
+ *
35
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#index}
36
+ * @minVersion 22.1
37
+ */
38
+ get index(): number;
39
+ /**
40
+ * The internal ID of this Action Set
41
+ * Can be used for batchPlay calls, used internally
42
+ *
43
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#id}
44
+ * @minVersion 22.1
45
+ */
46
+ get id(): number;
47
+ /**
48
+ * The name of this Action Set, displayed in the panel
49
+ *
50
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#name}
51
+ * @minVersion 22.1
52
+ */
53
+ get name(): string;
54
+ /**
55
+ * Renames the Action Set
56
+ *
57
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#name}
58
+ * @minVersion 22.1
59
+ */
60
+ set name(name: string);
61
+ /**
62
+ * List of Actions in this Action Set
63
+ *
64
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#actions}
65
+ * @minVersion 22.1
66
+ */
67
+ get actions(): Action[];
68
+ /**
69
+ * @ignore
70
+ */
71
+ constructor(id: any);
72
+ /**
73
+ * Deletes this Action Set from the Actions panel
74
+ *
75
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#delete}
76
+ *
77
+ * @example
78
+ * ```js
79
+ * const actionSet = app.actionTree[0];
80
+ * actionSet.delete(); // Removes from Actions panel
81
+ * ```
82
+ *
83
+ * @minVersion 22.1
84
+ */
85
+ delete(): void;
86
+ /**
87
+ * Creates a copy of this Action Set
88
+ *
89
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#duplicate}
90
+ *
91
+ * @example
92
+ * ```js
93
+ * const actionSet = app.actionTree[0];
94
+ * const copy = actionSet.duplicate();
95
+ * ```
96
+ *
97
+ * @minVersion 22.1
98
+ */
99
+ duplicate(): ActionSet;
100
+ /**
101
+ * Plays all Actions in this set one by one
102
+ *
103
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/actionset/#play}
104
+ *
105
+ * @example
106
+ * ```js
107
+ * const actionSet = app.actionTree[0];
108
+ * await actionSet.play(); // Plays all actions in sequence
109
+ * ```
110
+ *
111
+ * @async
112
+ * @minVersion 22.1
113
+ */
114
+ play(): Promise<void>;
115
+ }
116
+ /**
117
+ * Represents an Action in the Actions palette.
118
+ * Actions are series of commands that can be recorded by user, and can be replayed at a later time
119
+ *
120
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/}
121
+ *
122
+ * @example
123
+ * ```js
124
+ * // Access and play an action
125
+ * const actionSet = app.actionTree[0];
126
+ * const action = actionSet.actions[0];
127
+ * await action.play();
128
+ * ```
129
+ *
130
+ * @example
131
+ * ```js
132
+ * // Rename and duplicate an action
133
+ * const action = app.actionTree[0].actions[0];
134
+ * action.name = "My Custom Action";
135
+ * const copy = action.duplicate();
136
+ * ```
137
+ */
138
+ export class Action {
139
+ /**
140
+ * The class name of the referenced object: *"Action"*.
141
+ *
142
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#typename}
143
+ * @minVersion 23.0
144
+ */
145
+ get typename(): 'Action';
146
+ /**
147
+ * The internal ID of this Action
148
+ * Can be used for batchPlay calls, used internally
149
+ *
150
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#id}
151
+ * @minVersion 22.1
152
+ */
153
+ get id(): number;
154
+ /**
155
+ * Zero-based index of this Action in it's parent Action Set
156
+ *
157
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#index}
158
+ * @minVersion 22.1
159
+ */
160
+ get index(): number;
161
+ /**
162
+ * The name of this Action, displayed in the panel
163
+ * Cannot be changed
164
+ *
165
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#name}
166
+ * @minVersion 22.1
167
+ */
168
+ get name(): string;
169
+ /**
170
+ * Renames the Action Set
171
+ *
172
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#name}
173
+ * @minVersion 22.1
174
+ */
175
+ set name(name: string);
176
+ /**
177
+ * The Action Set this Action belongs to
178
+ *
179
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#parent}
180
+ * @minVersion 22.1
181
+ */
182
+ get parent(): ActionSet;
183
+ /**
184
+ * @ignore
185
+ */
186
+ constructor(id: number);
187
+ /**
188
+ * Deletes this Action from the Actions panel
189
+ *
190
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#delete}
191
+ *
192
+ * @example
193
+ * ```js
194
+ * const action = app.actionTree[0].actions[0];
195
+ * action.delete(); // Removes from Actions panel
196
+ * ```
197
+ *
198
+ * @minVersion 22.1
199
+ */
200
+ delete(): void;
201
+ /**
202
+ * Plays this Action
203
+ *
204
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#play}
205
+ *
206
+ * @example
207
+ * ```js
208
+ * const action = app.actionTree[0].actions[0];
209
+ * await action.play(); // Executes the action
210
+ * ```
211
+ *
212
+ * @async
213
+ * @minVersion 22.1
214
+ */
215
+ play(): Promise<void>;
216
+ /**
217
+ * Creates a copy of this Action, placing it in the same Action Set
218
+ *
219
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/action/#duplicate}
220
+ *
221
+ * @example
222
+ * ```js
223
+ * const action = app.actionTree[0].actions[0];
224
+ * const copy = action.duplicate();
225
+ * ```
226
+ *
227
+ * @minVersion 22.1
228
+ */
229
+ duplicate(): Action;
230
+ }
@@ -0,0 +1,120 @@
1
+ import type * as Constants from './Constants';
2
+ import type { Document } from './Document';
3
+ import type { SolidColor } from './objects/SolidColor';
4
+ /**
5
+ * Represents a channel in a Photoshop document.
6
+ * You can access instances of channels using one of these methods:
7
+ *
8
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/}
9
+ *
10
+ * @example
11
+ * ```javascript
12
+ * // An array of component channels in the document
13
+ * const componentChannels = app.activeDocument.componentChannels
14
+ *
15
+ * // An array of active (selected) channels in the document
16
+ * const activeChannels = app.activeDocument.activeChannels
17
+ *
18
+ * // Reference a document's Red channel
19
+ * const redChannel = app.activeDocument.channels[0]
20
+ * ```
21
+ * @minVersion 23.0
22
+ */
23
+ export abstract class Channel {
24
+ /**
25
+ * The containing document.
26
+ *
27
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#parent}
28
+ * @minVersion 23.0
29
+ */
30
+ get parent(): Document;
31
+ /**
32
+ * The type or kind of the channel.
33
+ *
34
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#kind}
35
+ * @minVersion 23.0
36
+ */
37
+ get kind(): Constants.ChannelType;
38
+ set kind(kind: Constants.ChannelType);
39
+ /**
40
+ * The visibility of the channel.
41
+ *
42
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#visible}
43
+ * @minVersion 23.0
44
+ */
45
+ get visible(): boolean;
46
+ set visible(visible: boolean);
47
+ /**
48
+ * Duplicates the channel to the parent document, or a target document
49
+ * if specified.
50
+ *
51
+ * @param targetDocument if specified, duplicate to a different document target.
52
+ *
53
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#duplicate}
54
+ *
55
+ * @example
56
+ * ```javascript
57
+ * // duplicate the channel
58
+ * await channel.duplicate()
59
+ *
60
+ * // duplicate to a different, compatible document
61
+ * const newDoc = psApp.documents[1]
62
+ * await channel.duplicate(newDoc)
63
+ * ```
64
+ *
65
+ * @async
66
+ * @minVersion 23.0
67
+ */
68
+ duplicate(targetDocument?: Document): Promise<void>;
69
+ /**
70
+ * The name of the channel. For component channels this name can be localized.
71
+ *
72
+ * ***Fixes in Photoshop 24.6***
73
+ * - *For component channel it is no longer converted into lowercase and is same as in UI*
74
+ * - *For component channel it will throw an error if channel no longer exist in document*
75
+ *
76
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#name}
77
+ * @minVersion 23.0
78
+ */
79
+ abstract get name(): string;
80
+ abstract set name(name: string);
81
+ /**
82
+ * A histogram containing the number of pixels at each color
83
+ * intensity level for this channel. The array contains 256
84
+ * members. The target channel must be visible.
85
+ *
86
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#histogram}
87
+ * @minVersion 23.0
88
+ */
89
+ abstract get histogram(): number[];
90
+ /**
91
+ * The color of the channel.
92
+ *
93
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#color}
94
+ * @minVersion 23.0
95
+ */
96
+ abstract get color(): SolidColor;
97
+ abstract set color(color: SolidColor);
98
+ /**
99
+ * The opacity or solidity of the channel.
100
+ *
101
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#opacity}
102
+ * @minVersion 23.0
103
+ */
104
+ abstract get opacity(): number;
105
+ abstract set opacity(opacity: number);
106
+ /**
107
+ * Deletes the channel.
108
+ *
109
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#remove}
110
+ * @minVersion 23.0
111
+ */
112
+ abstract remove(): Promise<void>;
113
+ /**
114
+ * Merges a Spot Color channel into the component channels.
115
+ *
116
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channel/#merge}
117
+ * @minVersion 23.0
118
+ */
119
+ abstract merge(): Promise<void>;
120
+ }
@@ -0,0 +1,105 @@
1
+ import type { Document } from './Document';
2
+ import type { NoColor } from './objects/Colors';
3
+ import type { SolidColor } from './objects/SolidColor';
4
+ /**
5
+ * Represents a ColorSampler object in the Photoshop DOM.
6
+ *
7
+ * ColorSamplers are created through the {@link ColorSamplers} collection via the {@link ColorSamplers.add} method:
8
+ *
9
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsampler/}
10
+ *
11
+ * @example
12
+ * ```javascript
13
+ * const app = require("photoshop").app;
14
+ * app.activeDocument.colorSamplers.add({x: 100, y: 100});
15
+ * ```
16
+ *
17
+ * Properties such as `color`, `position` and `parent` document can be then accessed on the ColorSampler instance:
18
+ *
19
+ * ```javascript
20
+ * let cs = app.activeDocument.colorSamplers[0];
21
+ * console.log(cs.position); // {x: 100, y: 100}
22
+ * console.log(cs.color.rgb); // SolidColor {red: 0, green: 255, blue: 0}
23
+ * console.log(cs.parent); // Document
24
+ * ```
25
+ *
26
+ * An existing ColorSampler instance can be moved to a different position:
27
+ *
28
+ * ```javascript
29
+ * cs.move({x: 200, y: 200});
30
+ * console.log(cs.position); // {x: 200, y: 200}
31
+ * ```
32
+ *
33
+ * Or removed altogether from the document:
34
+ *
35
+ * ```javascript
36
+ * cs.remove();
37
+ * console.log(app.activeDocument.colorSamplers.length); // 0
38
+ * ```
39
+ */
40
+ export class ColorSampler {
41
+ /**
42
+ * @ignore
43
+ */
44
+ constructor(docId: number, index: number, position: {
45
+ x: number;
46
+ y: number;
47
+ }, color: SolidColor | NoColor);
48
+ /**
49
+ * The class name of the referenced object: *"ColorSampler"*.
50
+ *
51
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsampler/#typename}
52
+ * @minVersion 24.0
53
+ */
54
+ get typename(): 'ColorSampler';
55
+ /**
56
+ * The ID of the Document of this ColorSampler.
57
+ *
58
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsampler/#docid}
59
+ * @minVersion 24.0
60
+ */
61
+ get docId(): number;
62
+ /**
63
+ * Owner document of this ColorSampler.
64
+ *
65
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsampler/#parent}
66
+ * @minVersion 24.0
67
+ */
68
+ get parent(): Document;
69
+ /**
70
+ * The position of this ColorSampler.
71
+ *
72
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsampler/#position}
73
+ * @minVersion 24.0
74
+ */
75
+ get position(): {
76
+ x: number;
77
+ y: number;
78
+ };
79
+ /**
80
+ * The color reading of this ColorSampler in its current position.
81
+ *
82
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsampler/#color}
83
+ * @minVersion 24.0
84
+ * @returns a {@link SolidColor} instance.
85
+ */
86
+ get color(): SolidColor | NoColor;
87
+ /**
88
+ * Deletes the given ColorSampler object.
89
+ *
90
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsampler/#remove}
91
+ * @minVersion 24.0
92
+ */
93
+ remove(): void;
94
+ /**
95
+ * Moves the ColorSampler object to the given position
96
+ *
97
+ * @param position Object literal with target coordinates in pixels `{x: number, y: number}`.
98
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsampler/#move}
99
+ * @minVersion 24.0
100
+ */
101
+ move(position: {
102
+ x: number;
103
+ y: number;
104
+ }): void;
105
+ }