Skip to content

Commit 0d105fb

Browse files
imagekitioahnv
andauthored
Update src/interfaces/Transformation.ts
Co-authored-by: Abhinav Dhiman <[email protected]>
1 parent 7d7837a commit 0d105fb

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

src/interfaces/Transformation.ts

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,50 @@ export interface Transformation {
1111
* The width of the output. If a value between 0 and 1 is used, it’s treated
1212
* as a percentage (e.g., `0.4` -> 40% of original width). You can also supply
1313
* arithmetic expressions (e.g., `"iw_div_2"`).
14+
*
15+
* {@link https://imagekit.io/docs/image-resize-and-crop#width---w}
1416
*/
1517
width?: number | string;
1618

1719
/**
1820
* The height of the output. If a value between 0 and 1 is used, it’s treated
1921
* as a percentage (e.g., `0.5` -> 50% of original height). You can also supply
2022
* arithmetic expressions (e.g., `"ih_mul_0.5"`).
23+
*
24+
* {@link https://imagekit.io/docs/image-resize-and-crop#height---h}
2125
*/
2226
height?: number | string;
2327

2428
/**
2529
* Specifies the aspect ratio for the output, e.g., `"ar-4-3"`.
2630
* Typically used with either width or height (not both).
2731
* Example usage: `aspectRatio = "4:3"` or `"4_3"` or an expression like `"iar_div_2"`.
32+
*
33+
* {@link https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar}
2834
*/
2935
aspectRatio?: number | string;
3036

3137
/**
3238
* Specify the background that can be used along with some cropping strategies while resizing an image:
3339
* - A solid color: `"red"`, `"F3F3F3"`, `"AAFF0010"`.
40+
*
41+
* {@link https://imagekit.io/docs/effects-and-enhancements#solid-color-background}
42+
*
3443
* - A blurred background: `"blurred"`, `"blurred_25_N15"`, etc.
44+
*
45+
* {@link https://imagekit.io/docs/effects-and-enhancements#blurred-background}
46+
*
3547
* - Expand the image boundaries using generative fill: `genfill`. Optionally control the background scene by passing text prompt: `genfill[:-prompt-${text}]` or `genfill[:-prompte-${urlencoded_base64_encoded_text}]`.
48+
*
49+
* {@link https://imagekit.io/docs/ai-transformations#generative-fill-bg-genfill}
3650
*/
3751
background?: string;
3852

3953
/**
4054
* Add a border to the output media. Accepts `<border-width>_<hex-code>`,
4155
* e.g. `"5_FFF000"` (5px yellow border), or an expression like `"ih_div_20_FF00FF"`.
56+
*
57+
* {@link https://imagekit.io/docs/effects-and-enhancements#border---b}
4258
*/
4359
border?: string;
4460

@@ -68,6 +84,8 @@ export interface Transformation {
6884

6985
/**
7086
* Used to specify the quality of the output image for lossy formats like JPEG, WebP, and AVIF. A large quality number indicates a larger output image size with high quality. A small quality number indicates a smaller output image size with lower quality.
87+
*
88+
* {@link https://imagekit.io/docs/image-optimization#quality---q}
7189
*/
7290
quality?: number;
7391

@@ -94,33 +112,45 @@ export interface Transformation {
94112
/**
95113
* Output format for images or videos, e.g., `"jpg"`, `"png"`, `"webp"`, `"mp4"`, `"auto"`.
96114
* ImageKit will automatically determine the format based on device support even if you do not specify it.
115+
*
116+
* {@link https://imagekit.io/docs/image-optimization#format---f}
97117
*/
98118
format?: string;
99119

100120
/**
101121
* Video codec, e.g., `"h264"`, `"vp9"`, `"av1"`.
122+
*
123+
* {@link https://imagekit.io/docs/video-optimization#video-codec---vc}
102124
*/
103125
videoCodec?: string;
104126

105127
/**
106128
* Audio codec, e.g., `"aac"`, `"opus"`.
129+
*
130+
* {@link https://imagekit.io/docs/video-optimization#audio-codec---ac}
107131
*/
108132
audioCodec?: string;
109133

110134
/**
111135
* Corner radius for rounded corners (e.g., `20`) or `"max"` for circular/oval shapes.
136+
*
137+
* {@link https://imagekit.io/docs/effects-and-enhancements#radius---r}
112138
*/
113139
radius?: number | "max";
114140

115141
/**
116142
* Rotation in degrees. Positive values rotate clockwise; you can
117143
* also use e.g. `"N40"` for counterclockwise or `"auto"` to read EXIF data.
118144
* For videos only 0 , 90 , 180 , 270 and 360 values are supported.
145+
*
146+
* {@link https://imagekit.io/docs/effects-and-enhancements#rotate---rt}
119147
*/
120148
rotation?: number | string;
121149

122150
/**
123151
* Gaussian blur level. Ranges 1–100 or an expression like `"bl-10"`. Possible values include integers between 1 and 100.
152+
*
153+
* {@link https://imagekit.io/docs/effects-and-enhancements#blur---bl}
124154
*/
125155
blur?: number;
126156

@@ -139,31 +169,41 @@ export interface Transformation {
139169
/**
140170
* It is used to flip/mirror an image horizontally, vertically, or in both directions.
141171
* Possible values - h (horizontal), v (vertical), h_v (horizontal and vertical)
172+
*
173+
* {@link https://imagekit.io/docs/effects-and-enhancements#flip---fl}
142174
*/
143175
flip?: "h" | "v" | "h_v" | "v_h";
144176

145177
/**
146178
* Whether to serve the original file without any transformations if `true`.
179+
*
180+
* {@link https://imagekit.io/docs/core-delivery-features#deliver-original-file-as-is---orig-true}
147181
*/
148182
original?: boolean;
149183

150184
/**
151185
* Start offset (in seconds) for trimming videos. e.g., `5` or `"10.5"`.
152186
* Also supports arithmetic expressions.
187+
*
188+
* {@link https://imagekit.io/docs/trim-videos#start-offset---so}
153189
*/
154190
startOffset?: number | string;
155191

156192
/**
157193
* End offset (in seconds) for trimming videos. e.g., `5` or `"10.5"`.
158194
* Usually used with `startOffset` to define a time window.
159195
* Also supports arithmetic expressions.
196+
*
197+
* {@link https://imagekit.io/docs/trim-videos#end-offset---eo}
160198
*/
161199
endOffset?: number | string;
162200

163201
/**
164202
* Duration (in seconds) for trimming videos. e.g., `5` or `"10.5"`.
165203
* Typically used with `startOffset` to specify length from the start point.
166204
* Also supports arithmetic expressions.
205+
*
206+
* {@link https://imagekit.io/docs/trim-videos#duration---du}
167207
*/
168208
duration?: number | string;
169209

@@ -177,26 +217,36 @@ export interface Transformation {
177217

178218
/**
179219
* Enable grayscale effect for images.
220+
*
221+
* {@link https://imagekit.io/docs/effects-and-enhancements#grayscale---e-grayscale}
180222
*/
181223
grayscale?: true;
182224

183225
/**
184226
* Use third-party background removal. Use `removeBackground` - ImageKit's in-house background removal which is 90% cheaper.
227+
*
228+
* {@link https://imagekit.io/docs/ai-transformations#background-removal-e-removedotbg}
185229
*/
186230
aiBGRemoveExternal?: true
187231

188232
/**
189233
* Upscale images beyond their original dimensions with AI.
234+
*
235+
* {@link https://imagekit.io/docs/ai-transformations#upscale-e-upscale}
190236
*/
191237
aiUpscale?: true
192238

193239
/**
194240
* Retouch (AI-based) for improving faces or product shots.
241+
*
242+
* {@link https://imagekit.io/docs/ai-transformations#retouch-e-retouch}
195243
*/
196244
aiRetouch?: true
197245

198246
/**
199247
* Generate variation of an image using AI. This will generate a new image with slight variations from the original image. The variations include changes in color, texture, and other visual elements. However, the model will try to preserve the structure and essence of the original image.
248+
*
249+
* {@link https://imagekit.io/docs/ai-transformations#generate-variations-of-an-image-e-genvar}
200250
*/
201251
aiVariation?: true
202252

@@ -210,16 +260,22 @@ export interface Transformation {
210260

211261
/**
212262
* Change background using AI. Provide a prompt or base64-encoded prompt. e.g. `prompt-snow road` or `prompte-[urlencoded_base64_encoded_text]`.
263+
*
264+
* {@link https://imagekit.io/docs/ai-transformations#change-background-e-changebg}
213265
*/
214266
aiChangeBackground?: string;
215267

216268
/**
217269
* ImageKit’s in-house background removal.
270+
*
271+
* {@link https://imagekit.io/docs/ai-transformations#imagekit-background-removal-e-bgremove}
218272
*/
219273
aiRemoveBackground?: true
220274

221275
/**
222276
* Auto-enhance contrast for an image (contrast stretch).
277+
*
278+
* {@link https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast}
223279
*/
224280
contrastStretch?: true
225281

@@ -239,6 +295,8 @@ export interface Transformation {
239295

240296
/**
241297
* Unsharp Masking (USM) is an image sharpening technique. This transform allows you to apply and control unsharp masks on your images.
298+
*
299+
* {@link https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm}
242300
*/
243301
unsharpMask?: string;
244302

@@ -251,21 +309,29 @@ export interface Transformation {
251309

252310
/**
253311
* Used to specify whether the output JPEG image must be rendered progressively. In progressive loading, the output image renders as a low-quality pixelated full image, which, over time, keeps on adding more pixels and information to the image. This helps you maintain a fast perceived load time.
312+
*
313+
* {@link https://imagekit.io/docs/image-optimization#progressive-image---pr}
254314
*/
255315
progressive?: boolean;
256316

257317
/**
258318
* Used to specify whether the output image (if in JPEG or PNG) must be compressed losslessly.
319+
*
320+
* {@link https://imagekit.io/docs/image-optimization#lossless-webp-and-png---lo}
259321
*/
260322
lossless?: boolean
261323

262324
/**
263325
* It specifies whether the output image should contain the color profile initially available with the original image.
326+
*
327+
* {@link https://imagekit.io/docs/image-optimization#color-profile---cp}
264328
*/
265329
colorProfile?: boolean;
266330

267331
/**
268332
* By default, ImageKit removes all metadata as part of automatic image compression. Set this to `true` to preserve metadata.
333+
*
334+
* {@link https://imagekit.io/docs/image-optimization#image-metadata---md}
269335
*/
270336
metadata?: boolean;
271337

@@ -343,3 +409,4 @@ export interface Transformation {
343409
effectGradient?: string;
344410
}
345411

412+

0 commit comments

Comments
 (0)