@imagekit/nodejs 7.1.0 → 7.2.0
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/CHANGELOG.md +120 -0
- package/LICENSE +1 -1
- package/README.md +73 -8
- package/client.d.mts +8 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -1
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/lib/crypto-utils.d.mts.map +1 -1
- package/lib/crypto-utils.d.ts.map +1 -1
- package/lib/crypto-utils.js +6 -5
- package/lib/crypto-utils.js.map +1 -1
- package/lib/crypto-utils.mjs +4 -5
- package/lib/crypto-utils.mjs.map +1 -1
- package/lib/transformation-utils.d.mts.map +1 -1
- package/lib/transformation-utils.d.ts.map +1 -1
- package/lib/transformation-utils.js +3 -0
- package/lib/transformation-utils.js.map +1 -1
- package/lib/transformation-utils.mjs +3 -0
- package/lib/transformation-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/v2/files.d.mts +1 -0
- package/resources/beta/v2/files.d.mts.map +1 -1
- package/resources/beta/v2/files.d.ts +1 -0
- package/resources/beta/v2/files.d.ts.map +1 -1
- package/resources/custom-metadata-fields.d.mts +1 -5
- package/resources/custom-metadata-fields.d.mts.map +1 -1
- package/resources/custom-metadata-fields.d.ts +1 -5
- package/resources/custom-metadata-fields.d.ts.map +1 -1
- package/resources/custom-metadata-fields.js +1 -5
- package/resources/custom-metadata-fields.js.map +1 -1
- package/resources/custom-metadata-fields.mjs +1 -5
- package/resources/custom-metadata-fields.mjs.map +1 -1
- package/resources/files/files.d.mts +2 -0
- package/resources/files/files.d.mts.map +1 -1
- package/resources/files/files.d.ts +2 -0
- package/resources/files/files.d.ts.map +1 -1
- package/resources/files/files.js.map +1 -1
- package/resources/files/files.mjs.map +1 -1
- package/resources/files/metadata.js +1 -1
- package/resources/files/metadata.js.map +1 -1
- package/resources/files/metadata.mjs +1 -1
- package/resources/files/metadata.mjs.map +1 -1
- package/resources/helper.d.mts.map +1 -1
- package/resources/helper.d.ts.map +1 -1
- package/resources/helper.js +26 -20
- package/resources/helper.js.map +1 -1
- package/resources/helper.mjs +26 -20
- package/resources/helper.mjs.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/saved-extensions.d.mts +112 -0
- package/resources/saved-extensions.d.mts.map +1 -0
- package/resources/saved-extensions.d.ts +112 -0
- package/resources/saved-extensions.d.ts.map +1 -0
- package/resources/saved-extensions.js +95 -0
- package/resources/saved-extensions.js.map +1 -0
- package/resources/saved-extensions.mjs +91 -0
- package/resources/saved-extensions.mjs.map +1 -0
- package/resources/shared.d.mts +703 -23
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +703 -23
- package/resources/shared.d.ts.map +1 -1
- package/resources/webhooks.d.mts +1 -0
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +1 -0
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +20 -1
- package/src/internal/to-file.ts +1 -1
- package/src/lib/crypto-utils.ts +7 -5
- package/src/lib/transformation-utils.ts +3 -0
- package/src/resources/beta/v2/files.ts +2 -0
- package/src/resources/custom-metadata-fields.ts +1 -5
- package/src/resources/files/files.ts +4 -0
- package/src/resources/files/metadata.ts +1 -1
- package/src/resources/helper.ts +33 -19
- package/src/resources/index.ts +6 -0
- package/src/resources/saved-extensions.ts +149 -0
- package/src/resources/shared.ts +819 -23
- package/src/resources/webhooks.ts +2 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/shared.ts
CHANGED
|
@@ -1,17 +1,373 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export interface BaseOverlay {
|
|
4
|
+
/**
|
|
5
|
+
* Controls how the layer blends with the base image or underlying content. Maps to
|
|
6
|
+
* `lm` in the URL. By default, layers completely cover the base image beneath
|
|
7
|
+
* them. Layer modes change this behavior:
|
|
8
|
+
*
|
|
9
|
+
* - `multiply`: Multiplies the pixel values of the layer with the base image. The
|
|
10
|
+
* result is always darker than the original images. This is ideal for applying
|
|
11
|
+
* shadows or color tints.
|
|
12
|
+
* - `displace`: Uses the layer as a displacement map to distort pixels in the base
|
|
13
|
+
* image. The red channel controls horizontal displacement, and the green channel
|
|
14
|
+
* controls vertical displacement. Requires `x` or `y` parameter to control
|
|
15
|
+
* displacement magnitude.
|
|
16
|
+
* - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the
|
|
17
|
+
* base image transparent, while transparent areas leave the base image
|
|
18
|
+
* unchanged. This mode functions like a hole-punch, effectively cutting the
|
|
19
|
+
* shape of the layer out of the underlying image.
|
|
20
|
+
* - `cutter`: Acts as a shape mask where only the parts of the base image that
|
|
21
|
+
* fall inside the opaque area of the layer are preserved. This mode functions
|
|
22
|
+
* like a cookie-cutter, trimming the base image to match the specific dimensions
|
|
23
|
+
* and shape of the layer. See
|
|
24
|
+
* [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes).
|
|
25
|
+
*/
|
|
26
|
+
layerMode?: 'multiply' | 'cutter' | 'cutout' | 'displace';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Specifies the overlay's position relative to the parent asset. See
|
|
30
|
+
* [Position of Layer](https://imagekit.io/docs/transformations#position-of-layer).
|
|
31
|
+
*/
|
|
4
32
|
position?: OverlayPosition;
|
|
5
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Specifies timing information for the overlay (only applicable if the base asset
|
|
36
|
+
* is a video). See
|
|
37
|
+
* [Position of Layer](https://imagekit.io/docs/transformations#position-of-layer).
|
|
38
|
+
*/
|
|
6
39
|
timing?: OverlayTiming;
|
|
7
40
|
}
|
|
8
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Configuration object for an extension (base extensions only, not saved extension
|
|
44
|
+
* references).
|
|
45
|
+
*/
|
|
46
|
+
export type ExtensionConfig =
|
|
47
|
+
| ExtensionConfig.RemoveBg
|
|
48
|
+
| ExtensionConfig.AutoTaggingExtension
|
|
49
|
+
| ExtensionConfig.AIAutoDescription
|
|
50
|
+
| ExtensionConfig.AITasks;
|
|
51
|
+
|
|
52
|
+
export namespace ExtensionConfig {
|
|
53
|
+
export interface RemoveBg {
|
|
54
|
+
/**
|
|
55
|
+
* Specifies the background removal extension.
|
|
56
|
+
*/
|
|
57
|
+
name: 'remove-bg';
|
|
58
|
+
|
|
59
|
+
options?: RemoveBg.Options;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export namespace RemoveBg {
|
|
63
|
+
export interface Options {
|
|
64
|
+
/**
|
|
65
|
+
* Whether to add an artificial shadow to the result. Default is false. Note:
|
|
66
|
+
* Adding shadows is currently only supported for car photos.
|
|
67
|
+
*/
|
|
68
|
+
add_shadow?: boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
|
|
72
|
+
* color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
|
|
73
|
+
* empty.
|
|
74
|
+
*/
|
|
75
|
+
bg_color?: string;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Sets a background image from a URL. If this parameter is set, `bg_color` must be
|
|
79
|
+
* empty.
|
|
80
|
+
*/
|
|
81
|
+
bg_image_url?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Allows semi-transparent regions in the result. Default is true. Note:
|
|
85
|
+
* Semitransparency is currently only supported for car windows.
|
|
86
|
+
*/
|
|
87
|
+
semitransparency?: boolean;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface AutoTaggingExtension {
|
|
92
|
+
/**
|
|
93
|
+
* Maximum number of tags to attach to the asset.
|
|
94
|
+
*/
|
|
95
|
+
maxTags: number;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Minimum confidence level for tags to be considered valid.
|
|
99
|
+
*/
|
|
100
|
+
minConfidence: number;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Specifies the auto-tagging extension used.
|
|
104
|
+
*/
|
|
105
|
+
name: 'google-auto-tagging' | 'aws-auto-tagging';
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface AIAutoDescription {
|
|
109
|
+
/**
|
|
110
|
+
* Specifies the auto description extension.
|
|
111
|
+
*/
|
|
112
|
+
name: 'ai-auto-description';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface AITasks {
|
|
116
|
+
/**
|
|
117
|
+
* Specifies the AI tasks extension for automated image analysis using AI models.
|
|
118
|
+
*/
|
|
119
|
+
name: 'ai-tasks';
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Array of task objects defining AI operations to perform on the asset.
|
|
123
|
+
*/
|
|
124
|
+
tasks: Array<AITasks.SelectTags | AITasks.SelectMetadata | AITasks.YesNo>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export namespace AITasks {
|
|
128
|
+
export interface SelectTags {
|
|
129
|
+
/**
|
|
130
|
+
* The question or instruction for the AI to analyze the image.
|
|
131
|
+
*/
|
|
132
|
+
instruction: string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Task type that analyzes the image and adds matching tags from a vocabulary.
|
|
136
|
+
*/
|
|
137
|
+
type: 'select_tags';
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Array of possible tag values. Combined length of all strings must not exceed 500
|
|
141
|
+
* characters. Cannot contain the `%` character.
|
|
142
|
+
*/
|
|
143
|
+
vocabulary: Array<string>;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Maximum number of tags to select from the vocabulary.
|
|
147
|
+
*/
|
|
148
|
+
max_selections?: number;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Minimum number of tags to select from the vocabulary.
|
|
152
|
+
*/
|
|
153
|
+
min_selections?: number;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface SelectMetadata {
|
|
157
|
+
/**
|
|
158
|
+
* Name of the custom metadata field to set. The field must exist in your account.
|
|
159
|
+
*/
|
|
160
|
+
field: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The question or instruction for the AI to analyze the image.
|
|
164
|
+
*/
|
|
165
|
+
instruction: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Task type that analyzes the image and sets a custom metadata field value from a
|
|
169
|
+
* vocabulary.
|
|
170
|
+
*/
|
|
171
|
+
type: 'select_metadata';
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Maximum number of values to select from the vocabulary.
|
|
175
|
+
*/
|
|
176
|
+
max_selections?: number;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Minimum number of values to select from the vocabulary.
|
|
180
|
+
*/
|
|
181
|
+
min_selections?: number;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Array of possible values matching the custom metadata field type.
|
|
185
|
+
*/
|
|
186
|
+
vocabulary?: Array<string | number | boolean>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export interface YesNo {
|
|
190
|
+
/**
|
|
191
|
+
* The yes/no question for the AI to answer about the image.
|
|
192
|
+
*/
|
|
193
|
+
instruction: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Task type that asks a yes/no question and executes actions based on the answer.
|
|
197
|
+
*/
|
|
198
|
+
type: 'yes_no';
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Actions to execute if the AI answers no.
|
|
202
|
+
*/
|
|
203
|
+
on_no?: YesNo.OnNo;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Actions to execute if the AI cannot determine the answer.
|
|
207
|
+
*/
|
|
208
|
+
on_unknown?: YesNo.OnUnknown;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Actions to execute if the AI answers yes.
|
|
212
|
+
*/
|
|
213
|
+
on_yes?: YesNo.OnYes;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export namespace YesNo {
|
|
217
|
+
/**
|
|
218
|
+
* Actions to execute if the AI answers no.
|
|
219
|
+
*/
|
|
220
|
+
export interface OnNo {
|
|
221
|
+
/**
|
|
222
|
+
* Array of tag strings to add to the asset.
|
|
223
|
+
*/
|
|
224
|
+
add_tags?: Array<string>;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Array of tag strings to remove from the asset.
|
|
228
|
+
*/
|
|
229
|
+
remove_tags?: Array<string>;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Array of custom metadata field updates.
|
|
233
|
+
*/
|
|
234
|
+
set_metadata?: Array<OnNo.SetMetadata>;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Array of custom metadata fields to remove.
|
|
238
|
+
*/
|
|
239
|
+
unset_metadata?: Array<OnNo.UnsetMetadata>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export namespace OnNo {
|
|
243
|
+
export interface SetMetadata {
|
|
244
|
+
/**
|
|
245
|
+
* Name of the custom metadata field to set.
|
|
246
|
+
*/
|
|
247
|
+
field: string;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Value to set for the custom metadata field. The value type should match the
|
|
251
|
+
* custom metadata field type.
|
|
252
|
+
*/
|
|
253
|
+
value: string | number | boolean | Array<string | number | boolean>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export interface UnsetMetadata {
|
|
257
|
+
/**
|
|
258
|
+
* Name of the custom metadata field to remove.
|
|
259
|
+
*/
|
|
260
|
+
field: string;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Actions to execute if the AI cannot determine the answer.
|
|
266
|
+
*/
|
|
267
|
+
export interface OnUnknown {
|
|
268
|
+
/**
|
|
269
|
+
* Array of tag strings to add to the asset.
|
|
270
|
+
*/
|
|
271
|
+
add_tags?: Array<string>;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Array of tag strings to remove from the asset.
|
|
275
|
+
*/
|
|
276
|
+
remove_tags?: Array<string>;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Array of custom metadata field updates.
|
|
280
|
+
*/
|
|
281
|
+
set_metadata?: Array<OnUnknown.SetMetadata>;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Array of custom metadata fields to remove.
|
|
285
|
+
*/
|
|
286
|
+
unset_metadata?: Array<OnUnknown.UnsetMetadata>;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export namespace OnUnknown {
|
|
290
|
+
export interface SetMetadata {
|
|
291
|
+
/**
|
|
292
|
+
* Name of the custom metadata field to set.
|
|
293
|
+
*/
|
|
294
|
+
field: string;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Value to set for the custom metadata field. The value type should match the
|
|
298
|
+
* custom metadata field type.
|
|
299
|
+
*/
|
|
300
|
+
value: string | number | boolean | Array<string | number | boolean>;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface UnsetMetadata {
|
|
304
|
+
/**
|
|
305
|
+
* Name of the custom metadata field to remove.
|
|
306
|
+
*/
|
|
307
|
+
field: string;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Actions to execute if the AI answers yes.
|
|
313
|
+
*/
|
|
314
|
+
export interface OnYes {
|
|
315
|
+
/**
|
|
316
|
+
* Array of tag strings to add to the asset.
|
|
317
|
+
*/
|
|
318
|
+
add_tags?: Array<string>;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Array of tag strings to remove from the asset.
|
|
322
|
+
*/
|
|
323
|
+
remove_tags?: Array<string>;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Array of custom metadata field updates.
|
|
327
|
+
*/
|
|
328
|
+
set_metadata?: Array<OnYes.SetMetadata>;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Array of custom metadata fields to remove.
|
|
332
|
+
*/
|
|
333
|
+
unset_metadata?: Array<OnYes.UnsetMetadata>;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export namespace OnYes {
|
|
337
|
+
export interface SetMetadata {
|
|
338
|
+
/**
|
|
339
|
+
* Name of the custom metadata field to set.
|
|
340
|
+
*/
|
|
341
|
+
field: string;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Value to set for the custom metadata field. The value type should match the
|
|
345
|
+
* custom metadata field type.
|
|
346
|
+
*/
|
|
347
|
+
value: string | number | boolean | Array<string | number | boolean>;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface UnsetMetadata {
|
|
351
|
+
/**
|
|
352
|
+
* Name of the custom metadata field to remove.
|
|
353
|
+
*/
|
|
354
|
+
field: string;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
|
|
9
361
|
/**
|
|
10
362
|
* Array of extensions to be applied to the asset. Each extension can be configured
|
|
11
363
|
* with specific parameters based on the extension type.
|
|
12
364
|
*/
|
|
13
365
|
export type Extensions = Array<
|
|
14
|
-
|
|
366
|
+
| Extensions.RemoveBg
|
|
367
|
+
| Extensions.AutoTaggingExtension
|
|
368
|
+
| Extensions.AIAutoDescription
|
|
369
|
+
| Extensions.AITasks
|
|
370
|
+
| Extensions.SavedExtension
|
|
15
371
|
>;
|
|
16
372
|
|
|
17
373
|
export namespace Extensions {
|
|
@@ -76,6 +432,311 @@ export namespace Extensions {
|
|
|
76
432
|
*/
|
|
77
433
|
name: 'ai-auto-description';
|
|
78
434
|
}
|
|
435
|
+
|
|
436
|
+
export interface AITasks {
|
|
437
|
+
/**
|
|
438
|
+
* Specifies the AI tasks extension for automated image analysis using AI models.
|
|
439
|
+
*/
|
|
440
|
+
name: 'ai-tasks';
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Array of task objects defining AI operations to perform on the asset.
|
|
444
|
+
*/
|
|
445
|
+
tasks: Array<AITasks.SelectTags | AITasks.SelectMetadata | AITasks.YesNo>;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export namespace AITasks {
|
|
449
|
+
export interface SelectTags {
|
|
450
|
+
/**
|
|
451
|
+
* The question or instruction for the AI to analyze the image.
|
|
452
|
+
*/
|
|
453
|
+
instruction: string;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Task type that analyzes the image and adds matching tags from a vocabulary.
|
|
457
|
+
*/
|
|
458
|
+
type: 'select_tags';
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Array of possible tag values. Combined length of all strings must not exceed 500
|
|
462
|
+
* characters. Cannot contain the `%` character.
|
|
463
|
+
*/
|
|
464
|
+
vocabulary: Array<string>;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Maximum number of tags to select from the vocabulary.
|
|
468
|
+
*/
|
|
469
|
+
max_selections?: number;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Minimum number of tags to select from the vocabulary.
|
|
473
|
+
*/
|
|
474
|
+
min_selections?: number;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
export interface SelectMetadata {
|
|
478
|
+
/**
|
|
479
|
+
* Name of the custom metadata field to set. The field must exist in your account.
|
|
480
|
+
*/
|
|
481
|
+
field: string;
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* The question or instruction for the AI to analyze the image.
|
|
485
|
+
*/
|
|
486
|
+
instruction: string;
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Task type that analyzes the image and sets a custom metadata field value from a
|
|
490
|
+
* vocabulary.
|
|
491
|
+
*/
|
|
492
|
+
type: 'select_metadata';
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* Maximum number of values to select from the vocabulary.
|
|
496
|
+
*/
|
|
497
|
+
max_selections?: number;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Minimum number of values to select from the vocabulary.
|
|
501
|
+
*/
|
|
502
|
+
min_selections?: number;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* Array of possible values matching the custom metadata field type.
|
|
506
|
+
*/
|
|
507
|
+
vocabulary?: Array<string | number | boolean>;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export interface YesNo {
|
|
511
|
+
/**
|
|
512
|
+
* The yes/no question for the AI to answer about the image.
|
|
513
|
+
*/
|
|
514
|
+
instruction: string;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Task type that asks a yes/no question and executes actions based on the answer.
|
|
518
|
+
*/
|
|
519
|
+
type: 'yes_no';
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* Actions to execute if the AI answers no.
|
|
523
|
+
*/
|
|
524
|
+
on_no?: YesNo.OnNo;
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Actions to execute if the AI cannot determine the answer.
|
|
528
|
+
*/
|
|
529
|
+
on_unknown?: YesNo.OnUnknown;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* Actions to execute if the AI answers yes.
|
|
533
|
+
*/
|
|
534
|
+
on_yes?: YesNo.OnYes;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
export namespace YesNo {
|
|
538
|
+
/**
|
|
539
|
+
* Actions to execute if the AI answers no.
|
|
540
|
+
*/
|
|
541
|
+
export interface OnNo {
|
|
542
|
+
/**
|
|
543
|
+
* Array of tag strings to add to the asset.
|
|
544
|
+
*/
|
|
545
|
+
add_tags?: Array<string>;
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Array of tag strings to remove from the asset.
|
|
549
|
+
*/
|
|
550
|
+
remove_tags?: Array<string>;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* Array of custom metadata field updates.
|
|
554
|
+
*/
|
|
555
|
+
set_metadata?: Array<OnNo.SetMetadata>;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Array of custom metadata fields to remove.
|
|
559
|
+
*/
|
|
560
|
+
unset_metadata?: Array<OnNo.UnsetMetadata>;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
export namespace OnNo {
|
|
564
|
+
export interface SetMetadata {
|
|
565
|
+
/**
|
|
566
|
+
* Name of the custom metadata field to set.
|
|
567
|
+
*/
|
|
568
|
+
field: string;
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Value to set for the custom metadata field. The value type should match the
|
|
572
|
+
* custom metadata field type.
|
|
573
|
+
*/
|
|
574
|
+
value: string | number | boolean | Array<string | number | boolean>;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
export interface UnsetMetadata {
|
|
578
|
+
/**
|
|
579
|
+
* Name of the custom metadata field to remove.
|
|
580
|
+
*/
|
|
581
|
+
field: string;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Actions to execute if the AI cannot determine the answer.
|
|
587
|
+
*/
|
|
588
|
+
export interface OnUnknown {
|
|
589
|
+
/**
|
|
590
|
+
* Array of tag strings to add to the asset.
|
|
591
|
+
*/
|
|
592
|
+
add_tags?: Array<string>;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Array of tag strings to remove from the asset.
|
|
596
|
+
*/
|
|
597
|
+
remove_tags?: Array<string>;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Array of custom metadata field updates.
|
|
601
|
+
*/
|
|
602
|
+
set_metadata?: Array<OnUnknown.SetMetadata>;
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Array of custom metadata fields to remove.
|
|
606
|
+
*/
|
|
607
|
+
unset_metadata?: Array<OnUnknown.UnsetMetadata>;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
export namespace OnUnknown {
|
|
611
|
+
export interface SetMetadata {
|
|
612
|
+
/**
|
|
613
|
+
* Name of the custom metadata field to set.
|
|
614
|
+
*/
|
|
615
|
+
field: string;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Value to set for the custom metadata field. The value type should match the
|
|
619
|
+
* custom metadata field type.
|
|
620
|
+
*/
|
|
621
|
+
value: string | number | boolean | Array<string | number | boolean>;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
export interface UnsetMetadata {
|
|
625
|
+
/**
|
|
626
|
+
* Name of the custom metadata field to remove.
|
|
627
|
+
*/
|
|
628
|
+
field: string;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* Actions to execute if the AI answers yes.
|
|
634
|
+
*/
|
|
635
|
+
export interface OnYes {
|
|
636
|
+
/**
|
|
637
|
+
* Array of tag strings to add to the asset.
|
|
638
|
+
*/
|
|
639
|
+
add_tags?: Array<string>;
|
|
640
|
+
|
|
641
|
+
/**
|
|
642
|
+
* Array of tag strings to remove from the asset.
|
|
643
|
+
*/
|
|
644
|
+
remove_tags?: Array<string>;
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Array of custom metadata field updates.
|
|
648
|
+
*/
|
|
649
|
+
set_metadata?: Array<OnYes.SetMetadata>;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Array of custom metadata fields to remove.
|
|
653
|
+
*/
|
|
654
|
+
unset_metadata?: Array<OnYes.UnsetMetadata>;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export namespace OnYes {
|
|
658
|
+
export interface SetMetadata {
|
|
659
|
+
/**
|
|
660
|
+
* Name of the custom metadata field to set.
|
|
661
|
+
*/
|
|
662
|
+
field: string;
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Value to set for the custom metadata field. The value type should match the
|
|
666
|
+
* custom metadata field type.
|
|
667
|
+
*/
|
|
668
|
+
value: string | number | boolean | Array<string | number | boolean>;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export interface UnsetMetadata {
|
|
672
|
+
/**
|
|
673
|
+
* Name of the custom metadata field to remove.
|
|
674
|
+
*/
|
|
675
|
+
field: string;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
export interface SavedExtension {
|
|
682
|
+
/**
|
|
683
|
+
* The unique ID of the saved extension to apply.
|
|
684
|
+
*/
|
|
685
|
+
id: string;
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Indicates this is a reference to a saved extension.
|
|
689
|
+
*/
|
|
690
|
+
name: 'saved-extension';
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Options for generating responsive image attributes including `src`, `srcSet`,
|
|
696
|
+
* and `sizes` for HTML `<img>` elements. This schema extends `SrcOptions` to add
|
|
697
|
+
* support for responsive image generation with breakpoints.
|
|
698
|
+
*/
|
|
699
|
+
export interface GetImageAttributesOptions extends SrcOptions {
|
|
700
|
+
/**
|
|
701
|
+
* Custom list of **device-width breakpoints** in pixels. These define common
|
|
702
|
+
* screen widths for responsive image generation.
|
|
703
|
+
*
|
|
704
|
+
* Defaults to `[640, 750, 828, 1080, 1200, 1920, 2048, 3840]`. Sorted
|
|
705
|
+
* automatically.
|
|
706
|
+
*/
|
|
707
|
+
deviceBreakpoints?: Array<number>;
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Custom list of **image-specific breakpoints** in pixels. Useful for generating
|
|
711
|
+
* small variants (e.g., placeholders or thumbnails).
|
|
712
|
+
*
|
|
713
|
+
* Merged with `deviceBreakpoints` before calculating `srcSet`. Defaults to
|
|
714
|
+
* `[16, 32, 48, 64, 96, 128, 256, 384]`. Sorted automatically.
|
|
715
|
+
*/
|
|
716
|
+
imageBreakpoints?: Array<number>;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* The value for the HTML `sizes` attribute (e.g., `"100vw"` or
|
|
720
|
+
* `"(min-width:768px) 50vw, 100vw"`).
|
|
721
|
+
*
|
|
722
|
+
* - If it includes one or more `vw` units, breakpoints smaller than the
|
|
723
|
+
* corresponding percentage of the smallest device width are excluded.
|
|
724
|
+
* - If it contains no `vw` units, the full breakpoint list is used.
|
|
725
|
+
*
|
|
726
|
+
* Enables a width-based strategy and generates `w` descriptors in `srcSet`.
|
|
727
|
+
*/
|
|
728
|
+
sizes?: string;
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* The intended display width of the image in pixels, used **only when the `sizes`
|
|
732
|
+
* attribute is not provided**.
|
|
733
|
+
*
|
|
734
|
+
* Triggers a DPR-based strategy (1x and 2x variants) and generates `x` descriptors
|
|
735
|
+
* in `srcSet`.
|
|
736
|
+
*
|
|
737
|
+
* Ignored if `sizes` is present.
|
|
738
|
+
*/
|
|
739
|
+
width?: number;
|
|
79
740
|
}
|
|
80
741
|
|
|
81
742
|
export interface ImageOverlay extends BaseOverlay {
|
|
@@ -92,6 +753,12 @@ export interface ImageOverlay extends BaseOverlay {
|
|
|
92
753
|
* format automatically. To always use base64 encoding (`ie-{base64}`), set this
|
|
93
754
|
* parameter to `base64`. To always use plain text (`i-{input}`), set it to
|
|
94
755
|
* `plain`.
|
|
756
|
+
*
|
|
757
|
+
* Regardless of the encoding method:
|
|
758
|
+
*
|
|
759
|
+
* - Leading and trailing slashes are removed.
|
|
760
|
+
* - Remaining slashes within the path are replaced with `@@` when using plain
|
|
761
|
+
* text.
|
|
95
762
|
*/
|
|
96
763
|
encoding?: 'auto' | 'plain' | 'base64';
|
|
97
764
|
|
|
@@ -175,6 +842,70 @@ export interface OverlayTiming {
|
|
|
175
842
|
start?: number | string;
|
|
176
843
|
}
|
|
177
844
|
|
|
845
|
+
/**
|
|
846
|
+
* Resulting set of attributes suitable for an HTML `<img>` element. Useful for
|
|
847
|
+
* enabling responsive image loading with `srcSet` and `sizes`.
|
|
848
|
+
*/
|
|
849
|
+
export interface ResponsiveImageAttributes {
|
|
850
|
+
/**
|
|
851
|
+
* URL for the _largest_ candidate (assigned to plain `src`).
|
|
852
|
+
*/
|
|
853
|
+
src: string;
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* `sizes` returned (or synthesised as `100vw`). The value for the HTML `sizes`
|
|
857
|
+
* attribute.
|
|
858
|
+
*/
|
|
859
|
+
sizes?: string;
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* Candidate set with `w` or `x` descriptors. Multiple image URLs separated by
|
|
863
|
+
* commas, each with a descriptor.
|
|
864
|
+
*/
|
|
865
|
+
srcSet?: string;
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Width as a number (if `width` was provided in the input options).
|
|
869
|
+
*/
|
|
870
|
+
width?: number;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Saved extension object containing extension configuration.
|
|
875
|
+
*/
|
|
876
|
+
export interface SavedExtension {
|
|
877
|
+
/**
|
|
878
|
+
* Unique identifier of the saved extension.
|
|
879
|
+
*/
|
|
880
|
+
id?: string;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* Configuration object for an extension (base extensions only, not saved extension
|
|
884
|
+
* references).
|
|
885
|
+
*/
|
|
886
|
+
config?: ExtensionConfig;
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Timestamp when the saved extension was created.
|
|
890
|
+
*/
|
|
891
|
+
createdAt?: string;
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Description of the saved extension.
|
|
895
|
+
*/
|
|
896
|
+
description?: string;
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Name of the saved extension.
|
|
900
|
+
*/
|
|
901
|
+
name?: string;
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Timestamp when the saved extension was last updated.
|
|
905
|
+
*/
|
|
906
|
+
updatedAt?: string;
|
|
907
|
+
}
|
|
908
|
+
|
|
178
909
|
export interface SolidColorOverlay extends BaseOverlay {
|
|
179
910
|
/**
|
|
180
911
|
* Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA
|
|
@@ -198,8 +929,8 @@ export interface SolidColorOverlay extends BaseOverlay {
|
|
|
198
929
|
|
|
199
930
|
export interface SolidColorOverlayTransformation {
|
|
200
931
|
/**
|
|
201
|
-
* Specifies the transparency level of the solid color
|
|
202
|
-
* from `1` to `9`.
|
|
932
|
+
* Specifies the transparency level of the overlaid solid color layer. Supports
|
|
933
|
+
* integers from `1` to `9`.
|
|
203
934
|
*/
|
|
204
935
|
alpha?: number;
|
|
205
936
|
|
|
@@ -225,11 +956,16 @@ export interface SolidColorOverlayTransformation {
|
|
|
225
956
|
height?: number | string;
|
|
226
957
|
|
|
227
958
|
/**
|
|
228
|
-
* Specifies the corner radius of the solid color overlay.
|
|
229
|
-
*
|
|
230
|
-
*
|
|
959
|
+
* Specifies the corner radius of the solid color overlay.
|
|
960
|
+
*
|
|
961
|
+
* - Single value (positive integer): Applied to all corners (e.g., `20`).
|
|
962
|
+
* - `max`: Creates a circular or oval shape.
|
|
963
|
+
* - Per-corner array: Provide four underscore-separated values representing
|
|
964
|
+
* top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
|
|
965
|
+
* `10_20_30_40`). See
|
|
966
|
+
* [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
|
|
231
967
|
*/
|
|
232
|
-
radius?: number | 'max';
|
|
968
|
+
radius?: number | 'max' | string;
|
|
233
969
|
|
|
234
970
|
/**
|
|
235
971
|
* Controls the width of the solid color overlay. Accepts a numeric value or an
|
|
@@ -324,6 +1060,12 @@ export interface SubtitleOverlay extends BaseOverlay {
|
|
|
324
1060
|
* format automatically. To always use base64 encoding (`ie-{base64}`), set this
|
|
325
1061
|
* parameter to `base64`. To always use plain text (`i-{input}`), set it to
|
|
326
1062
|
* `plain`.
|
|
1063
|
+
*
|
|
1064
|
+
* Regardless of the encoding method:
|
|
1065
|
+
*
|
|
1066
|
+
* - Leading and trailing slashes are removed.
|
|
1067
|
+
* - Remaining slashes within the path are replaced with `@@` when using plain
|
|
1068
|
+
* text.
|
|
327
1069
|
*/
|
|
328
1070
|
encoding?: 'auto' | 'plain' | 'base64';
|
|
329
1071
|
|
|
@@ -357,8 +1099,9 @@ export interface SubtitleOverlayTransformation {
|
|
|
357
1099
|
color?: string;
|
|
358
1100
|
|
|
359
1101
|
/**
|
|
360
|
-
*
|
|
361
|
-
* [supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list)
|
|
1102
|
+
* Sets the font family of subtitle text. Refer to the
|
|
1103
|
+
* [supported fonts documented](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list)
|
|
1104
|
+
* in the ImageKit transformations guide.
|
|
362
1105
|
*/
|
|
363
1106
|
fontFamily?: string;
|
|
364
1107
|
|
|
@@ -416,6 +1159,9 @@ export interface TextOverlay extends BaseOverlay {
|
|
|
416
1159
|
* appropriate format based on the input text. To always use base64
|
|
417
1160
|
* (`ie-{base64}`), set this parameter to `base64`. To always use plain text
|
|
418
1161
|
* (`i-{input}`), set it to `plain`.
|
|
1162
|
+
*
|
|
1163
|
+
* Regardless of the encoding method, the input text is always percent-encoded to
|
|
1164
|
+
* ensure it is URL-safe.
|
|
419
1165
|
*/
|
|
420
1166
|
encoding?: 'auto' | 'plain' | 'base64';
|
|
421
1167
|
|
|
@@ -440,7 +1186,9 @@ export interface TextOverlayTransformation {
|
|
|
440
1186
|
background?: string;
|
|
441
1187
|
|
|
442
1188
|
/**
|
|
443
|
-
* Flip the text
|
|
1189
|
+
* Flip/mirror the text horizontally, vertically, or in both directions. Acceptable
|
|
1190
|
+
* values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or
|
|
1191
|
+
* `v_h`.
|
|
444
1192
|
*/
|
|
445
1193
|
flip?: 'h' | 'v' | 'h_v' | 'v_h';
|
|
446
1194
|
|
|
@@ -472,10 +1220,9 @@ export interface TextOverlayTransformation {
|
|
|
472
1220
|
innerAlignment?: 'left' | 'right' | 'center';
|
|
473
1221
|
|
|
474
1222
|
/**
|
|
475
|
-
* Specifies the line height
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
* such as `bw_mul_0.2`, or `bh_div_20`.
|
|
1223
|
+
* Specifies the line height for multi-line text overlays. It will come into effect
|
|
1224
|
+
* only if the text wraps over multiple lines. Accepts either an integer value or
|
|
1225
|
+
* an arithmetic expression.
|
|
479
1226
|
*/
|
|
480
1227
|
lineHeight?: number | string;
|
|
481
1228
|
|
|
@@ -487,10 +1234,16 @@ export interface TextOverlayTransformation {
|
|
|
487
1234
|
padding?: number | string;
|
|
488
1235
|
|
|
489
1236
|
/**
|
|
490
|
-
* Specifies the corner radius
|
|
491
|
-
*
|
|
1237
|
+
* Specifies the corner radius:
|
|
1238
|
+
*
|
|
1239
|
+
* - Single value (positive integer): Applied to all corners (e.g., `20`).
|
|
1240
|
+
* - `max`: Creates a circular or oval shape.
|
|
1241
|
+
* - Per-corner array: Provide four underscore-separated values representing
|
|
1242
|
+
* top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
|
|
1243
|
+
* `10_20_30_40`). See
|
|
1244
|
+
* [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
|
|
492
1245
|
*/
|
|
493
|
-
radius?: number | 'max';
|
|
1246
|
+
radius?: number | 'max' | string;
|
|
494
1247
|
|
|
495
1248
|
/**
|
|
496
1249
|
* Specifies the rotation angle of the text overlay. Accepts a numeric value for
|
|
@@ -608,6 +1361,12 @@ export interface Transformation {
|
|
|
608
1361
|
*
|
|
609
1362
|
* - A solid color: e.g., `red`, `F3F3F3`, `AAFF0010`. See
|
|
610
1363
|
* [Solid color background](https://imagekit.io/docs/effects-and-enhancements#solid-color-background).
|
|
1364
|
+
* - Dominant color: `dominant` extracts the dominant color from the image. See
|
|
1365
|
+
* [Dominant color background](https://imagekit.io/docs/effects-and-enhancements#dominant-color-background).
|
|
1366
|
+
* - Gradient: `gradient_dominant` or `gradient_dominant_2` creates a gradient
|
|
1367
|
+
* using the dominant colors. Optionally specify palette size (2 or 4), e.g.,
|
|
1368
|
+
* `gradient_dominant_4`. See
|
|
1369
|
+
* [Gradient background](https://imagekit.io/docs/effects-and-enhancements#gradient-background).
|
|
611
1370
|
* - A blurred background: e.g., `blurred`, `blurred_25_N15`, etc. See
|
|
612
1371
|
* [Blurred background](https://imagekit.io/docs/effects-and-enhancements#blurred-background).
|
|
613
1372
|
* - Expand the image boundaries using generative fill: `genfill`. Not supported
|
|
@@ -639,6 +1398,18 @@ export interface Transformation {
|
|
|
639
1398
|
*/
|
|
640
1399
|
colorProfile?: boolean;
|
|
641
1400
|
|
|
1401
|
+
/**
|
|
1402
|
+
* Replaces colors in the image. Supports three formats:
|
|
1403
|
+
*
|
|
1404
|
+
* - `toColor` - Replace dominant color with the specified color.
|
|
1405
|
+
* - `toColor_tolerance` - Replace dominant color with specified tolerance (0-100).
|
|
1406
|
+
* - `toColor_tolerance_fromColor` - Replace a specific color with another within
|
|
1407
|
+
* tolerance range. Colors can be hex codes (e.g., `FF0022`) or names (e.g.,
|
|
1408
|
+
* `red`, `blue`). See
|
|
1409
|
+
* [Color replacement](https://imagekit.io/docs/effects-and-enhancements#color-replace---cr).
|
|
1410
|
+
*/
|
|
1411
|
+
colorReplace?: string;
|
|
1412
|
+
|
|
642
1413
|
/**
|
|
643
1414
|
* Automatically enhances the contrast of an image (contrast stretch). See
|
|
644
1415
|
* [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast).
|
|
@@ -664,10 +1435,24 @@ export interface Transformation {
|
|
|
664
1435
|
*/
|
|
665
1436
|
defaultImage?: string;
|
|
666
1437
|
|
|
1438
|
+
/**
|
|
1439
|
+
* Distorts the shape of an image. Supports two modes:
|
|
1440
|
+
*
|
|
1441
|
+
* - Perspective distortion: `p-x1_y1_x2_y2_x3_y3_x4_y4` changes the position of
|
|
1442
|
+
* the four corners starting clockwise from top-left.
|
|
1443
|
+
* - Arc distortion: `a-degrees` curves the image upwards (positive values) or
|
|
1444
|
+
* downwards (negative values). See
|
|
1445
|
+
* [Distort effect](https://imagekit.io/docs/effects-and-enhancements#distort---e-distort).
|
|
1446
|
+
*/
|
|
1447
|
+
distort?: string;
|
|
1448
|
+
|
|
667
1449
|
/**
|
|
668
1450
|
* Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio
|
|
669
|
-
* (DPR) calculation.
|
|
670
|
-
*
|
|
1451
|
+
* (DPR) calculation. Also accepts arithmetic expressions.
|
|
1452
|
+
*
|
|
1453
|
+
* - Learn about
|
|
1454
|
+
* [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
|
|
1455
|
+
* - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr).
|
|
671
1456
|
*/
|
|
672
1457
|
dpr?: number;
|
|
673
1458
|
|
|
@@ -806,11 +1591,16 @@ export interface Transformation {
|
|
|
806
1591
|
quality?: number;
|
|
807
1592
|
|
|
808
1593
|
/**
|
|
809
|
-
* Specifies the corner radius for rounded corners
|
|
810
|
-
*
|
|
811
|
-
*
|
|
1594
|
+
* Specifies the corner radius for rounded corners.
|
|
1595
|
+
*
|
|
1596
|
+
* - Single value (positive integer): Applied to all corners (e.g., `20`).
|
|
1597
|
+
* - `max`: Creates a circular or oval shape.
|
|
1598
|
+
* - Per-corner array: Provide four underscore-separated values representing
|
|
1599
|
+
* top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
|
|
1600
|
+
* `10_20_30_40`). See
|
|
1601
|
+
* [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
|
|
812
1602
|
*/
|
|
813
|
-
radius?: number | 'max';
|
|
1603
|
+
radius?: number | 'max' | string;
|
|
814
1604
|
|
|
815
1605
|
/**
|
|
816
1606
|
* Pass any transformation not directly supported by the SDK. This transformation
|
|
@@ -940,6 +1730,12 @@ export interface VideoOverlay extends BaseOverlay {
|
|
|
940
1730
|
* format automatically. To always use base64 encoding (`ie-{base64}`), set this
|
|
941
1731
|
* parameter to `base64`. To always use plain text (`i-{input}`), set it to
|
|
942
1732
|
* `plain`.
|
|
1733
|
+
*
|
|
1734
|
+
* Regardless of the encoding method:
|
|
1735
|
+
*
|
|
1736
|
+
* - Leading and trailing slashes are removed.
|
|
1737
|
+
* - Remaining slashes within the path are replaced with `@@` when using plain
|
|
1738
|
+
* text.
|
|
943
1739
|
*/
|
|
944
1740
|
encoding?: 'auto' | 'plain' | 'base64';
|
|
945
1741
|
|