imagekitio 4.0.0 → 4.1.1

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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +47 -0
  3. data/README.md +1 -1
  4. data/lib/imagekitio/client.rb +4 -0
  5. data/lib/imagekitio/helpers/helper.rb +4 -0
  6. data/lib/imagekitio/helpers/transformation_utils.rb +7 -0
  7. data/lib/imagekitio/internal/transport/base_client.rb +7 -1
  8. data/lib/imagekitio/internal/transport/pooled_net_requester.rb +17 -24
  9. data/lib/imagekitio/internal/type/base_model.rb +1 -0
  10. data/lib/imagekitio/internal/type/union.rb +20 -8
  11. data/lib/imagekitio/internal/util.rb +7 -2
  12. data/lib/imagekitio/models/base_overlay.rb +73 -3
  13. data/lib/imagekitio/models/beta/v2/file_upload_params.rb +2 -2
  14. data/lib/imagekitio/models/beta/v2/file_upload_response.rb +21 -1
  15. data/lib/imagekitio/models/extension_config.rb +674 -0
  16. data/lib/imagekitio/models/extensions.rb +559 -1
  17. data/lib/imagekitio/models/file_update_response.rb +21 -1
  18. data/lib/imagekitio/models/file_upload_params.rb +2 -2
  19. data/lib/imagekitio/models/file_upload_response.rb +21 -1
  20. data/lib/imagekitio/models/image_overlay.rb +12 -0
  21. data/lib/imagekitio/models/saved_extension.rb +62 -0
  22. data/lib/imagekitio/models/saved_extension_create_params.rb +42 -0
  23. data/lib/imagekitio/models/saved_extension_delete_params.rb +14 -0
  24. data/lib/imagekitio/models/saved_extension_get_params.rb +14 -0
  25. data/lib/imagekitio/models/saved_extension_list_params.rb +14 -0
  26. data/lib/imagekitio/models/saved_extension_list_response.rb +8 -0
  27. data/lib/imagekitio/models/saved_extension_update_params.rb +42 -0
  28. data/lib/imagekitio/models/solid_color_overlay_transformation.rb +24 -12
  29. data/lib/imagekitio/models/subtitle_overlay.rb +12 -0
  30. data/lib/imagekitio/models/subtitle_overlay_transformation.rb +4 -3
  31. data/lib/imagekitio/models/text_overlay.rb +6 -0
  32. data/lib/imagekitio/models/text_overlay_transformation.rb +35 -19
  33. data/lib/imagekitio/models/transformation.rb +62 -12
  34. data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +2 -0
  35. data/lib/imagekitio/models/unwrap_webhook_event.rb +2 -0
  36. data/lib/imagekitio/models/update_file_request.rb +2 -2
  37. data/lib/imagekitio/models/upload_pre_transform_success_event.rb +21 -1
  38. data/lib/imagekitio/models/video_overlay.rb +12 -0
  39. data/lib/imagekitio/models.rb +14 -0
  40. data/lib/imagekitio/resources/beta/v2/files.rb +1 -1
  41. data/lib/imagekitio/resources/files/metadata.rb +1 -1
  42. data/lib/imagekitio/resources/files.rb +1 -1
  43. data/lib/imagekitio/resources/saved_extensions.rb +146 -0
  44. data/lib/imagekitio/version.rb +1 -1
  45. data/lib/imagekitio.rb +11 -1
  46. data/manifest.yaml +2 -0
  47. data/rbi/imagekitio/client.rbi +3 -0
  48. data/rbi/imagekitio/internal/transport/base_client.rbi +5 -0
  49. data/rbi/imagekitio/internal/transport/pooled_net_requester.rbi +6 -2
  50. data/rbi/imagekitio/internal/type/base_model.rbi +8 -4
  51. data/rbi/imagekitio/models/base_overlay.rbi +110 -1
  52. data/rbi/imagekitio/models/beta/v2/file_upload_params.rbi +8 -0
  53. data/rbi/imagekitio/models/beta/v2/file_upload_response.rbi +61 -0
  54. data/rbi/imagekitio/models/extension_config.rbi +1406 -0
  55. data/rbi/imagekitio/models/extensions.rbi +1162 -0
  56. data/rbi/imagekitio/models/file_update_response.rbi +61 -0
  57. data/rbi/imagekitio/models/file_upload_params.rbi +8 -0
  58. data/rbi/imagekitio/models/file_upload_response.rbi +61 -0
  59. data/rbi/imagekitio/models/image_overlay.rbi +18 -0
  60. data/rbi/imagekitio/models/saved_extension.rbi +114 -0
  61. data/rbi/imagekitio/models/saved_extension_create_params.rbi +85 -0
  62. data/rbi/imagekitio/models/saved_extension_delete_params.rbi +30 -0
  63. data/rbi/imagekitio/models/saved_extension_get_params.rbi +30 -0
  64. data/rbi/imagekitio/models/saved_extension_list_params.rbi +30 -0
  65. data/rbi/imagekitio/models/saved_extension_list_response.rbi +11 -0
  66. data/rbi/imagekitio/models/saved_extension_update_params.rbi +106 -0
  67. data/rbi/imagekitio/models/solid_color_overlay_transformation.rbi +33 -18
  68. data/rbi/imagekitio/models/subtitle_overlay.rbi +18 -0
  69. data/rbi/imagekitio/models/subtitle_overlay_transformation.rbi +6 -4
  70. data/rbi/imagekitio/models/text_overlay.rbi +9 -0
  71. data/rbi/imagekitio/models/text_overlay_transformation.rbi +47 -26
  72. data/rbi/imagekitio/models/transformation.rbi +99 -18
  73. data/rbi/imagekitio/models/update_file_request.rbi +8 -0
  74. data/rbi/imagekitio/models/upload_pre_transform_success_event.rbi +61 -0
  75. data/rbi/imagekitio/models/video_overlay.rbi +18 -0
  76. data/rbi/imagekitio/models.rbi +14 -0
  77. data/rbi/imagekitio/resources/beta/v2/files.rbi +2 -0
  78. data/rbi/imagekitio/resources/files.rbi +2 -0
  79. data/rbi/imagekitio/resources/saved_extensions.rbi +114 -0
  80. data/sig/imagekitio/client.rbs +2 -0
  81. data/sig/imagekitio/internal/transport/base_client.rbs +2 -0
  82. data/sig/imagekitio/internal/transport/pooled_net_requester.rbs +4 -1
  83. data/sig/imagekitio/models/base_overlay.rbs +22 -0
  84. data/sig/imagekitio/models/beta/v2/file_upload_response.rbs +21 -0
  85. data/sig/imagekitio/models/extension_config.rbs +606 -0
  86. data/sig/imagekitio/models/extensions.rbs +491 -0
  87. data/sig/imagekitio/models/file_update_response.rbs +21 -0
  88. data/sig/imagekitio/models/file_upload_response.rbs +21 -0
  89. data/sig/imagekitio/models/saved_extension.rbs +59 -0
  90. data/sig/imagekitio/models/saved_extension_create_params.rbs +36 -0
  91. data/sig/imagekitio/models/saved_extension_delete_params.rbs +15 -0
  92. data/sig/imagekitio/models/saved_extension_get_params.rbs +15 -0
  93. data/sig/imagekitio/models/saved_extension_list_params.rbs +15 -0
  94. data/sig/imagekitio/models/saved_extension_list_response.rbs +7 -0
  95. data/sig/imagekitio/models/saved_extension_update_params.rbs +44 -0
  96. data/sig/imagekitio/models/solid_color_overlay_transformation.rbs +1 -1
  97. data/sig/imagekitio/models/text_overlay_transformation.rbs +1 -1
  98. data/sig/imagekitio/models/transformation.rbs +15 -1
  99. data/sig/imagekitio/models/upload_pre_transform_success_event.rbs +21 -0
  100. data/sig/imagekitio/models.rbs +14 -0
  101. data/sig/imagekitio/resources/saved_extensions.rbs +33 -0
  102. metadata +43 -2
@@ -11,8 +11,8 @@ module Imagekitio
11
11
  )
12
12
  end
13
13
 
14
- # Specifies the transparency level of the solid color overlay. Accepts integers
15
- # from `1` to `9`.
14
+ # Specifies the transparency level of the overlaid solid color layer. Supports
15
+ # integers from `1` to `9`.
16
16
  sig { returns(T.nilable(Float)) }
17
17
  attr_reader :alpha
18
18
 
@@ -56,13 +56,18 @@ module Imagekitio
56
56
  end
57
57
  attr_writer :height
58
58
 
59
- # Specifies the corner radius of the solid color overlay. Set to `max` for
60
- # circular or oval shape. See
61
- # [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
62
- sig { returns(T.nilable(T.any(Float, Symbol))) }
59
+ # Specifies the corner radius of the solid color overlay.
60
+ #
61
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
62
+ # - `max`: Creates a circular or oval shape.
63
+ # - Per-corner array: Provide four underscore-separated values representing
64
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
65
+ # `10_20_30_40`). See
66
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
67
+ sig { returns(T.nilable(T.any(Float, Symbol, String))) }
63
68
  attr_reader :radius
64
69
 
65
- sig { params(radius: T.any(Float, Symbol)).void }
70
+ sig { params(radius: T.any(Float, Symbol, String)).void }
66
71
  attr_writer :radius
67
72
 
68
73
  # Controls the width of the solid color overlay. Accepts a numeric value or an
@@ -90,13 +95,13 @@ module Imagekitio
90
95
  background: String,
91
96
  gradient: T.any(T::Boolean, String),
92
97
  height: Imagekitio::SolidColorOverlayTransformation::Height::Variants,
93
- radius: T.any(Float, Symbol),
98
+ radius: T.any(Float, Symbol, String),
94
99
  width: Imagekitio::SolidColorOverlayTransformation::Width::Variants
95
100
  ).returns(T.attached_class)
96
101
  end
97
102
  def self.new(
98
- # Specifies the transparency level of the solid color overlay. Accepts integers
99
- # from `1` to `9`.
103
+ # Specifies the transparency level of the overlaid solid color layer. Supports
104
+ # integers from `1` to `9`.
100
105
  alpha: nil,
101
106
  # Specifies the background color of the solid color overlay. Accepts an RGB hex
102
107
  # code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name.
@@ -110,9 +115,14 @@ module Imagekitio
110
115
  # arithmetic expression. Learn about
111
116
  # [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
112
117
  height: nil,
113
- # Specifies the corner radius of the solid color overlay. Set to `max` for
114
- # circular or oval shape. See
115
- # [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
118
+ # Specifies the corner radius of the solid color overlay.
119
+ #
120
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
121
+ # - `max`: Creates a circular or oval shape.
122
+ # - Per-corner array: Provide four underscore-separated values representing
123
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
124
+ # `10_20_30_40`). See
125
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
116
126
  radius: nil,
117
127
  # Controls the width of the solid color overlay. Accepts a numeric value or an
118
128
  # arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). Learn about
@@ -129,7 +139,7 @@ module Imagekitio
129
139
  gradient: T.any(T::Boolean, String),
130
140
  height:
131
141
  Imagekitio::SolidColorOverlayTransformation::Height::Variants,
132
- radius: T.any(Float, Symbol),
142
+ radius: T.any(Float, Symbol, String),
133
143
  width: Imagekitio::SolidColorOverlayTransformation::Width::Variants
134
144
  }
135
145
  )
@@ -176,13 +186,18 @@ module Imagekitio
176
186
  end
177
187
  end
178
188
 
179
- # Specifies the corner radius of the solid color overlay. Set to `max` for
180
- # circular or oval shape. See
181
- # [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
189
+ # Specifies the corner radius of the solid color overlay.
190
+ #
191
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
192
+ # - `max`: Creates a circular or oval shape.
193
+ # - Per-corner array: Provide four underscore-separated values representing
194
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
195
+ # `10_20_30_40`). See
196
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
182
197
  module Radius
183
198
  extend Imagekitio::Internal::Type::Union
184
199
 
185
- Variants = T.type_alias { T.any(Float, Symbol) }
200
+ Variants = T.type_alias { T.any(Float, Symbol, String) }
186
201
 
187
202
  sig do
188
203
  override.returns(
@@ -20,6 +20,12 @@ module Imagekitio
20
20
  # format automatically. To always use base64 encoding (`ie-{base64}`), set this
21
21
  # parameter to `base64`. To always use plain text (`i-{input}`), set it to
22
22
  # `plain`.
23
+ #
24
+ # Regardless of the encoding method:
25
+ #
26
+ # - Leading and trailing slashes are removed.
27
+ # - Remaining slashes within the path are replaced with `@@` when using plain
28
+ # text.
23
29
  sig do
24
30
  returns(T.nilable(Imagekitio::SubtitleOverlay::Encoding::OrSymbol))
25
31
  end
@@ -62,6 +68,12 @@ module Imagekitio
62
68
  # format automatically. To always use base64 encoding (`ie-{base64}`), set this
63
69
  # parameter to `base64`. To always use plain text (`i-{input}`), set it to
64
70
  # `plain`.
71
+ #
72
+ # Regardless of the encoding method:
73
+ #
74
+ # - Leading and trailing slashes are removed.
75
+ # - Remaining slashes within the path are replaced with `@@` when using plain
76
+ # text.
65
77
  encoding: nil,
66
78
  # Control styling of the subtitle. See
67
79
  # [Styling subtitles](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer).
@@ -88,6 +100,12 @@ module Imagekitio
88
100
  # format automatically. To always use base64 encoding (`ie-{base64}`), set this
89
101
  # parameter to `base64`. To always use plain text (`i-{input}`), set it to
90
102
  # `plain`.
103
+ #
104
+ # Regardless of the encoding method:
105
+ #
106
+ # - Leading and trailing slashes are removed.
107
+ # - Remaining slashes within the path are replaced with `@@` when using plain
108
+ # text.
91
109
  module Encoding
92
110
  extend Imagekitio::Internal::Type::Enum
93
111
 
@@ -31,8 +31,9 @@ module Imagekitio
31
31
  sig { params(color: String).void }
32
32
  attr_writer :color
33
33
 
34
- # Font family for subtitles. Refer to the
35
- # [supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list).
34
+ # Sets the font family of subtitle text. Refer to the
35
+ # [supported fonts documented](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list)
36
+ # in the ImageKit transformations guide.
36
37
  sig { returns(T.nilable(String)) }
37
38
  attr_reader :font_family
38
39
 
@@ -122,8 +123,9 @@ module Imagekitio
122
123
  #
123
124
  # [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer)
124
125
  color: nil,
125
- # Font family for subtitles. Refer to the
126
- # [supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list).
126
+ # Sets the font family of subtitle text. Refer to the
127
+ # [supported fonts documented](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list)
128
+ # in the ImageKit transformations guide.
127
129
  font_family: nil,
128
130
  # Sets the font outline of the subtitle text. Requires the outline width (an
129
131
  # integer) and the outline color (as an RGB color code, RGBA color code, or
@@ -21,6 +21,9 @@ module Imagekitio
21
21
  # appropriate format based on the input text. To always use base64
22
22
  # (`ie-{base64}`), set this parameter to `base64`. To always use plain text
23
23
  # (`i-{input}`), set it to `plain`.
24
+ #
25
+ # Regardless of the encoding method, the input text is always percent-encoded to
26
+ # ensure it is URL-safe.
24
27
  sig { returns(T.nilable(Imagekitio::TextOverlay::Encoding::OrSymbol)) }
25
28
  attr_reader :encoding
26
29
 
@@ -60,6 +63,9 @@ module Imagekitio
60
63
  # appropriate format based on the input text. To always use base64
61
64
  # (`ie-{base64}`), set this parameter to `base64`. To always use plain text
62
65
  # (`i-{input}`), set it to `plain`.
66
+ #
67
+ # Regardless of the encoding method, the input text is always percent-encoded to
68
+ # ensure it is URL-safe.
63
69
  encoding: nil,
64
70
  # Control styling of the text overlay. See
65
71
  # [Text overlays](https://imagekit.io/docs/add-overlays-on-images#text-overlay).
@@ -86,6 +92,9 @@ module Imagekitio
86
92
  # appropriate format based on the input text. To always use base64
87
93
  # (`ie-{base64}`), set this parameter to `base64`. To always use plain text
88
94
  # (`i-{input}`), set it to `plain`.
95
+ #
96
+ # Regardless of the encoding method, the input text is always percent-encoded to
97
+ # ensure it is URL-safe.
89
98
  module Encoding
90
99
  extend Imagekitio::Internal::Type::Enum
91
100
 
@@ -27,7 +27,9 @@ module Imagekitio
27
27
  sig { params(background: String).void }
28
28
  attr_writer :background
29
29
 
30
- # Flip the text overlay horizontally, vertically, or both.
30
+ # Flip/mirror the text horizontally, vertically, or in both directions. Acceptable
31
+ # values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or
32
+ # `v_h`.
31
33
  sig do
32
34
  returns(
33
35
  T.nilable(Imagekitio::TextOverlayTransformation::Flip::OrSymbol)
@@ -94,10 +96,9 @@ module Imagekitio
94
96
  end
95
97
  attr_writer :inner_alignment
96
98
 
97
- # Specifies the line height of the text overlay. Accepts integer values
98
- # representing line height in points. It can also accept
99
- # [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations)
100
- # such as `bw_mul_0.2`, or `bh_div_20`.
99
+ # Specifies the line height for multi-line text overlays. It will come into effect
100
+ # only if the text wraps over multiple lines. Accepts either an integer value or
101
+ # an arithmetic expression.
101
102
  sig do
102
103
  returns(
103
104
  T.nilable(Imagekitio::TextOverlayTransformation::LineHeight::Variants)
@@ -130,12 +131,18 @@ module Imagekitio
130
131
  end
131
132
  attr_writer :padding
132
133
 
133
- # Specifies the corner radius of the text overlay. Set to `max` to achieve a
134
- # circular or oval shape.
135
- sig { returns(T.nilable(T.any(Float, Symbol))) }
134
+ # Specifies the corner radius:
135
+ #
136
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
137
+ # - `max`: Creates a circular or oval shape.
138
+ # - Per-corner array: Provide four underscore-separated values representing
139
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
140
+ # `10_20_30_40`). See
141
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
142
+ sig { returns(T.nilable(T.any(Float, Symbol, String))) }
136
143
  attr_reader :radius
137
144
 
138
- sig { params(radius: T.any(Float, Symbol)).void }
145
+ sig { params(radius: T.any(Float, Symbol, String)).void }
139
146
  attr_writer :radius
140
147
 
141
148
  # Specifies the rotation angle of the text overlay. Accepts a numeric value for
@@ -196,7 +203,7 @@ module Imagekitio
196
203
  line_height:
197
204
  Imagekitio::TextOverlayTransformation::LineHeight::Variants,
198
205
  padding: Imagekitio::TextOverlayTransformation::Padding::Variants,
199
- radius: T.any(Float, Symbol),
206
+ radius: T.any(Float, Symbol, String),
200
207
  rotation: Imagekitio::TextOverlayTransformation::Rotation::Variants,
201
208
  typography: String,
202
209
  width: Imagekitio::TextOverlayTransformation::Width::Variants
@@ -209,7 +216,9 @@ module Imagekitio
209
216
  # Specifies the background color of the text overlay. Accepts an RGB hex code, an
210
217
  # RGBA code, or a color name.
211
218
  background: nil,
212
- # Flip the text overlay horizontally, vertically, or both.
219
+ # Flip/mirror the text horizontally, vertically, or in both directions. Acceptable
220
+ # values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or
221
+ # `v_h`.
213
222
  flip: nil,
214
223
  # Specifies the font color of the overlaid text. Accepts an RGB hex code (e.g.,
215
224
  # `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name.
@@ -226,17 +235,22 @@ module Imagekitio
226
235
  # Specifies the inner alignment of the text when width is more than the text
227
236
  # length.
228
237
  inner_alignment: nil,
229
- # Specifies the line height of the text overlay. Accepts integer values
230
- # representing line height in points. It can also accept
231
- # [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations)
232
- # such as `bw_mul_0.2`, or `bh_div_20`.
238
+ # Specifies the line height for multi-line text overlays. It will come into effect
239
+ # only if the text wraps over multiple lines. Accepts either an integer value or
240
+ # an arithmetic expression.
233
241
  line_height: nil,
234
242
  # Specifies the padding around the overlaid text. Can be provided as a single
235
243
  # positive integer or multiple values separated by underscores (following CSS
236
244
  # shorthand order). Arithmetic expressions are also accepted.
237
245
  padding: nil,
238
- # Specifies the corner radius of the text overlay. Set to `max` to achieve a
239
- # circular or oval shape.
246
+ # Specifies the corner radius:
247
+ #
248
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
249
+ # - `max`: Creates a circular or oval shape.
250
+ # - Per-corner array: Provide four underscore-separated values representing
251
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
252
+ # `10_20_30_40`). See
253
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
240
254
  radius: nil,
241
255
  # Specifies the rotation angle of the text overlay. Accepts a numeric value for
242
256
  # clockwise rotation or a string prefixed with "N" for counter-clockwise rotation.
@@ -270,7 +284,7 @@ module Imagekitio
270
284
  line_height:
271
285
  Imagekitio::TextOverlayTransformation::LineHeight::Variants,
272
286
  padding: Imagekitio::TextOverlayTransformation::Padding::Variants,
273
- radius: T.any(Float, Symbol),
287
+ radius: T.any(Float, Symbol, String),
274
288
  rotation: Imagekitio::TextOverlayTransformation::Rotation::Variants,
275
289
  typography: String,
276
290
  width: Imagekitio::TextOverlayTransformation::Width::Variants
@@ -280,7 +294,9 @@ module Imagekitio
280
294
  def to_hash
281
295
  end
282
296
 
283
- # Flip the text overlay horizontally, vertically, or both.
297
+ # Flip/mirror the text horizontally, vertically, or in both directions. Acceptable
298
+ # values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or
299
+ # `v_h`.
284
300
  module Flip
285
301
  extend Imagekitio::Internal::Type::Enum
286
302
 
@@ -360,10 +376,9 @@ module Imagekitio
360
376
  end
361
377
  end
362
378
 
363
- # Specifies the line height of the text overlay. Accepts integer values
364
- # representing line height in points. It can also accept
365
- # [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations)
366
- # such as `bw_mul_0.2`, or `bh_div_20`.
379
+ # Specifies the line height for multi-line text overlays. It will come into effect
380
+ # only if the text wraps over multiple lines. Accepts either an integer value or
381
+ # an arithmetic expression.
367
382
  module LineHeight
368
383
  extend Imagekitio::Internal::Type::Union
369
384
 
@@ -397,12 +412,18 @@ module Imagekitio
397
412
  end
398
413
  end
399
414
 
400
- # Specifies the corner radius of the text overlay. Set to `max` to achieve a
401
- # circular or oval shape.
415
+ # Specifies the corner radius:
416
+ #
417
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
418
+ # - `max`: Creates a circular or oval shape.
419
+ # - Per-corner array: Provide four underscore-separated values representing
420
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
421
+ # `10_20_30_40`). See
422
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
402
423
  module Radius
403
424
  extend Imagekitio::Internal::Type::Union
404
425
 
405
- Variants = T.type_alias { T.any(Float, Symbol) }
426
+ Variants = T.type_alias { T.any(Float, Symbol, String) }
406
427
 
407
428
  sig do
408
429
  override.returns(
@@ -160,6 +160,12 @@ module Imagekitio
160
160
  #
161
161
  # - A solid color: e.g., `red`, `F3F3F3`, `AAFF0010`. See
162
162
  # [Solid color background](https://imagekit.io/docs/effects-and-enhancements#solid-color-background).
163
+ # - Dominant color: `dominant` extracts the dominant color from the image. See
164
+ # [Dominant color background](https://imagekit.io/docs/effects-and-enhancements#dominant-color-background).
165
+ # - Gradient: `gradient_dominant` or `gradient_dominant_2` creates a gradient
166
+ # using the dominant colors. Optionally specify palette size (2 or 4), e.g.,
167
+ # `gradient_dominant_4`. See
168
+ # [Gradient background](https://imagekit.io/docs/effects-and-enhancements#gradient-background).
163
169
  # - A blurred background: e.g., `blurred`, `blurred_25_N15`, etc. See
164
170
  # [Blurred background](https://imagekit.io/docs/effects-and-enhancements#blurred-background).
165
171
  # - Expand the image boundaries using generative fill: `genfill`. Not supported
@@ -200,6 +206,20 @@ module Imagekitio
200
206
  sig { params(color_profile: T::Boolean).void }
201
207
  attr_writer :color_profile
202
208
 
209
+ # Replaces colors in the image. Supports three formats:
210
+ #
211
+ # - `toColor` - Replace dominant color with the specified color.
212
+ # - `toColor_tolerance` - Replace dominant color with specified tolerance (0-100).
213
+ # - `toColor_tolerance_fromColor` - Replace a specific color with another within
214
+ # tolerance range. Colors can be hex codes (e.g., `FF0022`) or names (e.g.,
215
+ # `red`, `blue`). See
216
+ # [Color replacement](https://imagekit.io/docs/effects-and-enhancements#color-replace---cr).
217
+ sig { returns(T.nilable(String)) }
218
+ attr_reader :color_replace
219
+
220
+ sig { params(color_replace: String).void }
221
+ attr_writer :color_replace
222
+
203
223
  # Automatically enhances the contrast of an image (contrast stretch). See
204
224
  # [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast).
205
225
  sig do
@@ -244,9 +264,25 @@ module Imagekitio
244
264
  sig { params(default_image: String).void }
245
265
  attr_writer :default_image
246
266
 
267
+ # Distorts the shape of an image. Supports two modes:
268
+ #
269
+ # - Perspective distortion: `p-x1_y1_x2_y2_x3_y3_x4_y4` changes the position of
270
+ # the four corners starting clockwise from top-left.
271
+ # - Arc distortion: `a-degrees` curves the image upwards (positive values) or
272
+ # downwards (negative values). See
273
+ # [Distort effect](https://imagekit.io/docs/effects-and-enhancements#distort---e-distort).
274
+ sig { returns(T.nilable(String)) }
275
+ attr_reader :distort
276
+
277
+ sig { params(distort: String).void }
278
+ attr_writer :distort
279
+
247
280
  # Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio
248
- # (DPR) calculation. See
249
- # [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr).
281
+ # (DPR) calculation. Also accepts arithmetic expressions.
282
+ #
283
+ # - Learn about
284
+ # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
285
+ # - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr).
250
286
  sig { returns(T.nilable(Float)) }
251
287
  attr_reader :dpr
252
288
 
@@ -431,13 +467,18 @@ module Imagekitio
431
467
  sig { params(quality: Float).void }
432
468
  attr_writer :quality
433
469
 
434
- # Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular
435
- # or oval shape. See
436
- # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
437
- sig { returns(T.nilable(T.any(Float, Symbol))) }
470
+ # Specifies the corner radius for rounded corners.
471
+ #
472
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
473
+ # - `max`: Creates a circular or oval shape.
474
+ # - Per-corner array: Provide four underscore-separated values representing
475
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
476
+ # `10_20_30_40`). See
477
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
478
+ sig { returns(T.nilable(T.any(Float, Symbol, String))) }
438
479
  attr_reader :radius
439
480
 
440
- sig { params(radius: T.any(Float, Symbol)).void }
481
+ sig { params(radius: T.any(Float, Symbol, String)).void }
441
482
  attr_writer :radius
442
483
 
443
484
  # Pass any transformation not directly supported by the SDK. This transformation
@@ -624,11 +665,13 @@ module Imagekitio
624
665
  blur: Float,
625
666
  border: String,
626
667
  color_profile: T::Boolean,
668
+ color_replace: String,
627
669
  contrast_stretch:
628
670
  Imagekitio::Transformation::ContrastStretch::OrBoolean,
629
671
  crop: Imagekitio::Transformation::Crop::OrSymbol,
630
672
  crop_mode: Imagekitio::Transformation::CropMode::OrSymbol,
631
673
  default_image: String,
674
+ distort: String,
632
675
  dpr: Float,
633
676
  duration: Imagekitio::Transformation::Duration::Variants,
634
677
  end_offset: Imagekitio::Transformation::EndOffset::Variants,
@@ -647,7 +690,7 @@ module Imagekitio
647
690
  page: Imagekitio::Transformation::Page::Variants,
648
691
  progressive: T::Boolean,
649
692
  quality: Float,
650
- radius: T.any(Float, Symbol),
693
+ radius: T.any(Float, Symbol, String),
651
694
  raw: String,
652
695
  rotation: Imagekitio::Transformation::Rotation::Variants,
653
696
  shadow: T.any(T::Boolean, String),
@@ -719,6 +762,12 @@ module Imagekitio
719
762
  #
720
763
  # - A solid color: e.g., `red`, `F3F3F3`, `AAFF0010`. See
721
764
  # [Solid color background](https://imagekit.io/docs/effects-and-enhancements#solid-color-background).
765
+ # - Dominant color: `dominant` extracts the dominant color from the image. See
766
+ # [Dominant color background](https://imagekit.io/docs/effects-and-enhancements#dominant-color-background).
767
+ # - Gradient: `gradient_dominant` or `gradient_dominant_2` creates a gradient
768
+ # using the dominant colors. Optionally specify palette size (2 or 4), e.g.,
769
+ # `gradient_dominant_4`. See
770
+ # [Gradient background](https://imagekit.io/docs/effects-and-enhancements#gradient-background).
722
771
  # - A blurred background: e.g., `blurred`, `blurred_25_N15`, etc. See
723
772
  # [Blurred background](https://imagekit.io/docs/effects-and-enhancements#blurred-background).
724
773
  # - Expand the image boundaries using generative fill: `genfill`. Not supported
@@ -739,6 +788,15 @@ module Imagekitio
739
788
  # Indicates whether the output image should retain the original color profile. See
740
789
  # [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp).
741
790
  color_profile: nil,
791
+ # Replaces colors in the image. Supports three formats:
792
+ #
793
+ # - `toColor` - Replace dominant color with the specified color.
794
+ # - `toColor_tolerance` - Replace dominant color with specified tolerance (0-100).
795
+ # - `toColor_tolerance_fromColor` - Replace a specific color with another within
796
+ # tolerance range. Colors can be hex codes (e.g., `FF0022`) or names (e.g.,
797
+ # `red`, `blue`). See
798
+ # [Color replacement](https://imagekit.io/docs/effects-and-enhancements#color-replace---cr).
799
+ color_replace: nil,
742
800
  # Automatically enhances the contrast of an image (contrast stretch). See
743
801
  # [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast).
744
802
  contrast_stretch: nil,
@@ -752,9 +810,20 @@ module Imagekitio
752
810
  # path. See
753
811
  # [Default image](https://imagekit.io/docs/image-transformation#default-image---di).
754
812
  default_image: nil,
813
+ # Distorts the shape of an image. Supports two modes:
814
+ #
815
+ # - Perspective distortion: `p-x1_y1_x2_y2_x3_y3_x4_y4` changes the position of
816
+ # the four corners starting clockwise from top-left.
817
+ # - Arc distortion: `a-degrees` curves the image upwards (positive values) or
818
+ # downwards (negative values). See
819
+ # [Distort effect](https://imagekit.io/docs/effects-and-enhancements#distort---e-distort).
820
+ distort: nil,
755
821
  # Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio
756
- # (DPR) calculation. See
757
- # [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr).
822
+ # (DPR) calculation. Also accepts arithmetic expressions.
823
+ #
824
+ # - Learn about
825
+ # [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations).
826
+ # - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr).
758
827
  dpr: nil,
759
828
  # Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`.
760
829
  # Typically used with startOffset to indicate the length from the start offset.
@@ -839,9 +908,14 @@ module Imagekitio
839
908
  # quality, while a lower value produces a smaller file size with reduced quality.
840
909
  # See [Quality](https://imagekit.io/docs/image-optimization#quality---q).
841
910
  quality: nil,
842
- # Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular
843
- # or oval shape. See
844
- # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
911
+ # Specifies the corner radius for rounded corners.
912
+ #
913
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
914
+ # - `max`: Creates a circular or oval shape.
915
+ # - Per-corner array: Provide four underscore-separated values representing
916
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
917
+ # `10_20_30_40`). See
918
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
845
919
  radius: nil,
846
920
  # Pass any transformation not directly supported by the SDK. This transformation
847
921
  # string is appended to the URL as provided.
@@ -925,11 +999,13 @@ module Imagekitio
925
999
  blur: Float,
926
1000
  border: String,
927
1001
  color_profile: T::Boolean,
1002
+ color_replace: String,
928
1003
  contrast_stretch:
929
1004
  Imagekitio::Transformation::ContrastStretch::OrBoolean,
930
1005
  crop: Imagekitio::Transformation::Crop::OrSymbol,
931
1006
  crop_mode: Imagekitio::Transformation::CropMode::OrSymbol,
932
1007
  default_image: String,
1008
+ distort: String,
933
1009
  dpr: Float,
934
1010
  duration: Imagekitio::Transformation::Duration::Variants,
935
1011
  end_offset: Imagekitio::Transformation::EndOffset::Variants,
@@ -948,7 +1024,7 @@ module Imagekitio
948
1024
  page: Imagekitio::Transformation::Page::Variants,
949
1025
  progressive: T::Boolean,
950
1026
  quality: Float,
951
- radius: T.any(Float, Symbol),
1027
+ radius: T.any(Float, Symbol, String),
952
1028
  raw: String,
953
1029
  rotation: Imagekitio::Transformation::Rotation::Variants,
954
1030
  shadow: T.any(T::Boolean, String),
@@ -1417,13 +1493,18 @@ module Imagekitio
1417
1493
  end
1418
1494
  end
1419
1495
 
1420
- # Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular
1421
- # or oval shape. See
1422
- # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
1496
+ # Specifies the corner radius for rounded corners.
1497
+ #
1498
+ # - Single value (positive integer): Applied to all corners (e.g., `20`).
1499
+ # - `max`: Creates a circular or oval shape.
1500
+ # - Per-corner array: Provide four underscore-separated values representing
1501
+ # top-left, top-right, bottom-right, and bottom-left corners respectively (e.g.,
1502
+ # `10_20_30_40`). See
1503
+ # [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r).
1423
1504
  module Radius
1424
1505
  extend Imagekitio::Internal::Type::Union
1425
1506
 
1426
- Variants = T.type_alias { T.any(Float, Symbol) }
1507
+ Variants = T.type_alias { T.any(Float, Symbol, String) }
1427
1508
 
1428
1509
  sig do
1429
1510
  override.returns(
@@ -53,6 +53,8 @@ module Imagekitio
53
53
  T.any(
54
54
  Imagekitio::ExtensionItem::RemoveBg,
55
55
  Imagekitio::ExtensionItem::AIAutoDescription,
56
+ Imagekitio::ExtensionItem::AITasks,
57
+ Imagekitio::ExtensionItem::SavedExtension,
56
58
  Imagekitio::ExtensionItem::AutoTaggingExtension
57
59
  )
58
60
  ]
@@ -68,6 +70,8 @@ module Imagekitio
68
70
  T.any(
69
71
  Imagekitio::ExtensionItem::RemoveBg::OrHash,
70
72
  Imagekitio::ExtensionItem::AIAutoDescription::OrHash,
73
+ Imagekitio::ExtensionItem::AITasks::OrHash,
74
+ Imagekitio::ExtensionItem::SavedExtension::OrHash,
71
75
  Imagekitio::ExtensionItem::AutoTaggingExtension::OrHash
72
76
  )
73
77
  ]
@@ -114,6 +118,8 @@ module Imagekitio
114
118
  T.any(
115
119
  Imagekitio::ExtensionItem::RemoveBg::OrHash,
116
120
  Imagekitio::ExtensionItem::AIAutoDescription::OrHash,
121
+ Imagekitio::ExtensionItem::AITasks::OrHash,
122
+ Imagekitio::ExtensionItem::SavedExtension::OrHash,
117
123
  Imagekitio::ExtensionItem::AutoTaggingExtension::OrHash
118
124
  )
119
125
  ],
@@ -166,6 +172,8 @@ module Imagekitio
166
172
  T.any(
167
173
  Imagekitio::ExtensionItem::RemoveBg,
168
174
  Imagekitio::ExtensionItem::AIAutoDescription,
175
+ Imagekitio::ExtensionItem::AITasks,
176
+ Imagekitio::ExtensionItem::SavedExtension,
169
177
  Imagekitio::ExtensionItem::AutoTaggingExtension
170
178
  )
171
179
  ],