@bubblydoo/photoshop-mcp 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7049 -0
- package/dist/index.js.map +1 -0
- package/dist-readmes/README.md +383 -0
- package/dist-runtime/runtime-code.cjs +17124 -0
- package/dist-runtime/runtime-code.d.cts +9 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/index.d.ts +16 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/all-types.d.ts +65 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Actions.d.ts +230 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Channel.d.ts +120 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/ColorSampler.d.ts +105 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Constants.d.ts +1648 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/CoreModules.d.ts +922 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/CountItem.d.ts +86 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Document.d.ts +931 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Guide.d.ts +105 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/HistoryState.d.ts +74 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/ImagingModule.d.ts +559 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Layer.d.ts +1073 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/LayerComp.d.ts +219 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Objects.d.ts +7 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/PathItem.d.ts +243 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/PathPoint.d.ts +78 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Photoshop.d.ts +317 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/Selection.d.ts +557 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/SubPathItem.d.ts +69 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/TextItem.d.ts +213 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Channels.d.ts +81 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/ColorSamplers.d.ts +97 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/CountItems.d.ts +130 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Documents.d.ts +95 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Guides.d.ts +76 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/HistoryStates.d.ts +56 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/LayerComps.d.ts +92 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/Layers.d.ts +68 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/PathItems.d.ts +65 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/PathPoints.d.ts +50 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/SubPathItems.d.ts +50 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/collections/TextFonts.d.ts +43 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/Colors.d.ts +225 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ConversionOptions.d.ts +213 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/ImagingBounds.d.ts +53 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/PathPointInfo.d.ts +84 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SaveOptions.d.ts +376 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SolidColor.d.ts +118 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/SubPathInfo.d.ts +47 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/TextFont.d.ts +49 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/objects/Tool.d.ts +23 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/Preferences.d.ts +121 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesBase.d.ts +9 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesCursors.d.ts +37 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesFileHandling.d.ts +58 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesGeneral.d.ts +77 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesGuidesGridsAndSlices.d.ts +51 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesHistory.d.ts +69 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesInterface.d.ts +46 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesPerformance.d.ts +42 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesTools.d.ts +44 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesTransparencyAndGamut.d.ts +38 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesType.d.ts +44 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/preferences/PreferencesUnitsAndRulers.d.ts +44 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/CharacterStyle.d.ts +254 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/ParagraphStyle.d.ts +114 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/text/TextWarpStyle.d.ts +48 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/ApplyImageTypes.d.ts +107 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/CalculationsTypes.d.ts +119 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/DocumentTypes.d.ts +80 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/LayerCompTypes.d.ts +91 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/LayerTypes.d.ts +153 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/SharedTypes.d.ts +6 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/dom/types/TextTypes.d.ts +218 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/util/colorTypes.d.ts +61 -0
- package/dist-schemas/@adobe-uxp-types/photoshop/src/internal/util/unit.d.ts +45 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/index.d.ts +21 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/all-types.d.ts +3 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/dialog.d.ts +26 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/entrypoints.d.ts +385 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/host.d.ts +28 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/os.d.ts +56 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/other.d.ts +7 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/shell.d.ts +54 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/storage.d.ts +1216 -0
- package/dist-schemas/@adobe-uxp-types/uxp/src/internal/versions.d.ts +18 -0
- package/dist-schemas/@bubblydoo/uxp-toolkit/dist/commands-library/index.d.ts +109 -0
- package/dist-schemas/@bubblydoo/uxp-toolkit/dist/index.d.ts +153 -0
- package/dist-schemas/@bubblydoo/uxp-toolkit/dist/psLayerRef-BJKcxKbm.d.ts +66 -0
- package/package.json +51 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FIXME: Is this namespace documented anywhere?
|
|
3
|
+
*/
|
|
4
|
+
export const dialog = {
|
|
5
|
+
showOpenDialog: (options: {
|
|
6
|
+
openFile?: boolean;
|
|
7
|
+
openDirectory?: boolean;
|
|
8
|
+
defaultPath?: string;
|
|
9
|
+
multipleSelections?: boolean;
|
|
10
|
+
title?: string;
|
|
11
|
+
buttonLabel?: string;
|
|
12
|
+
filters?: string[];
|
|
13
|
+
showHiddenFiles?: boolean;
|
|
14
|
+
initialLocation?: string;
|
|
15
|
+
}) => Promise<URL>,
|
|
16
|
+
|
|
17
|
+
showSaveDialog: (options: {
|
|
18
|
+
defaultPath?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
buttonLabel?: string;
|
|
21
|
+
filters: string[];
|
|
22
|
+
showHiddenFiles?: boolean;
|
|
23
|
+
suggestedName?: string;
|
|
24
|
+
initialLocation?: string;
|
|
25
|
+
}) => Promise<URL>,
|
|
26
|
+
};
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a horizontal divider between two menu items.
|
|
3
|
+
*/
|
|
4
|
+
export type MenuSeparator = '-';
|
|
5
|
+
|
|
6
|
+
interface PluginConfig {
|
|
7
|
+
/**
|
|
8
|
+
* This is called after plugin is loaded.
|
|
9
|
+
* 'this' can be used to access UxpPluginInfo object.
|
|
10
|
+
* If 'plugin' object is defined, 'create' must be defined.
|
|
11
|
+
* To signal failure, throw an exception.
|
|
12
|
+
*/
|
|
13
|
+
create?: (this: UxpPluginInfo) => Promise<void>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* This is called before plugin is unloaded.
|
|
17
|
+
* 'this' can be used to access UxpPluginInfo object.
|
|
18
|
+
*/
|
|
19
|
+
destroy?: (this: UxpPluginInfo) => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface PanelConfig {
|
|
23
|
+
/**
|
|
24
|
+
* This is called when a panel is created.
|
|
25
|
+
* 'this' can be used to access UxpPanelInfo object.
|
|
26
|
+
* This function can return a promise.
|
|
27
|
+
* To signal failure, throw an exception or return a rejected promise.
|
|
28
|
+
* This has a default Timeout of 300 MSec from manifest v5 onwards.
|
|
29
|
+
* Parameters : create(event) {}, till Manifest Version V4 create(rootNode) {}, from v5 onwards
|
|
30
|
+
*/
|
|
31
|
+
create?: (this: UxpPanelInfo) => Promise<void>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* This is called when a panel is shown.
|
|
35
|
+
* 'this' can be used to access UxpPanelInfo object.
|
|
36
|
+
* This function can return a promise.
|
|
37
|
+
* To signal failure, throw an exception or return a rejected promise.
|
|
38
|
+
* This has a default Timeout of 300 MSec from manifest v5 onwards.
|
|
39
|
+
* Parameters : show(event) {}, till Manifest Version V4 show(rootNode, data) {}, from v5 onwards
|
|
40
|
+
*/
|
|
41
|
+
show?: (this: UxpPanelInfo) => Promise<void>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* This is called when a panel is hidden.
|
|
45
|
+
* 'this' can be used to access UxpPanelInfo object.
|
|
46
|
+
* This function can return a promise.
|
|
47
|
+
* To signal failure, throw an exception or return a rejected promise.
|
|
48
|
+
* This has a default Timeout of 300 MSec from manifest v5 onwards.
|
|
49
|
+
* Parameters : hide(event) {}, till Manifest Version V4 hide(rootNode, data) {}, from v5 onwards
|
|
50
|
+
*/
|
|
51
|
+
hide?: (this: UxpPanelInfo) => Promise<void>;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* This is called when a panel is going to be destroyed.
|
|
55
|
+
* 'this' can be used to access UxpPanelInfo object.
|
|
56
|
+
* To signal failure, throw an exception.
|
|
57
|
+
* Parameters : destroy(event) {}, till Manifest Version V4 destroy(rootNode) {}, from v5 onwards
|
|
58
|
+
*/
|
|
59
|
+
destroy?: (this: UxpPanelInfo) => Promise<void>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* This is called when a panel menu item is invoked.
|
|
63
|
+
* Menu id is passed as the first argument to this function.
|
|
64
|
+
* 'this' can be used to access UxpPanelInfo object.
|
|
65
|
+
* This function can return a promise.
|
|
66
|
+
* To signal failure, throw an exception or return a rejected promise.
|
|
67
|
+
* @param menuId
|
|
68
|
+
*/
|
|
69
|
+
invokeMenu?: (this: UxpPanelInfo, menuId: string) => Promise<void>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Array of menu items.
|
|
73
|
+
* Each menu item can be a string or an object with properties defined below.
|
|
74
|
+
* Menu items are displayed in the same order as specified in this array.
|
|
75
|
+
* For specifying a separator, a value of "-" or menu item with label "-" can be used at required place in the
|
|
76
|
+
* array.
|
|
77
|
+
*/
|
|
78
|
+
menuItems?: (MenuItem | MenuSeparator)[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface CommandConfig {
|
|
82
|
+
/**
|
|
83
|
+
* This is called when the command is invoked via menu entry.
|
|
84
|
+
* 'this' can be used to access UxpCommandInfo object.
|
|
85
|
+
* This function can return a promise.
|
|
86
|
+
* To signal failure, throw an exception or return a rejected promise.
|
|
87
|
+
* Parameters : run(event) {}, till Manifest Version V4 run(executionContext, ...arguments) {}, from v5 onwards
|
|
88
|
+
*/
|
|
89
|
+
run?: (this: UxpCommandInfo) => Promise<void>;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* For future use.
|
|
93
|
+
*/
|
|
94
|
+
cancel?: () => Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Entry%20Points/EntryPoints/
|
|
99
|
+
*/
|
|
100
|
+
interface Entrypoints {
|
|
101
|
+
/**
|
|
102
|
+
* This can be an object or a function.
|
|
103
|
+
* If this is a function, it is assumed as the 'create' handler
|
|
104
|
+
*/
|
|
105
|
+
plugin?: PluginConfig | PluginConfig['create'];
|
|
106
|
+
/**
|
|
107
|
+
* This contains a list of key-value pairs where each key is a panel id (string) and value is the data for the
|
|
108
|
+
* panel whose type can be object/function.
|
|
109
|
+
* If a function, it is assumed to be the 'show' method.
|
|
110
|
+
* If an object, it can contain following properties but it is must to define either of 'create' or 'show'.
|
|
111
|
+
*/
|
|
112
|
+
panels?: {
|
|
113
|
+
[key: string]: PanelConfig | PanelConfig['show'];
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* This object contains a list of key-value pairs where each key is the command id and value is command's data
|
|
117
|
+
* whose type can be an object or function.
|
|
118
|
+
* If a function, it is assumed to be 'run' method.
|
|
119
|
+
* If an objet, it can contain following properties but 'run' is must to specify.
|
|
120
|
+
*/
|
|
121
|
+
commands?: {
|
|
122
|
+
[key: string]: CommandConfig | CommandConfig['run'];
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface MenuItem {
|
|
127
|
+
/**
|
|
128
|
+
* Identifier of the menu item.
|
|
129
|
+
*/
|
|
130
|
+
id: string;
|
|
131
|
+
/**
|
|
132
|
+
* Display text for the menu item. Should be localized.
|
|
133
|
+
* If label is not specified, id is used as label.
|
|
134
|
+
* FIXME: does label localization even work?
|
|
135
|
+
*/
|
|
136
|
+
label?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Enabled/disabled state for the menu item. Default - true.
|
|
139
|
+
*/
|
|
140
|
+
enabled?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Checked state for the menu item. Default - false.
|
|
143
|
+
*/
|
|
144
|
+
checked?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Submenu for this menu item again as an array of 'menuItems'.
|
|
147
|
+
* 'id' of submenus should still be unique across panel.
|
|
148
|
+
*/
|
|
149
|
+
submenu?: MenuItem[];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* This is a public object which is passed as parameter in plugin.create() and plugin.destroy() entrypoint events.
|
|
154
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Entry%20Points/UxpPluginInfo/#uxpplugininfo
|
|
155
|
+
*/
|
|
156
|
+
interface UxpPluginInfo {
|
|
157
|
+
/**
|
|
158
|
+
* Get plugin ID.
|
|
159
|
+
*/
|
|
160
|
+
id: string;
|
|
161
|
+
/**
|
|
162
|
+
* Get plugin version.
|
|
163
|
+
*/
|
|
164
|
+
version: string;
|
|
165
|
+
/**
|
|
166
|
+
* Get plugin name.
|
|
167
|
+
*/
|
|
168
|
+
name: string;
|
|
169
|
+
/**
|
|
170
|
+
* Get plugin manifest.
|
|
171
|
+
*/
|
|
172
|
+
manifest: never;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Check if the plugin is First Party Plugin.
|
|
176
|
+
*/
|
|
177
|
+
isFirstParty: () => void;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Class describing a single menu item of a panel.
|
|
182
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Entry%20Points/UxpMenuItem/
|
|
183
|
+
*/
|
|
184
|
+
interface UxpMenuItem {
|
|
185
|
+
/**
|
|
186
|
+
* Get menu item id.
|
|
187
|
+
*/
|
|
188
|
+
id: string;
|
|
189
|
+
/**
|
|
190
|
+
* Get menu item label, localized string.
|
|
191
|
+
*/
|
|
192
|
+
label: string;
|
|
193
|
+
/**
|
|
194
|
+
* Get menu item enable state.
|
|
195
|
+
*/
|
|
196
|
+
enabled: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Get menu item checked state.
|
|
199
|
+
*/
|
|
200
|
+
checked: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Get menu submenu.
|
|
203
|
+
*/
|
|
204
|
+
submenu: UxpMenuItems;
|
|
205
|
+
/**
|
|
206
|
+
* Get menu parent.
|
|
207
|
+
*/
|
|
208
|
+
parent: UxpMenuItems;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Remove the menu item.
|
|
212
|
+
*/
|
|
213
|
+
remove: () => void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Class describing the menu of a panel.
|
|
218
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Entry%20Points/UxpMenuItems/
|
|
219
|
+
*/
|
|
220
|
+
interface UxpMenuItems {
|
|
221
|
+
/**
|
|
222
|
+
* Get number of menu items.
|
|
223
|
+
*/
|
|
224
|
+
size: number;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Get menu item with specified ID.
|
|
228
|
+
* @param id
|
|
229
|
+
* @return Menu item with specified ID.
|
|
230
|
+
*/
|
|
231
|
+
getItem: (id: string) => UxpMenuItem;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Get menu item at specified index.
|
|
235
|
+
* @param index
|
|
236
|
+
* @return Menu item at specified index.
|
|
237
|
+
*/
|
|
238
|
+
getItemAt: (index: number) => UxpMenuItem;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Inserts/replaces the menu item at the specified index with the new menu item.
|
|
242
|
+
* - index < size of menuItems array : Replaces the existing menu item.
|
|
243
|
+
* - index = size of menuItems array : Inserts menu item at end.
|
|
244
|
+
* - index > size of menuItems array : Throws invalid index exception.
|
|
245
|
+
* @param index
|
|
246
|
+
* @param newItem
|
|
247
|
+
*/
|
|
248
|
+
insertAt: (index: number, newItem: MenuItem | MenuSeparator) => void;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Removes menu item from specified index.
|
|
252
|
+
* @param index
|
|
253
|
+
*/
|
|
254
|
+
removeAt: (index: number) => void;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Class describing a panel of the plugin.
|
|
259
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Entry%20Points/UxpPanelInfo/#uxppanelinfo
|
|
260
|
+
*/
|
|
261
|
+
interface UxpPanelInfo {
|
|
262
|
+
/**
|
|
263
|
+
* Get panel id.
|
|
264
|
+
*/
|
|
265
|
+
id: string;
|
|
266
|
+
/**
|
|
267
|
+
* Get panel label, localized string.
|
|
268
|
+
*/
|
|
269
|
+
label: string;
|
|
270
|
+
/**
|
|
271
|
+
* Get panel description, localized string.
|
|
272
|
+
*/
|
|
273
|
+
description: string;
|
|
274
|
+
/**
|
|
275
|
+
* Get panel shortcut.
|
|
276
|
+
*/
|
|
277
|
+
shortcut: {
|
|
278
|
+
shortcutKey: string;
|
|
279
|
+
commandKey: boolean;
|
|
280
|
+
altKey: boolean;
|
|
281
|
+
shiftKey: boolean;
|
|
282
|
+
ctrlKey: boolean;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Get panel title, localized string.
|
|
286
|
+
*/
|
|
287
|
+
title: string;
|
|
288
|
+
/**
|
|
289
|
+
* Get panel icons.
|
|
290
|
+
*/
|
|
291
|
+
icons: {
|
|
292
|
+
path: string;
|
|
293
|
+
scale: number[];
|
|
294
|
+
theme: string[];
|
|
295
|
+
species: string[];
|
|
296
|
+
}[];
|
|
297
|
+
/**
|
|
298
|
+
* Get panel minimum size.
|
|
299
|
+
*/
|
|
300
|
+
minimumSize: {
|
|
301
|
+
width: number;
|
|
302
|
+
height: number;
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* Get panel maximum size.
|
|
306
|
+
*/
|
|
307
|
+
maximumSize: {
|
|
308
|
+
width: number;
|
|
309
|
+
height: number;
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* Get panel preferred docked size.
|
|
313
|
+
*/
|
|
314
|
+
preferredDockedSize: {
|
|
315
|
+
width: number;
|
|
316
|
+
height: number;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* Get panel preferred floating size.
|
|
320
|
+
*/
|
|
321
|
+
preferredFloatingSize: {
|
|
322
|
+
width: number;
|
|
323
|
+
height: number;
|
|
324
|
+
};
|
|
325
|
+
/**
|
|
326
|
+
* Get panel menu items.
|
|
327
|
+
*/
|
|
328
|
+
menuItems: UxpMenuItems;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Entry%20Points/UxpCommandInfo/#uxpcommandinfo
|
|
333
|
+
*/
|
|
334
|
+
interface UxpCommandInfo {
|
|
335
|
+
/**
|
|
336
|
+
* Get command id.
|
|
337
|
+
*/
|
|
338
|
+
id: string;
|
|
339
|
+
/**
|
|
340
|
+
* Get command label, localized string.
|
|
341
|
+
*/
|
|
342
|
+
label: string;
|
|
343
|
+
/**
|
|
344
|
+
* Get command description, localized string.
|
|
345
|
+
*/
|
|
346
|
+
description: string;
|
|
347
|
+
/**
|
|
348
|
+
* Get command shortcut.
|
|
349
|
+
*/
|
|
350
|
+
shortcut: {
|
|
351
|
+
shortcutKey: string;
|
|
352
|
+
commandKey: boolean;
|
|
353
|
+
altKey: boolean;
|
|
354
|
+
shiftKey: boolean;
|
|
355
|
+
ctrlKey: boolean;
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Entry%20Points/
|
|
361
|
+
*/
|
|
362
|
+
interface Entrypoints {
|
|
363
|
+
/**
|
|
364
|
+
* Get command with specified ID.
|
|
365
|
+
* @param id Command ID.
|
|
366
|
+
* @return Command object for a valid ID null for an invalid ID.
|
|
367
|
+
*/
|
|
368
|
+
getCommand: (id: string) => UxpCommandInfo;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Get panel with specified ID.
|
|
372
|
+
* @param id Panel ID.
|
|
373
|
+
* @return Panel object for a valid ID null for an invalid ID.
|
|
374
|
+
*/
|
|
375
|
+
getPanel: (id: string) => UxpPanelInfo;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* API for plugin to add handlers and menu items for entrypoints defined in manifest.
|
|
379
|
+
* This API can only be called once and there after other apis can be used to modify menu items.
|
|
380
|
+
* The function throws in case of any error in entrypoints data or if its called more than once.
|
|
381
|
+
* @param entrypoints Describes your plugin's entrypoint functions and properties.
|
|
382
|
+
*/
|
|
383
|
+
setup: (entrypoints: Entrypoints) => void;
|
|
384
|
+
}
|
|
385
|
+
export const entrypoints: Entrypoints;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Includes useful information about the operating environment the plugin finds itself executing in.
|
|
3
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/Host%20Information/Host/
|
|
4
|
+
*/
|
|
5
|
+
interface Host {
|
|
6
|
+
/**
|
|
7
|
+
* Allows you to obtain the language and region used to render the user interface for the host application.
|
|
8
|
+
* This property is useful in that it allows you to localize and internationalize your plugin's content to match
|
|
9
|
+
* that of the host application.
|
|
10
|
+
* @return The locale for the user interface. For example, en_US.
|
|
11
|
+
*/
|
|
12
|
+
uiLocale: string;
|
|
13
|
+
/**
|
|
14
|
+
* Indicates the name of the hosting application.
|
|
15
|
+
* This is useful if your plugin needs to adapt its behavior based upon the hosting application.
|
|
16
|
+
* @return The name of the hosting application. For example, Photoshop.
|
|
17
|
+
*/
|
|
18
|
+
name: string;
|
|
19
|
+
/**
|
|
20
|
+
* Indicates the version of the hosting application.
|
|
21
|
+
* This is useful if your plugin needs to adapt its behavior depending upon the version of the host application.
|
|
22
|
+
* This may be due to new APIs being introduced in a given version, or to work around a bug in a specific version.
|
|
23
|
+
* @return The version of the hosting application. For example, 22.0.0.
|
|
24
|
+
*/
|
|
25
|
+
version: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const host: Host;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/os/OS/
|
|
3
|
+
*/
|
|
4
|
+
export interface OS {
|
|
5
|
+
/**
|
|
6
|
+
* Gets the platform we are running on (eg. "win32", "win10", "darwin").
|
|
7
|
+
* @return The string representing the platform.
|
|
8
|
+
*/
|
|
9
|
+
platform: () => string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Gets the release number of the os (eg. "10.0.1.1032").
|
|
13
|
+
* @return The string representing the release.
|
|
14
|
+
*/
|
|
15
|
+
release: () => string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Gets the platform architecture we are running on (eg. "x32, x64, x86_64 etc").
|
|
19
|
+
* @return The string representing the architecture.
|
|
20
|
+
*/
|
|
21
|
+
arch: () => string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Gets the platform cpu information we are running on (eg. "{'Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz', 2900}").
|
|
25
|
+
* @return The array of objects containing information about each logical CPU core.
|
|
26
|
+
* Currently only model and speed properties are supported.
|
|
27
|
+
* Times property is not supported.
|
|
28
|
+
* Access to CPU information, such as model string and frequency, is limited on UWP.
|
|
29
|
+
* "ARM based architecture" or "X86 based architecture" is returned as a 'model' value on UWP.
|
|
30
|
+
* 0 is returned as a 'speed' value on UWP.
|
|
31
|
+
*/
|
|
32
|
+
cpus: () => {
|
|
33
|
+
model: string;
|
|
34
|
+
speed: number;
|
|
35
|
+
}[];
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Gets the total amount of system memory in bytes.
|
|
39
|
+
* @return The total amount of system memory in bytes as an integer.
|
|
40
|
+
*/
|
|
41
|
+
totalmem: () => number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the total amount of free system memory in bytes.
|
|
45
|
+
* @return The total amount of free system memory in bytes as an integer.
|
|
46
|
+
*/
|
|
47
|
+
freemem: () => number;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Gets the home directory path of the user.
|
|
51
|
+
* @return The home directory path of the user.
|
|
52
|
+
*/
|
|
53
|
+
homedir: () => string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const os: OS;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event interface received when handling a 'uxpcommand' event.
|
|
3
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/guides/how-to/#how-to-get-notified-that-your-panel-is-opening-or-closing
|
|
4
|
+
*/
|
|
5
|
+
export interface UxpCommandEvent extends Event {
|
|
6
|
+
commandId: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* To get an instance: require("uxp").shell.
|
|
3
|
+
* These APIs require UXP Manifest v5 configurations.
|
|
4
|
+
* @see https://developer.adobe.com/photoshop/uxp/2022/uxp/reference-js/Modules/uxp/shell/Shell/
|
|
5
|
+
*/
|
|
6
|
+
interface Shell {
|
|
7
|
+
/**
|
|
8
|
+
* Opens the given file or folder path in the system default application.
|
|
9
|
+
*
|
|
10
|
+
* Note: UWP can access only files in the UWP App sandbox.
|
|
11
|
+
*
|
|
12
|
+
* @param path String representing the path to open.
|
|
13
|
+
* @param developerText Information from the plugin developer to be displayed on the user consent dialog.
|
|
14
|
+
* Message should be localised in current host UI locale.
|
|
15
|
+
* @returns Promise that resolves with "" if succeeded or String containing the error message if failed.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* // for MacOS
|
|
20
|
+
* shell.openPath("/Users/[username]/Downloads");
|
|
21
|
+
* shell.openPath("/Users/[username]/sample.txt");
|
|
22
|
+
* // for Windows
|
|
23
|
+
* shell.openPath("C:\\Users\\[username]\\Downloads");
|
|
24
|
+
* shell.openPath("C:\\Users\\[username]\\AppData\\Local\\...\\sample.txt");
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
openPath: (path: string, developerText?: string) => Promise<string>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Opens the url in the dedicated system applications for the scheme.
|
|
31
|
+
*
|
|
32
|
+
* Note: File scheme is not allowed for openExternal. Use openPath for those cases.
|
|
33
|
+
*
|
|
34
|
+
* @param url String representing the URL to open.
|
|
35
|
+
* @param developerText Information from the plugin developer to be displayed on the user consent dialog.
|
|
36
|
+
* Message should be localised in current host UI locale.
|
|
37
|
+
* @returns Promise that resolves with "" if succeeded or String containing the error message if failed.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```js
|
|
41
|
+
* shell.openExternal("https://www.adobe.com/");
|
|
42
|
+
* shell.openExternal("https://www.adobe.com/", "develop message for the user consent dialog");
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```js
|
|
47
|
+
* shell.openExternal("maps://?address=345+Park+Ave+San+Jose"); // for MacOS
|
|
48
|
+
* shell.openExternal("bingmaps:?q=345+Park+Ave+San+Jose, +95110"); // for Windows
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
openExternal: (url: string | URL, developerText?: string) => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const shell: Shell;
|