@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,213 @@
1
+ import type * as Constants from './Constants';
2
+ import type { Layer } from './Layer';
3
+ import type { CharacterStyle } from './text/CharacterStyle';
4
+ import type { ParagraphStyle } from './text/ParagraphStyle';
5
+ import type { TextWarpStyle } from './text/TextWarpStyle';
6
+ /**
7
+ * The Class that groups all Type related properties of a Text Layer in Photoshop.
8
+ *
9
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/}
10
+ *
11
+ * @example
12
+ * ```javascript
13
+ * const app = require('photoshop').app;
14
+ * const textItem = app.activeDocument.activeLayers[0].textItem;
15
+ * ```
16
+ *
17
+ * Some properties and methods are available directly in the TextItem instance itself:
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * textItem.contents; // "Lorem Ipsum"
22
+ * textItem.contents = "Hello World";
23
+ * textItem.isPointText; // true
24
+ * await textItem.convertToParagraphText();
25
+ * ```
26
+ *
27
+ * Most properties and methods are grouped for convenience in
28
+ * the {@link characterStyle} and {@link paragraphStyle} properties of {@link TextItem}.
29
+ *
30
+ * ```javascript
31
+ * textItem.characterStyle.size; // 12
32
+ * textItem.characterStyle.size = 24;
33
+ * textItem.paragraphStyle.hyphenation; // true
34
+ * ```
35
+ *
36
+ * Finally, the {@link warpStyle} object contains all the properties related to the
37
+ * Warp effect applied to the text layer.
38
+ *
39
+ * ```javascript
40
+ * textItem.warpStyle.style; // "arcLower"
41
+ * ```
42
+ *
43
+ * Please note that for some properties that are expressed in pixels, the valid range
44
+ * of values might depend on the document's resolution. When this is the case, you'll find
45
+ * that in the documentation "for a 72ppi document" is specified.
46
+ *
47
+ * An example is the font size:
48
+ *
49
+ * ```javascript
50
+ * // Range: 0.01..1296—for a 72ppi document
51
+ * textItem.characterStyle.size = 1000;
52
+ * ```
53
+ *
54
+ * If you want to find the range for documents with a different resolution, please use
55
+ * the following conversion formula:
56
+ *
57
+ * ```javascript
58
+ * newVal = (documentResolution / 72) * referenceVal;
59
+ *
60
+ * // I.e., for a 300ppi document the maximum font size will be:
61
+ * // (300 / 72) * 1296 = 5400px
62
+ * ```
63
+ *
64
+ * Upon setting a value, validation will be performed internally.
65
+ * An invalid value will result in a Range Error.
66
+ *
67
+ * @minVersion 24.1
68
+ */
69
+ export class TextItem {
70
+ /**
71
+ * The parent Layer
72
+ *
73
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#parent}
74
+ * @minVersion 24.1
75
+ */
76
+ get parent(): Layer;
77
+ /**
78
+ * The typename
79
+ *
80
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#typename}
81
+ * @minVersion 24.1
82
+ */
83
+ get typename(): 'TextItem';
84
+ /**
85
+ * The actual text of the Layer.
86
+ *
87
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#contents}
88
+ * @minVersion 24.1
89
+ */
90
+ get contents(): string;
91
+ set contents(text: string);
92
+ /**
93
+ * The text insertion point in the document, as an `{x, y}` object
94
+ * where the coordinates are expressed in pixels.
95
+ *
96
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#textclickpoint}
97
+ * @minVersion 24.1
98
+ */
99
+ get textClickPoint(): {
100
+ x: number;
101
+ y: number;
102
+ };
103
+ set textClickPoint(point: {
104
+ x: number;
105
+ y: number;
106
+ });
107
+ /**
108
+ * The text orientation.
109
+ *
110
+ * @default HORIZONTAL
111
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#orientation}
112
+ * @minVersion 24.1
113
+ */
114
+ get orientation(): Constants.Orientation;
115
+ set orientation(orientation: Constants.Orientation);
116
+ /**
117
+ * True if the Text Layer is a "Point Text": a horizontal or vertical line of text
118
+ * that begins where the user clicks in the image.
119
+ *
120
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#ispointtext}
121
+ * @minVersion 24.1
122
+ */
123
+ get isPointText(): boolean;
124
+ /**
125
+ * True if the Text Layer is a "Paragraph Text": text that uses boundaries
126
+ * to control the flow of characters, either horizontally or vertically.
127
+ *
128
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#isparagraphtext}
129
+ * @minVersion 24.1
130
+ */
131
+ get isParagraphText(): boolean;
132
+ /**
133
+ * Convert a Text Layer from Point Text to Paragraph Text
134
+ *
135
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#converttoparagraphtext}
136
+ *
137
+ * @example
138
+ * ```javascript
139
+ * const textLayer = app.activeDocument.activeLayers[0];
140
+ * if (textLayer.textItem.isPointText) {
141
+ * await textLayer.textItem.convertToParagraphText();
142
+ * }
143
+ * ```
144
+ *
145
+ * @minVersion 24.1
146
+ */
147
+ convertToParagraphText(): Promise<TextItem>;
148
+ /**
149
+ * Convert a Text Layer from Paragraph Text to Point Text
150
+ *
151
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#converttopointtext}
152
+ *
153
+ * @example
154
+ * ```javascript
155
+ * const textLayer = app.activeDocument.activeLayers[0];
156
+ * if (textLayer.textItem.isParagraphText) {
157
+ * await textLayer.textItem.convertToPointText();
158
+ * }
159
+ * ```
160
+ *
161
+ * @minVersion 24.1
162
+ */
163
+ convertToPointText(): Promise<TextItem>;
164
+ /**
165
+ * Convert the Text Layer into a Shape Layer
166
+ *
167
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#converttoshape}
168
+ *
169
+ * @example
170
+ * ```javascript
171
+ * const textLayer = app.activeDocument.activeLayers[0];
172
+ * await textLayer.textItem.convertToShape();
173
+ * ```
174
+ *
175
+ * @minVersion 24.1
176
+ */
177
+ convertToShape(): Promise<void>;
178
+ /**
179
+ * Create a Work Path from the Text Layer
180
+ *
181
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#createworkpath}
182
+ *
183
+ * @example
184
+ * ```javascript
185
+ * const textLayer = app.activeDocument.activeLayers[0];
186
+ * await textLayer.textItem.createWorkPath();
187
+ * ```
188
+ *
189
+ * @minVersion 24.1
190
+ */
191
+ createWorkPath(): Promise<void>;
192
+ /**
193
+ * The object that stores properties related to the Character panel in the Photoshop UI.
194
+ *
195
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#characterstyle}
196
+ * @minVersion 24.1
197
+ */
198
+ characterStyle: CharacterStyle;
199
+ /**
200
+ * The object that stores properties related to the Paragraph panel in the Photoshop UI.
201
+ *
202
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#paragraphstyle}
203
+ * @minVersion 24.1
204
+ */
205
+ paragraphStyle: ParagraphStyle;
206
+ /**
207
+ * The object that stores properties related to the Warp Text dialog.
208
+ *
209
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/textitem/#warpstyle}
210
+ * @minVersion 24.1
211
+ */
212
+ warpStyle: TextWarpStyle;
213
+ }
@@ -0,0 +1,81 @@
1
+ import type { Channel } from '../Channel';
2
+ import type { Document } from '../Document';
3
+
4
+ /**
5
+ * A collections class allowing for array access into a document's channels,
6
+ * while also providing familiar methods from ExtendScript, like `getByName`
7
+ *
8
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channels/}
9
+ *
10
+ * @example
11
+ * ```javascript
12
+ * // Iterate through all channels in the document
13
+ * app.activeDocument.channels.forEach(h => console.log(h.name));
14
+ * ```
15
+ *
16
+ * ***Fixes in Photoshop 24.6***
17
+ * - *Component channels should work now correctly in non-English localizations*
18
+ * - *Channel should be now returned correctly in Bitmap and Indexed Color modes*
19
+ * @minVersion 23.0
20
+ */
21
+ export class Channels extends Array<Channel> {
22
+ /** @ignore */
23
+ readonly _docId: number;
24
+ /** @ignore */
25
+ private proxy;
26
+ /**
27
+ * Used to access the channels in the collection
28
+ */
29
+ [index: number]: Channel;
30
+ /** @ignore */
31
+ constructor(docId: number);
32
+ /** @ignore */
33
+ handler(): {
34
+ get: (obj: Channels, key: string | symbol) => any;
35
+ };
36
+ /**
37
+ * Create a new alpha channel in this document.
38
+ *
39
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channels/#add}
40
+ * @minVersion 23.0
41
+ */
42
+ add(): Channel;
43
+ /**
44
+ * Find the first channel with the matching name.
45
+ *
46
+ * ***Fixes in Photoshop 24.6***
47
+ * - *Non-English locales return correctly for component channels.
48
+ *
49
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channels/#getbyname}
50
+ * @minVersion 23.0
51
+ */
52
+ getByName(name: string): Channel;
53
+ /**
54
+ * Remove all Alpha channels in the parent document.
55
+ *
56
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channels/#removeall}
57
+ * @minVersion 23.0
58
+ */
59
+ removeAll(): void;
60
+ /**
61
+ * Number of Channel elements in this collection.
62
+ *
63
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channels/#length}
64
+ * @minVersion 23.0
65
+ */
66
+ get length(): number;
67
+ /**
68
+ * The owner document of this Channel collection.
69
+ *
70
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channels/#parent}
71
+ * @minVersion 23.0
72
+ */
73
+ get parent(): Document;
74
+ /**
75
+ * The name for this object collection: Channels.
76
+ *
77
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/channels/#typename}
78
+ * @minVersion 23.0
79
+ */
80
+ get typename(): 'Channels';
81
+ }
@@ -0,0 +1,97 @@
1
+ import type { ColorSampler } from '../ColorSampler';
2
+ /**
3
+ * A collections class allowing for array access into a document's ColorSamplers
4
+ *
5
+ * Access this collection through the {@link Document.colorSamplers} property. For instance,
6
+ * the following adds a new colorSampler to the collection:
7
+ *
8
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/colorsamplers/}
9
+ *
10
+ * @example
11
+ * ```javascript
12
+ * const app = require("photoshop").app;
13
+ * app.activeDocument.colorSamplers.add({x: 20, y: 20});
14
+ * ```
15
+ *
16
+ * A colorSampler can be access through the collection's `[index]` property,
17
+ * and then queried for its properties.
18
+ * For example, the following gets the first colorSampler in the collection, and then
19
+ * unpacks its `color` and `position` properties via a destructuring assignment to get
20
+ * the sampled color as a {@link SolidColor} object and its current position as an `{x, y}` object:
21
+ *
22
+ * @example
23
+ * ```javascript
24
+ * const cs = app.activeDocument.colorSamplers[0];
25
+ * const { color, position } = cs; // destructuring assignment
26
+ * console.log(color.rgb); // returns a SolidColor object:
27
+ * // {red: 0, green: 255, blue: 0, model: ColorModel.RGB}
28
+ * console.log(position); // returns an object: {x: 20, y: 20}
29
+ *
30
+ * ```
31
+ *
32
+ * To empty the colorSamplers collection, use the `removeAll()` method.
33
+ *
34
+ * ```javascript
35
+ * app.activeDocument.colorSamplers.removeAll();
36
+ * app.activeDocument.colorSamplers.length; // returns 0
37
+ * ```
38
+ *
39
+ * @minVersion 24.0
40
+ */
41
+ export class ColorSamplers extends Array<ColorSampler> {
42
+ /**
43
+ * @ignore
44
+ */
45
+ private readonly _docId;
46
+ /**
47
+ * @ignore
48
+ */
49
+ private proxy;
50
+ /**
51
+ * @ignore
52
+ */
53
+ constructor(docId: number);
54
+ /**
55
+ * @ignore
56
+ */
57
+ handler(): {
58
+ get: (obj: any, key: any) => any;
59
+ };
60
+ /**
61
+ * Number of {@link ColorSampler} elements in this collection.
62
+ * ```javascript
63
+ * // A new document starts with no colorSamplers
64
+ * app.activeDocument.colorSamplers.length; // returns 0
65
+ * ```
66
+ * @minVersion 24.0
67
+ */
68
+ get length(): number;
69
+ /**
70
+ * The owner {@link Document} of this ColorSamplers collection.
71
+ * @minVersion 24.0
72
+ */
73
+ get parent(): Document;
74
+ /**
75
+ * Adds a {@link ColorSampler} to the collection at the given `{x, y}` coordinates in pixels.
76
+ *
77
+ * ```javascript
78
+ * app.activeDocument.colorSamplers.add({x: 20, y: 20});
79
+ * app.activeDocument.colorSamplers.length; // returns 1
80
+ * ```
81
+ * @minVersion 24.0
82
+ */
83
+ add(position: {
84
+ x: number;
85
+ y: number;
86
+ }): ColorSampler;
87
+ /**
88
+ * Removes all ColorSampler instances from this collection.
89
+ *
90
+ * ```javascript
91
+ * app.activeDocument.colorSamplers.removeAll();
92
+ * app.activeDocument.colorSamplers.length; // returns 0
93
+ * ```
94
+ * @minVersion 24.0
95
+ */
96
+ removeAll(): void;
97
+ }
@@ -0,0 +1,130 @@
1
+ import type { CountItem } from '../CountItem';
2
+ import type { Document } from '../Document';
3
+ import type { SolidColor } from '../objects/SolidColor';
4
+ /**
5
+ * A collections class allowing access to the document's CountItem.
6
+ *
7
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/countitems/}
8
+ */
9
+ export class CountItems extends Array<CountItem> {
10
+ /**
11
+ * @ignore
12
+ */
13
+ private readonly _docId;
14
+ /**
15
+ * @ignore
16
+ */
17
+ private proxy;
18
+ /**
19
+ * @ignore
20
+ * Used to access the CountItems in the collection
21
+ */
22
+ [index: number]: CountItem;
23
+ /**
24
+ * @ignore
25
+ */
26
+ constructor(docId: number);
27
+ /**
28
+ * @ignore
29
+ */
30
+ handler(): {
31
+ get: (obj: any, key: any) => any;
32
+ };
33
+ /**
34
+ * The CountItems collection's typename.
35
+ * @minVersion 24.1
36
+ */
37
+ get typename(): 'CountItems';
38
+ /**
39
+ * Number of {@link CountItem} elements in this collection.
40
+ * @minVersion 24.1
41
+ */
42
+ get length(): number;
43
+ /**
44
+ * The owner {@link Document} of this CountItems collection.
45
+ * @minVersion 24.1
46
+ */
47
+ get parent(): Document;
48
+ /**
49
+ * Adds a new {@link CountItem} to the collection.
50
+ *
51
+ * ```javascript
52
+ * app.activeDocument.countItems.add({x: 20, y: 20});
53
+ * ```
54
+ *
55
+ * @param position: Object with x and y properties.
56
+ * @param position.x: The x coordinate of the new CountItem in pixels.
57
+ * @param position.y: The y coordinate of the new CountItem in pixels.
58
+ * @minVersion 24.1
59
+ */
60
+ add(position: {
61
+ x: number;
62
+ y: number;
63
+ }): CountItem;
64
+ /**
65
+ * Clears all {@link CountItem} objects from this collection.
66
+ *
67
+ * ```javascript
68
+ * app.activeDocument.countItems.removeAllFromActiveGroup();
69
+ * ```
70
+ * @minVersion 24.1
71
+ */
72
+ removeAllFromActiveGroup(): void;
73
+ /**
74
+ * Retrieves all {@link CountItem} objects from this collection.
75
+ *
76
+ * ```javascript
77
+ * app.activeDocument.countItems.getAll();
78
+ * ```
79
+ * @minVersion 24.1
80
+ */
81
+ getAll(): CountItem[];
82
+ /**
83
+ * Creates a new Count Item group.
84
+ * @param groupName: The name of the group to be created.
85
+ * @minVersion 24.1
86
+ */
87
+ createGroup(groupName: string): void;
88
+ /**
89
+ * Renames the currently active Count Item group.
90
+ * @param groupName: The new name of the group.
91
+ * @minVersion 24.1
92
+ */
93
+ renameActiveGroup(groupName: string): void;
94
+ /**
95
+ * Removes a Count Item group by its index.
96
+ * @param index: The index of the group to be removed.
97
+ * @minVersion 24.1
98
+ */
99
+ removeGroupByIndex(index: number): void;
100
+ /**
101
+ * Toggles the visibility of the currently selected Count Item group.
102
+ * @param isVisible: Whether the group should be visible or not.
103
+ * @minVersion 24.1
104
+ */
105
+ toggleActiveGroupVisibility(isVisible: boolean): void;
106
+ /**
107
+ * Activates a Count Item group by its index.
108
+ * @param index: The index of the group to be activated.
109
+ * @minVersion 24.1
110
+ */
111
+ activateGroupByIndex(index: number): void;
112
+ /**
113
+ * Sets the Count Item marker (the dot) size.
114
+ * @param size: The marker size @range 1..10 @default 2
115
+ * @minVersion 24.1
116
+ */
117
+ setActiveMarkerSize(size: number): void;
118
+ /**
119
+ * Sets the Count Item label (the number) size.
120
+ * @param size: The marker size @range 8..72 @default 8
121
+ * @minVersion 24.1
122
+ */
123
+ setActiveLabelSize(size: number): void;
124
+ /**
125
+ * Sets the Color of the Count Item marker and label.
126
+ * @param color: The color as a {@link SolidColor} object.
127
+ * @minVersion 24.1
128
+ */
129
+ setActiveColor(color: SolidColor): void;
130
+ }
@@ -0,0 +1,95 @@
1
+ import type { Document } from '../Document';
2
+ import type { Photoshop } from '../Photoshop';
3
+ import type { DocumentCreateOptions } from '../types/DocumentTypes';
4
+ /**
5
+ * A collections class allowing for array access into the application's
6
+ * list of documents that are currently open,
7
+ * while also providing familiar methods from ExtendScript, like `getByName`.
8
+ *
9
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/documents/}
10
+ *
11
+ * @example
12
+ * ```javascript
13
+ * // Iterate through all the documents
14
+ * app.documents.forEach(h => console.log(h.title));
15
+ * ```
16
+ */
17
+ export class Documents extends Array<Document> {
18
+ /** @ignore */
19
+ private proxy;
20
+ /** @ignore */
21
+ constructor();
22
+ /**
23
+ * Used to access the documents in the collection.
24
+ * @minVersion 22.5
25
+ */
26
+ [index: number]: Document;
27
+ /** @ignore */
28
+ handler(): {
29
+ get: (obj: any, key: any) => any;
30
+ };
31
+ /**
32
+ * Find the first document with the matching name.
33
+ *
34
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/documents/#getbyname}
35
+ * @minVersion 22.5
36
+ */
37
+ getByName(name: string): Document;
38
+ /**
39
+ * Number of {@link Document} elements in this collection.
40
+ *
41
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/documents/#length}
42
+ * @minVersion 22.5
43
+ */
44
+ get length(): number;
45
+ /**
46
+ * The owner application of this Documents collection.
47
+ *
48
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/documents/#parent}
49
+ * @minVersion 22.5
50
+ */
51
+ get parent(): Photoshop;
52
+ /**
53
+ * The name for this object collection: Documents.
54
+ *
55
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/documents/#typename}
56
+ * @minVersion 22.5
57
+ */
58
+ get typename(): 'Documents';
59
+ /**
60
+ * Create a new document.
61
+ *
62
+ * No options will create a document of 7 x 5 inches at 300 pixels per inch.
63
+ * This is the same as the "Default Photoshop Size" preset.
64
+ *
65
+ * An object with a 'preset' string parameter can be used to specify any of
66
+ * the other presets that come installed with Photoshop or created by users.
67
+ *
68
+ * An object with one or more parameters can also be supplied. Any parameter
69
+ * missing will be set to the default of: width 2100 pixels, height 1500 pixels,
70
+ * resolution 300 pixels per inch, mode: @RGBColorMode and a fill of white with
71
+ * no transparency.
72
+ *
73
+ * @param options @DocumentCreateOptions
74
+ *
75
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/documents/#add}
76
+ *
77
+ * @example
78
+ * ```javascript
79
+ * // "Default Photoshop Size" 7x5 inches at 300ppi
80
+ * let newDoc1 = await app.documents.add();
81
+ * let newDoc2 = await app.documents.add({
82
+ * width: 800,
83
+ * height: 600,
84
+ * resolution: 300,
85
+ * mode: "RGBColorMode",
86
+ * fill: "transparent"
87
+ * });
88
+ * let newDoc3 = await app.documents.add({preset: "My Default Size 1"});
89
+ * ```
90
+ *
91
+ * @async
92
+ * @minVersion 22.5
93
+ */
94
+ add(options?: DocumentCreateOptions): Promise<Document | null>;
95
+ }
@@ -0,0 +1,76 @@
1
+ import type * as Constants from '../Constants';
2
+ import type { Document } from '../Document';
3
+ import type { Guide } from '../Guide';
4
+ /**
5
+ * A collections class allowing for array access into a document's guides
6
+ *
7
+ * Access this collection through {@link Document.guides} property. For example,
8
+ * following adds a new guide to the collection:
9
+ *
10
+ * @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/guides/}
11
+ *
12
+ * @example
13
+ * ```javascript
14
+ * app.activeDocument.guides.add(Constants.Direction.HORIZONTAL, 20);
15
+ * ```
16
+ */
17
+ export class Guides extends Array<Guide> {
18
+ /**
19
+ * @ignore
20
+ */
21
+ readonly _docId: number;
22
+ /**
23
+ * @ignore
24
+ */
25
+ private proxy;
26
+ /**
27
+ * Used to access the guides in the collection.
28
+ * @minVersion 23.0
29
+ */
30
+ [index: number]: Guide;
31
+ /**
32
+ * @ignore
33
+ */
34
+ constructor(docId: number);
35
+ /**
36
+ * @ignore
37
+ */
38
+ handler(): {
39
+ get: (obj: any, key: any) => any;
40
+ };
41
+ /**
42
+ * Number of {@link Guide} elements in this collection.
43
+ * @minVersion 23.0
44
+ */
45
+ get length(): number;
46
+ /**
47
+ * The owner document of this Guide collection.
48
+ * @minVersion 23.0
49
+ */
50
+ get parent(): Document;
51
+ /**
52
+ * Ruler origin defines where coordinates [0,0] are located.
53
+ * Point coordinates are calculated from left top corner of the canvas.
54
+ * @ignore
55
+ */
56
+ /**
57
+ * Adds a guide for the collection at the given coordinate and direction
58
+ *
59
+ * ***Fixes in Photoshop 24.0:***
60
+ * - *Correct coordinate when resolution is not 72 PPI*
61
+ * - *Returns valid instance of guide*
62
+ *
63
+ * @param direction Indicates whether the guide is vertical or horizontal
64
+ * @param coordinate Position of the guide measured from the ruler origin in pixels.
65
+ * The value can be a decimal.
66
+ *
67
+ * Note: the user can move the ruler origin which will affect the position value of the guides.
68
+ * @minVersion 23.0
69
+ */
70
+ add(direction: Constants.Direction, coordinate: number): Guide;
71
+ /**
72
+ * Clears all guides from this collection.
73
+ * @minVersion 23.0
74
+ */
75
+ removeAll(): void;
76
+ }