-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathshared.ts
More file actions
1748 lines (1514 loc) · 57.2 KB
/
shared.ts
File metadata and controls
1748 lines (1514 loc) · 57.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
export interface BaseOverlay {
/**
* Controls how the layer blends with the base image or underlying content. Maps to
* `lm` in the URL. By default, layers completely cover the base image beneath
* them. Layer modes change this behavior:
*
* - `multiply`: Multiplies the pixel values of the layer with the base image. The
* result is always darker than the original images. This is ideal for applying
* shadows or color tints.
* - `displace`: Uses the layer as a displacement map to distort pixels in the base
* image. The red channel controls horizontal displacement, and the green channel
* controls vertical displacement. Requires `x` or `y` parameter to control
* displacement magnitude.
* - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the
* base image transparent, while transparent areas leave the base image
* unchanged. This mode functions like a hole-punch, effectively cutting the
* shape of the layer out of the underlying image.
* - `cutter`: Acts as a shape mask where only the parts of the base image that
* fall inside the opaque area of the layer are preserved. This mode functions
* like a cookie-cutter, trimming the base image to match the specific dimensions
* and shape of the layer. See
* [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes).
*/
layerMode?: 'multiply' | 'cutter' | 'cutout' | 'displace';
/**
* Specifies the overlay's position relative to the parent asset. See
* [Position of Layer](https://imagekit.io/docs/transformations#position-of-layer).
*/
position?: OverlayPosition;
/**
* Specifies timing information for the overlay (only applicable if the base asset
* is a video). See
* [Position of Layer](https://imagekit.io/docs/transformations#position-of-layer).
*/
timing?: OverlayTiming;
}
/**
* Configuration object for an extension (base extensions only, not saved extension
* references).
*/
export type ExtensionConfig =
| ExtensionConfig.RemoveBg
| ExtensionConfig.AutoTaggingExtension
| ExtensionConfig.AIAutoDescription
| ExtensionConfig.AITasks;
export namespace ExtensionConfig {
export interface RemoveBg {
/**
* Specifies the background removal extension.
*/
name: 'remove-bg';
options?: RemoveBg.Options;
}
export namespace RemoveBg {
export interface Options {
/**
* Whether to add an artificial shadow to the result. Default is false. Note:
* Adding shadows is currently only supported for car photos.
*/
add_shadow?: boolean;
/**
* Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
* color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
* empty.
*/
bg_color?: string;
/**
* Sets a background image from a URL. If this parameter is set, `bg_color` must be
* empty.
*/
bg_image_url?: string;
/**
* Allows semi-transparent regions in the result. Default is true. Note:
* Semitransparency is currently only supported for car windows.
*/
semitransparency?: boolean;
}
}
export interface AutoTaggingExtension {
/**
* Maximum number of tags to attach to the asset.
*/
maxTags: number;
/**
* Minimum confidence level for tags to be considered valid.
*/
minConfidence: number;
/**
* Specifies the auto-tagging extension used.
*/
name: 'google-auto-tagging' | 'aws-auto-tagging';
}
export interface AIAutoDescription {
/**
* Specifies the auto description extension.
*/
name: 'ai-auto-description';
}
export interface AITasks {
/**
* Specifies the AI tasks extension for automated image analysis using AI models.
*/
name: 'ai-tasks';
/**
* Array of task objects defining AI operations to perform on the asset.
*/
tasks: Array<AITasks.SelectTags | AITasks.SelectMetadata | AITasks.YesNo>;
}
export namespace AITasks {
export interface SelectTags {
/**
* The question or instruction for the AI to analyze the image.
*/
instruction: string;
/**
* Task type that analyzes the image and adds matching tags from a vocabulary.
*/
type: 'select_tags';
/**
* Maximum number of tags to select from the vocabulary.
*/
max_selections?: number;
/**
* Minimum number of tags to select from the vocabulary.
*/
min_selections?: number;
/**
* Array of possible tag values. Combined length of all strings must not exceed 500
* characters. Cannot contain the `%` character.
*/
vocabulary?: Array<string>;
}
export interface SelectMetadata {
/**
* Name of the custom metadata field to set. The field must exist in your account.
*/
field: string;
/**
* The question or instruction for the AI to analyze the image.
*/
instruction: string;
/**
* Task type that analyzes the image and sets a custom metadata field value from a
* vocabulary.
*/
type: 'select_metadata';
/**
* Maximum number of values to select from the vocabulary.
*/
max_selections?: number;
/**
* Minimum number of values to select from the vocabulary.
*/
min_selections?: number;
/**
* Array of possible values matching the custom metadata field type.
*/
vocabulary?: Array<string | number | boolean>;
}
export interface YesNo {
/**
* The yes/no question for the AI to answer about the image.
*/
instruction: string;
/**
* Task type that asks a yes/no question and executes actions based on the answer.
*/
type: 'yes_no';
/**
* Actions to execute if the AI answers no.
*/
on_no?: YesNo.OnNo;
/**
* Actions to execute if the AI cannot determine the answer.
*/
on_unknown?: YesNo.OnUnknown;
/**
* Actions to execute if the AI answers yes.
*/
on_yes?: YesNo.OnYes;
}
export namespace YesNo {
/**
* Actions to execute if the AI answers no.
*/
export interface OnNo {
/**
* Array of tag strings to add to the asset.
*/
add_tags?: Array<string>;
/**
* Array of tag strings to remove from the asset.
*/
remove_tags?: Array<string>;
/**
* Array of custom metadata field updates.
*/
set_metadata?: Array<OnNo.SetMetadata>;
/**
* Array of custom metadata fields to remove.
*/
unset_metadata?: Array<OnNo.UnsetMetadata>;
}
export namespace OnNo {
export interface SetMetadata {
/**
* Name of the custom metadata field to set.
*/
field: string;
/**
* Value to set for the custom metadata field. The value type should match the
* custom metadata field type.
*/
value: string | number | boolean | Array<string | number | boolean>;
}
export interface UnsetMetadata {
/**
* Name of the custom metadata field to remove.
*/
field: string;
}
}
/**
* Actions to execute if the AI cannot determine the answer.
*/
export interface OnUnknown {
/**
* Array of tag strings to add to the asset.
*/
add_tags?: Array<string>;
/**
* Array of tag strings to remove from the asset.
*/
remove_tags?: Array<string>;
/**
* Array of custom metadata field updates.
*/
set_metadata?: Array<OnUnknown.SetMetadata>;
/**
* Array of custom metadata fields to remove.
*/
unset_metadata?: Array<OnUnknown.UnsetMetadata>;
}
export namespace OnUnknown {
export interface SetMetadata {
/**
* Name of the custom metadata field to set.
*/
field: string;
/**
* Value to set for the custom metadata field. The value type should match the
* custom metadata field type.
*/
value: string | number | boolean | Array<string | number | boolean>;
}
export interface UnsetMetadata {
/**
* Name of the custom metadata field to remove.
*/
field: string;
}
}
/**
* Actions to execute if the AI answers yes.
*/
export interface OnYes {
/**
* Array of tag strings to add to the asset.
*/
add_tags?: Array<string>;
/**
* Array of tag strings to remove from the asset.
*/
remove_tags?: Array<string>;
/**
* Array of custom metadata field updates.
*/
set_metadata?: Array<OnYes.SetMetadata>;
/**
* Array of custom metadata fields to remove.
*/
unset_metadata?: Array<OnYes.UnsetMetadata>;
}
export namespace OnYes {
export interface SetMetadata {
/**
* Name of the custom metadata field to set.
*/
field: string;
/**
* Value to set for the custom metadata field. The value type should match the
* custom metadata field type.
*/
value: string | number | boolean | Array<string | number | boolean>;
}
export interface UnsetMetadata {
/**
* Name of the custom metadata field to remove.
*/
field: string;
}
}
}
}
}
/**
* Array of extensions to be applied to the asset. Each extension can be configured
* with specific parameters based on the extension type.
*/
export type Extensions = Array<
| Extensions.RemoveBg
| Extensions.AutoTaggingExtension
| Extensions.AIAutoDescription
| Extensions.AITasks
| Extensions.SavedExtension
>;
export namespace Extensions {
export interface RemoveBg {
/**
* Specifies the background removal extension.
*/
name: 'remove-bg';
options?: RemoveBg.Options;
}
export namespace RemoveBg {
export interface Options {
/**
* Whether to add an artificial shadow to the result. Default is false. Note:
* Adding shadows is currently only supported for car photos.
*/
add_shadow?: boolean;
/**
* Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or
* color name (e.g., "green"). If this parameter is set, `bg_image_url` must be
* empty.
*/
bg_color?: string;
/**
* Sets a background image from a URL. If this parameter is set, `bg_color` must be
* empty.
*/
bg_image_url?: string;
/**
* Allows semi-transparent regions in the result. Default is true. Note:
* Semitransparency is currently only supported for car windows.
*/
semitransparency?: boolean;
}
}
export interface AutoTaggingExtension {
/**
* Maximum number of tags to attach to the asset.
*/
maxTags: number;
/**
* Minimum confidence level for tags to be considered valid.
*/
minConfidence: number;
/**
* Specifies the auto-tagging extension used.
*/
name: 'google-auto-tagging' | 'aws-auto-tagging';
}
export interface AIAutoDescription {
/**
* Specifies the auto description extension.
*/
name: 'ai-auto-description';
}
export interface AITasks {
/**
* Specifies the AI tasks extension for automated image analysis using AI models.
*/
name: 'ai-tasks';
/**
* Array of task objects defining AI operations to perform on the asset.
*/
tasks: Array<AITasks.SelectTags | AITasks.SelectMetadata | AITasks.YesNo>;
}
export namespace AITasks {
export interface SelectTags {
/**
* The question or instruction for the AI to analyze the image.
*/
instruction: string;
/**
* Task type that analyzes the image and adds matching tags from a vocabulary.
*/
type: 'select_tags';
/**
* Maximum number of tags to select from the vocabulary.
*/
max_selections?: number;
/**
* Minimum number of tags to select from the vocabulary.
*/
min_selections?: number;
/**
* Array of possible tag values. Combined length of all strings must not exceed 500
* characters. Cannot contain the `%` character.
*/
vocabulary?: Array<string>;
}
export interface SelectMetadata {
/**
* Name of the custom metadata field to set. The field must exist in your account.
*/
field: string;
/**
* The question or instruction for the AI to analyze the image.
*/
instruction: string;
/**
* Task type that analyzes the image and sets a custom metadata field value from a
* vocabulary.
*/
type: 'select_metadata';
/**
* Maximum number of values to select from the vocabulary.
*/
max_selections?: number;
/**
* Minimum number of values to select from the vocabulary.
*/
min_selections?: number;
/**
* Array of possible values matching the custom metadata field type.
*/
vocabulary?: Array<string | number | boolean>;
}
export interface YesNo {
/**
* The yes/no question for the AI to answer about the image.
*/
instruction: string;
/**
* Task type that asks a yes/no question and executes actions based on the answer.
*/
type: 'yes_no';
/**
* Actions to execute if the AI answers no.
*/
on_no?: YesNo.OnNo;
/**
* Actions to execute if the AI cannot determine the answer.
*/
on_unknown?: YesNo.OnUnknown;
/**
* Actions to execute if the AI answers yes.
*/
on_yes?: YesNo.OnYes;
}
export namespace YesNo {
/**
* Actions to execute if the AI answers no.
*/
export interface OnNo {
/**
* Array of tag strings to add to the asset.
*/
add_tags?: Array<string>;
/**
* Array of tag strings to remove from the asset.
*/
remove_tags?: Array<string>;
/**
* Array of custom metadata field updates.
*/
set_metadata?: Array<OnNo.SetMetadata>;
/**
* Array of custom metadata fields to remove.
*/
unset_metadata?: Array<OnNo.UnsetMetadata>;
}
export namespace OnNo {
export interface SetMetadata {
/**
* Name of the custom metadata field to set.
*/
field: string;
/**
* Value to set for the custom metadata field. The value type should match the
* custom metadata field type.
*/
value: string | number | boolean | Array<string | number | boolean>;
}
export interface UnsetMetadata {
/**
* Name of the custom metadata field to remove.
*/
field: string;
}
}
/**
* Actions to execute if the AI cannot determine the answer.
*/
export interface OnUnknown {
/**
* Array of tag strings to add to the asset.
*/
add_tags?: Array<string>;
/**
* Array of tag strings to remove from the asset.
*/
remove_tags?: Array<string>;
/**
* Array of custom metadata field updates.
*/
set_metadata?: Array<OnUnknown.SetMetadata>;
/**
* Array of custom metadata fields to remove.
*/
unset_metadata?: Array<OnUnknown.UnsetMetadata>;
}
export namespace OnUnknown {
export interface SetMetadata {
/**
* Name of the custom metadata field to set.
*/
field: string;
/**
* Value to set for the custom metadata field. The value type should match the
* custom metadata field type.
*/
value: string | number | boolean | Array<string | number | boolean>;
}
export interface UnsetMetadata {
/**
* Name of the custom metadata field to remove.
*/
field: string;
}
}
/**
* Actions to execute if the AI answers yes.
*/
export interface OnYes {
/**
* Array of tag strings to add to the asset.
*/
add_tags?: Array<string>;
/**
* Array of tag strings to remove from the asset.
*/
remove_tags?: Array<string>;
/**
* Array of custom metadata field updates.
*/
set_metadata?: Array<OnYes.SetMetadata>;
/**
* Array of custom metadata fields to remove.
*/
unset_metadata?: Array<OnYes.UnsetMetadata>;
}
export namespace OnYes {
export interface SetMetadata {
/**
* Name of the custom metadata field to set.
*/
field: string;
/**
* Value to set for the custom metadata field. The value type should match the
* custom metadata field type.
*/
value: string | number | boolean | Array<string | number | boolean>;
}
export interface UnsetMetadata {
/**
* Name of the custom metadata field to remove.
*/
field: string;
}
}
}
}
export interface SavedExtension {
/**
* The unique ID of the saved extension to apply.
*/
id: string;
/**
* Indicates this is a reference to a saved extension.
*/
name: 'saved-extension';
}
}
/**
* Options for generating responsive image attributes including `src`, `srcSet`,
* and `sizes` for HTML `<img>` elements. This schema extends `SrcOptions` to add
* support for responsive image generation with breakpoints.
*/
export interface GetImageAttributesOptions extends SrcOptions {
/**
* Custom list of **device-width breakpoints** in pixels. These define common
* screen widths for responsive image generation.
*
* Defaults to `[640, 750, 828, 1080, 1200, 1920, 2048, 3840]`. Sorted
* automatically.
*/
deviceBreakpoints?: Array<number>;
/**
* Custom list of **image-specific breakpoints** in pixels. Useful for generating
* small variants (e.g., placeholders or thumbnails).
*
* Merged with `deviceBreakpoints` before calculating `srcSet`. Defaults to
* `[16, 32, 48, 64, 96, 128, 256, 384]`. Sorted automatically.
*/
imageBreakpoints?: Array<number>;
/**
* The value for the HTML `sizes` attribute (e.g., `"100vw"` or
* `"(min-width:768px) 50vw, 100vw"`).
*
* - If it includes one or more `vw` units, breakpoints smaller than the
* corresponding percentage of the smallest device width are excluded.
* - If it contains no `vw` units, the full breakpoint list is used.
*
* Enables a width-based strategy and generates `w` descriptors in `srcSet`.
*/
sizes?: string;
/**
* The intended display width of the image in pixels, used **only when the `sizes`
* attribute is not provided**.
*
* Triggers a DPR-based strategy (1x and 2x variants) and generates `x` descriptors
* in `srcSet`.
*
* Ignored if `sizes` is present.
*/
width?: number;
}
export interface ImageOverlay extends BaseOverlay {
/**
* Specifies the relative path to the image used as an overlay.
*/
input: string;
type: 'image';
/**
* The input path can be included in the layer as either `i-{input}` or
* `ie-{base64_encoded_input}`. By default, the SDK determines the appropriate
* format automatically. To always use base64 encoding (`ie-{base64}`), set this
* parameter to `base64`. To always use plain text (`i-{input}`), set it to
* `plain`.
*
* Regardless of the encoding method:
*
* - Leading and trailing slashes are removed.
* - Remaining slashes within the path are replaced with `@@` when using plain
* text.
*/
encoding?: 'auto' | 'plain' | 'base64';
/**
* Array of transformations to be applied to the overlay image. Supported
* transformations depends on the base/parent asset. See overlays on
* [Images](https://imagekit.io/docs/add-overlays-on-images#list-of-supported-image-transformations-in-image-layers)
* and
* [Videos](https://imagekit.io/docs/add-overlays-on-videos#list-of-transformations-supported-on-image-overlay).
*/
transformation?: Array<Transformation>;
}
/**
* Specifies an overlay to be applied on the parent image or video. ImageKit
* supports overlays including images, text, videos, subtitles, and solid colors.
* See
* [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers).
*/
export type Overlay = TextOverlay | ImageOverlay | VideoOverlay | SubtitleOverlay | SolidColorOverlay;
export interface OverlayPosition {
/**
* Specifies the position of the overlay relative to the parent image or video.
* Maps to `lfo` in the URL.
*/
focus?:
| 'center'
| 'top'
| 'left'
| 'bottom'
| 'right'
| 'top_left'
| 'top_right'
| 'bottom_left'
| 'bottom_right';
/**
* Specifies the x-coordinate of the top-left corner of the base asset where the
* overlay's top-left corner will be positioned. It also accepts arithmetic
* expressions such as `bw_mul_0.4` or `bw_sub_cw`. Maps to `lx` in the URL. Learn
* about
* [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
*/
x?: number | string;
/**
* Specifies the y-coordinate of the top-left corner of the base asset where the
* overlay's top-left corner will be positioned. It also accepts arithmetic
* expressions such as `bh_mul_0.4` or `bh_sub_ch`. Maps to `ly` in the URL. Learn
* about
* [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
*/
y?: number | string;
}
export interface OverlayTiming {
/**
* Specifies the duration (in seconds) during which the overlay should appear on
* the base video. Accepts a positive number up to two decimal places (e.g., `20`
* or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`.
* Applies only if the base asset is a video. Maps to `ldu` in the URL.
*/
duration?: number | string;
/**
* Specifies the end time (in seconds) for when the overlay should disappear from
* the base video. If both end and duration are provided, duration is ignored.
* Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and
* arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. Applies only if
* the base asset is a video. Maps to `leo` in the URL.
*/
end?: number | string;
/**
* Specifies the start time (in seconds) for when the overlay should appear on the
* base video. Accepts a positive number up to two decimal places (e.g., `20` or
* `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`.
* Applies only if the base asset is a video. Maps to `lso` in the URL.
*/
start?: number | string;
}
/**
* Resulting set of attributes suitable for an HTML `<img>` element. Useful for
* enabling responsive image loading with `srcSet` and `sizes`.
*/
export interface ResponsiveImageAttributes {
/**
* URL for the _largest_ candidate (assigned to plain `src`).
*/
src: string;
/**
* `sizes` returned (or synthesised as `100vw`). The value for the HTML `sizes`
* attribute.
*/
sizes?: string;
/**
* Candidate set with `w` or `x` descriptors. Multiple image URLs separated by
* commas, each with a descriptor.
*/
srcSet?: string;
/**
* Width as a number (if `width` was provided in the input options).
*/
width?: number;
}
/**
* Saved extension object containing extension configuration.
*/
export interface SavedExtension {
/**
* Unique identifier of the saved extension.
*/
id?: string;
/**
* Configuration object for an extension (base extensions only, not saved extension
* references).
*/
config?: ExtensionConfig;
/**
* Timestamp when the saved extension was created.
*/
createdAt?: string;
/**
* Description of the saved extension.
*/
description?: string;
/**
* Name of the saved extension.
*/
name?: string;
/**
* Timestamp when the saved extension was last updated.
*/
updatedAt?: string;
}
export interface SolidColorOverlay extends BaseOverlay {
/**
* Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA
* code (e.g., `FFAABB50`), or a color name (e.g., `red`). If an 8-character value
* is provided, the last two characters represent the opacity level (from `00` for
* 0.00 to `99` for 0.99).
*/
color: string;
type: 'solidColor';
/**
* Control width and height of the solid color overlay. Supported transformations
* depend on the base/parent asset. See overlays on
* [Images](https://imagekit.io/docs/add-overlays-on-images#apply-transformation-on-solid-color-overlay)
* and
* [Videos](https://imagekit.io/docs/add-overlays-on-videos#apply-transformations-on-solid-color-block-overlay).
*/
transformation?: Array<SolidColorOverlayTransformation>;
}
export interface SolidColorOverlayTransformation {
/**
* Specifies the transparency level of the overlaid solid color layer. Supports
* integers from `1` to `9`.
*/
alpha?: number;
/**
* Specifies the background color of the solid color overlay. Accepts an RGB hex
* code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name.
*/
background?: string;
/**
* Creates a linear gradient with two colors. Pass `true` for a default gradient,
* or provide a string for a custom gradient. Only works if the base asset is an
* image. See
* [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient).
*/
gradient?: true | string;
/**
* Controls the height of the solid color overlay. Accepts a numeric value or an
* arithmetic expression. Learn about
* [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
*/
height?: number | string;
/**
* Specifies the corner radius of the solid color overlay.
*
* - Single value (positive integer): Applied to all corners (e.g., `20`).
* - `max`: Creates a circular or oval shape.
* - Per-corner array: Provide four underscore-separated values representing
* top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
* `10_20_30_40`). See
* [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
*/
radius?: number | 'max' | string;
/**
* Controls the width of the solid color overlay. Accepts a numeric value or an
* arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). Learn about
* [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
*/
width?: number | string;
}
/**
* Options for generating ImageKit URLs with transformations. See the
* [Transformations guide](https://imagekit.io/docs/transformations).
*/
export interface SrcOptions {
/**
* Accepts a relative or absolute path of the resource. If a relative path is
* provided, it is appended to the `urlEndpoint`. If an absolute path is provided,
* `urlEndpoint` is ignored.
*/
src: string;
/**
* Get your urlEndpoint from the
* [ImageKit dashboard](https://imagekit.io/dashboard/url-endpoints).
*/
urlEndpoint: string;
/**
* When you want the signed URL to expire, specified in seconds. If `expiresIn` is
* anything above 0, the URL will always be signed even if `signed` is set to
* false. If not specified and `signed` is `true`, the signed URL will not expire
* (valid indefinitely).