@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
package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ConversionOptions.d.ts
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type * as Constants from '../Constants';
|
|
2
|
+
/**
|
|
3
|
+
* Options for converting an image to bitmap mode, using {@link Document.changeMode} with `ChangeMode.BITMAP`.
|
|
4
|
+
*
|
|
5
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/document/#changemode}
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```javascript
|
|
9
|
+
* const doc = app.activeDocument;
|
|
10
|
+
* const options = new BitmapConversionOptions();
|
|
11
|
+
* options.method = constants.BitmapConversionType.DIFFUSIONDITHER;
|
|
12
|
+
* options.resolution = 72;
|
|
13
|
+
* await doc.changeMode(constants.ChangeMode.BITMAP, options);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```javascript
|
|
18
|
+
* // Convert with halftone screen
|
|
19
|
+
* const options = new BitmapConversionOptions();
|
|
20
|
+
* options.method = constants.BitmapConversionType.HALFTONESCREEN;
|
|
21
|
+
* options.frequency = 60;
|
|
22
|
+
* options.angle = 45;
|
|
23
|
+
* options.shape = constants.BitmapHalfToneType.ROUND;
|
|
24
|
+
* await doc.changeMode(constants.ChangeMode.BITMAP, options);
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @targetfolder objects/conversionoptions
|
|
28
|
+
* @optionobject
|
|
29
|
+
*/
|
|
30
|
+
export class BitmapConversionOptions {
|
|
31
|
+
private _angle;
|
|
32
|
+
private _frequency;
|
|
33
|
+
private _method;
|
|
34
|
+
private _patternName;
|
|
35
|
+
private _resolution;
|
|
36
|
+
private _shape;
|
|
37
|
+
/**
|
|
38
|
+
* The angle (in degrees) at which to orient individual dots. See shape property below.
|
|
39
|
+
* Valid only when the method property is set to `BitmapConversionType.HALFTONESCREEN`.
|
|
40
|
+
*
|
|
41
|
+
* @default -
|
|
42
|
+
* @range -180...180
|
|
43
|
+
* @minVersion 23.0
|
|
44
|
+
*/
|
|
45
|
+
get angle(): number;
|
|
46
|
+
set angle(value: number);
|
|
47
|
+
/**
|
|
48
|
+
* The number of dots (per inch) to use.
|
|
49
|
+
* Valid only when the method property is set to `BitmapConversionType.HALFTONESCREEN`.
|
|
50
|
+
*
|
|
51
|
+
* @default -
|
|
52
|
+
* @range 1.0..999.99
|
|
53
|
+
* @minVersion 23.0
|
|
54
|
+
*/
|
|
55
|
+
get frequency(): number;
|
|
56
|
+
set frequency(value: number);
|
|
57
|
+
/**
|
|
58
|
+
* The conversion method.
|
|
59
|
+
*
|
|
60
|
+
* @default DIFFUSIONDITHER
|
|
61
|
+
* @range -
|
|
62
|
+
* @minVersion 23.0
|
|
63
|
+
*/
|
|
64
|
+
get method(): Constants.BitmapConversionType;
|
|
65
|
+
set method(value: Constants.BitmapConversionType);
|
|
66
|
+
/**
|
|
67
|
+
* The name of the pattern to use.
|
|
68
|
+
* Valid only when the method property is set to BitmapConversionType.CUSTOMPATTERN.
|
|
69
|
+
*
|
|
70
|
+
* @default
|
|
71
|
+
* @range -
|
|
72
|
+
* @minVersion 23.0
|
|
73
|
+
*/
|
|
74
|
+
get patternName(): string;
|
|
75
|
+
set patternName(value: string);
|
|
76
|
+
/**
|
|
77
|
+
* The output resolution (in pixels per inch).
|
|
78
|
+
*
|
|
79
|
+
* @default 72
|
|
80
|
+
* @range -
|
|
81
|
+
* @minVersion 23.0
|
|
82
|
+
*/
|
|
83
|
+
get resolution(): number;
|
|
84
|
+
set resolution(value: number);
|
|
85
|
+
/**
|
|
86
|
+
* The dot shape.
|
|
87
|
+
* Valid only when the method property is set to BitmapConversionType.HALFTONESCREEN.
|
|
88
|
+
*
|
|
89
|
+
* @default -
|
|
90
|
+
* @range -
|
|
91
|
+
* @minVersion 23.0
|
|
92
|
+
*/
|
|
93
|
+
get shape(): Constants.BitmapHalfToneType;
|
|
94
|
+
set shape(value: Constants.BitmapHalfToneType);
|
|
95
|
+
/**
|
|
96
|
+
* The class name of the referenced object: *"BitmapConversionOptions"*.
|
|
97
|
+
* @minVersion 23.0
|
|
98
|
+
*/
|
|
99
|
+
get typename(): 'BitmapConversionOptions';
|
|
100
|
+
/** @ignore */
|
|
101
|
+
constructor();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Options for converting an RGB image to an indexed color model using {@link Document.changeMode}
|
|
105
|
+
*
|
|
106
|
+
* @see {@link https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/document/#changemode}
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```javascript
|
|
110
|
+
* const doc = app.activeDocument;
|
|
111
|
+
* const options = new IndexedConversionOptions();
|
|
112
|
+
* options.palette = constants.Palette.LOCALPERCEPTUAL;
|
|
113
|
+
* options.colors = 256;
|
|
114
|
+
* options.dither = constants.Dither.DIFFUSION;
|
|
115
|
+
* options.transparency = true;
|
|
116
|
+
* await doc.changeMode(constants.ChangeMode.INDEXEDCOLOR, options);
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```javascript
|
|
121
|
+
* // Convert with web palette
|
|
122
|
+
* const options = new IndexedConversionOptions();
|
|
123
|
+
* options.palette = constants.Palette.WEBPALETTE;
|
|
124
|
+
* options.colors = 216;
|
|
125
|
+
* options.preserveExactColors = true;
|
|
126
|
+
* await doc.changeMode(constants.ChangeMode.INDEXEDCOLOR, options);
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* @targetfolder objects/conversionoptions
|
|
130
|
+
* @optionobject
|
|
131
|
+
* @minVersion 23.0
|
|
132
|
+
*/
|
|
133
|
+
export class IndexedConversionOptions {
|
|
134
|
+
private _colors;
|
|
135
|
+
private _dither;
|
|
136
|
+
private _ditherAmount;
|
|
137
|
+
private _forced;
|
|
138
|
+
private _matte;
|
|
139
|
+
private _palette;
|
|
140
|
+
private _preserveExactColors;
|
|
141
|
+
private _transparency;
|
|
142
|
+
/**
|
|
143
|
+
* The number of palette colors.
|
|
144
|
+
*
|
|
145
|
+
* Valid only with palette types: LOCALADAPTIVE, LOCALPERCEPTUAL,
|
|
146
|
+
* LOCALSELECTIVE, MACOSPALETTE, UNIFORM, WEBPALETTE, or WINDOWSPALETTE.
|
|
147
|
+
*
|
|
148
|
+
* @minVersion 23.0
|
|
149
|
+
*/
|
|
150
|
+
get colors(): number;
|
|
151
|
+
set colors(value: number);
|
|
152
|
+
/**
|
|
153
|
+
* The type of dithering to be done.
|
|
154
|
+
*
|
|
155
|
+
* @minVersion 23.0
|
|
156
|
+
*/
|
|
157
|
+
get dither(): Constants.Dither;
|
|
158
|
+
set dither(value: Constants.Dither);
|
|
159
|
+
/**
|
|
160
|
+
* The amount of dithering to be done.
|
|
161
|
+
*
|
|
162
|
+
* Valid only when dither typ is DIFFUSION.
|
|
163
|
+
* @minVersion 23.0
|
|
164
|
+
*/
|
|
165
|
+
get ditherAmount(): number;
|
|
166
|
+
set ditherAmount(value: number);
|
|
167
|
+
/**
|
|
168
|
+
* The set of colors to force into the color palette.
|
|
169
|
+
*
|
|
170
|
+
* @minVersion 23.0
|
|
171
|
+
*/
|
|
172
|
+
get forced(): Constants.ForcedColors;
|
|
173
|
+
set forced(value: Constants.ForcedColors);
|
|
174
|
+
/**
|
|
175
|
+
* The color to use to fill anti-aliased edges adjacent to transparent areas of the image.
|
|
176
|
+
*
|
|
177
|
+
* When transparency is false, the matte color is applied to transparent areas.
|
|
178
|
+
*
|
|
179
|
+
* @default WHITE
|
|
180
|
+
* @minVersion 23.0
|
|
181
|
+
*/
|
|
182
|
+
get matte(): Constants.MatteColor;
|
|
183
|
+
set matte(value: Constants.MatteColor);
|
|
184
|
+
/**
|
|
185
|
+
* The palette type.
|
|
186
|
+
*
|
|
187
|
+
* @minVersion 23.0
|
|
188
|
+
*/
|
|
189
|
+
get palette(): Constants.Palette;
|
|
190
|
+
set palette(value: Constants.Palette);
|
|
191
|
+
/**
|
|
192
|
+
* When true, the image colors matching entries in the color table will not be dithered.
|
|
193
|
+
*
|
|
194
|
+
* @minVersion 23.0
|
|
195
|
+
*/
|
|
196
|
+
get preserveExactColors(): boolean;
|
|
197
|
+
set preserveExactColors(value: boolean);
|
|
198
|
+
/**
|
|
199
|
+
* When true, transparent areas of the image are preserved during conversion to GIF format.
|
|
200
|
+
*
|
|
201
|
+
* @minVersion 23.0
|
|
202
|
+
*/
|
|
203
|
+
get transparency(): boolean;
|
|
204
|
+
set transparency(value: boolean);
|
|
205
|
+
/**
|
|
206
|
+
* The class name of the referenced object: *"IndexedConversionOptions"*.
|
|
207
|
+
*
|
|
208
|
+
* @minVersion 23.0
|
|
209
|
+
*/
|
|
210
|
+
get typename(): 'IndexedConversionOptions';
|
|
211
|
+
/** @ignore */
|
|
212
|
+
constructor();
|
|
213
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines a rectangle. This is a WIP.
|
|
3
|
+
*
|
|
4
|
+
* @targetfolder objects
|
|
5
|
+
* @optionobject
|
|
6
|
+
*/
|
|
7
|
+
export class ImagingBounds {
|
|
8
|
+
private _left;
|
|
9
|
+
private _right;
|
|
10
|
+
private _top;
|
|
11
|
+
private _bottom;
|
|
12
|
+
/**
|
|
13
|
+
* Coordinate of the left edge.
|
|
14
|
+
* @minVersion 22.5
|
|
15
|
+
*/
|
|
16
|
+
get left(): number;
|
|
17
|
+
set left(coordinate: number);
|
|
18
|
+
/**
|
|
19
|
+
* Coordinate of the right edge.
|
|
20
|
+
* @minVersion 22.5
|
|
21
|
+
*/
|
|
22
|
+
get right(): number;
|
|
23
|
+
set right(coordinate: number);
|
|
24
|
+
/**
|
|
25
|
+
* Coordinate of the top edge.
|
|
26
|
+
* @minVersion 22.5
|
|
27
|
+
*/
|
|
28
|
+
get top(): number;
|
|
29
|
+
set top(coordinate: number);
|
|
30
|
+
/**
|
|
31
|
+
* Coordinate of the bottom edge.
|
|
32
|
+
* @minVersion 22.5
|
|
33
|
+
*/
|
|
34
|
+
get bottom(): number;
|
|
35
|
+
set bottom(coordinate: number);
|
|
36
|
+
/**
|
|
37
|
+
* Calculated width.
|
|
38
|
+
* @minVersion 22.5
|
|
39
|
+
*/
|
|
40
|
+
get width(): number;
|
|
41
|
+
/**
|
|
42
|
+
* Calculated height.
|
|
43
|
+
* @minVersion 22.5
|
|
44
|
+
*/
|
|
45
|
+
get height(): number;
|
|
46
|
+
/**
|
|
47
|
+
* The class name of the referenced object: *"Bounds"*.
|
|
48
|
+
* @minVersion 22.5
|
|
49
|
+
*/
|
|
50
|
+
get typename(): 'Bounds';
|
|
51
|
+
/** @ignore */
|
|
52
|
+
constructor();
|
|
53
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type * as Constants from '../Constants';
|
|
2
|
+
/**
|
|
3
|
+
* Used to create a {@link PathPoint}, which represents the anchor and control-handle endpoints for a path segment.
|
|
4
|
+
* Each point (the anchor point, left-direction point, and right-direction point) is an array containing X and Y
|
|
5
|
+
* position coordinates.
|
|
6
|
+
*
|
|
7
|
+
* - Use the JavaScript `new` operator to create these objects, and store them in the {@link SubPathInfo.entireSubPath}
|
|
8
|
+
* property before using that object to create a path item with {@link PathItems.add}()
|
|
9
|
+
*
|
|
10
|
+
* - The resulting {@link SubPathItem} object contains the resulting {@link PathPoint} objects. Use the {@link PathPoint} object
|
|
11
|
+
* to retrieve information about the points that describe existing path segments. The properties are read-only.
|
|
12
|
+
*
|
|
13
|
+
* For paths that are straight segments (not curved), the coordinates of all three points are the same. For curved
|
|
14
|
+
* segments, the coordinates are different. The difference between the anchor point and the left or right
|
|
15
|
+
* direction points determines the arc of the curve. Use the left direction point to bend the curve "outward" or
|
|
16
|
+
* make it convex; or use the right direction point to bend the curve "inward" or make it concave.
|
|
17
|
+
*
|
|
18
|
+
* ## PathPointInfo sample script
|
|
19
|
+
*
|
|
20
|
+
* ```typescript
|
|
21
|
+
* function drawLine(doc: Document, start: number[], stop: number[]) {
|
|
22
|
+
* const startPoint = new PathPointInfo();
|
|
23
|
+
* startPoint.anchor = start;
|
|
24
|
+
* startPoint.leftDirection = start;
|
|
25
|
+
* startPoint.rightDirection = start;
|
|
26
|
+
* startPoint.kind = Constants.PointKind.CORNERPOINT;
|
|
27
|
+
*
|
|
28
|
+
* const stopPoint = new PathPointInfo();
|
|
29
|
+
* stopPoint.anchor = stop;
|
|
30
|
+
* stopPoint.leftDirection = stop;
|
|
31
|
+
* stopPoint.rightDirection = stop;
|
|
32
|
+
* stopPoint.kind = Constants.PointKind.CORNERPOINT;
|
|
33
|
+
*
|
|
34
|
+
* const spi = new SubPathInfo();
|
|
35
|
+
* spi.closed = false;
|
|
36
|
+
* spi.operation = Constants.ShapeOperation.SHAPEXOR;
|
|
37
|
+
* spi.entireSubPath = [startPoint, stopPoint];
|
|
38
|
+
*
|
|
39
|
+
* const line = doc.pathItems.add("Line", [spi]);
|
|
40
|
+
* line.strokePath(Constants.ToolType.PENCIL);
|
|
41
|
+
* line.remove();
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* drawLine(app.activeDocument, [100,100], [200,200]);
|
|
45
|
+
* ```
|
|
46
|
+
* @minVersion 23.3
|
|
47
|
+
*/
|
|
48
|
+
export class PathPointInfo {
|
|
49
|
+
private _anchor;
|
|
50
|
+
private _kind;
|
|
51
|
+
private _leftDirection;
|
|
52
|
+
private _rightDirection;
|
|
53
|
+
/**
|
|
54
|
+
* The X and Y coordinates of the anchor point of the curve.
|
|
55
|
+
* @minVersion 23.3
|
|
56
|
+
*/
|
|
57
|
+
get anchor(): number[];
|
|
58
|
+
set anchor(coordinates: number[]);
|
|
59
|
+
/**
|
|
60
|
+
* The role (corner or smooth) this point plays in the containing path segment.
|
|
61
|
+
* @minVersion 23.3
|
|
62
|
+
*/
|
|
63
|
+
get kind(): Constants.PointKind;
|
|
64
|
+
set kind(role: Constants.PointKind);
|
|
65
|
+
/**
|
|
66
|
+
* The location of the left-direction endpoint('in' position).
|
|
67
|
+
* @minVersion 23.3
|
|
68
|
+
*/
|
|
69
|
+
get leftDirection(): number[];
|
|
70
|
+
set leftDirection(location: number[]);
|
|
71
|
+
/**
|
|
72
|
+
* The location of the right-direction endpoint('out' position).
|
|
73
|
+
* @minVersion 23.3
|
|
74
|
+
*/
|
|
75
|
+
get rightDirection(): number[];
|
|
76
|
+
set rightDirection(location: number[]);
|
|
77
|
+
/**
|
|
78
|
+
* The class name of the referenced object: *"PathPointInfo"*.
|
|
79
|
+
* @minVersion 23.3
|
|
80
|
+
*/
|
|
81
|
+
get typename(): 'PathPointInfo';
|
|
82
|
+
/** @ignore */
|
|
83
|
+
constructor();
|
|
84
|
+
}
|