@@ -78,6 +78,54 @@ export namespace Extensions {
7878 }
7979}
8080
81+ /**
82+ * Options for generating responsive image attributes including `src`, `srcSet`,
83+ * and `sizes` for HTML `<img>` elements. This schema extends `SrcOptions` to add
84+ * support for responsive image generation with breakpoints.
85+ */
86+ export interface GetImageAttributesOptions extends SrcOptions {
87+ /**
88+ * Custom list of **device-width breakpoints** in pixels. These define common
89+ * screen widths for responsive image generation.
90+ *
91+ * Defaults to `[640, 750, 828, 1080, 1200, 1920, 2048, 3840]`. Sorted
92+ * automatically.
93+ */
94+ deviceBreakpoints ?: Array < number > ;
95+
96+ /**
97+ * Custom list of **image-specific breakpoints** in pixels. Useful for generating
98+ * small variants (e.g., placeholders or thumbnails).
99+ *
100+ * Merged with `deviceBreakpoints` before calculating `srcSet`. Defaults to
101+ * `[16, 32, 48, 64, 96, 128, 256, 384]`. Sorted automatically.
102+ */
103+ imageBreakpoints ?: Array < number > ;
104+
105+ /**
106+ * The value for the HTML `sizes` attribute (e.g., `"100vw"` or
107+ * `"(min-width:768px) 50vw, 100vw"`).
108+ *
109+ * - If it includes one or more `vw` units, breakpoints smaller than the
110+ * corresponding percentage of the smallest device width are excluded.
111+ * - If it contains no `vw` units, the full breakpoint list is used.
112+ *
113+ * Enables a width-based strategy and generates `w` descriptors in `srcSet`.
114+ */
115+ sizes ?: string ;
116+
117+ /**
118+ * The intended display width of the image in pixels, used **only when the `sizes`
119+ * attribute is not provided**.
120+ *
121+ * Triggers a DPR-based strategy (1x and 2x variants) and generates `x` descriptors
122+ * in `srcSet`.
123+ *
124+ * Ignored if `sizes` is present.
125+ */
126+ width ?: number ;
127+ }
128+
81129export interface ImageOverlay extends BaseOverlay {
82130 /**
83131 * Specifies the relative path to the image used as an overlay.
@@ -175,6 +223,34 @@ export interface OverlayTiming {
175223 start ?: number | string ;
176224}
177225
226+ /**
227+ * Resulting set of attributes suitable for an HTML `<img>` element. Useful for
228+ * enabling responsive image loading with `srcSet` and `sizes`.
229+ */
230+ export interface ResponsiveImageAttributes {
231+ /**
232+ * URL for the _largest_ candidate (assigned to plain `src`).
233+ */
234+ src : string ;
235+
236+ /**
237+ * `sizes` returned (or synthesised as `100vw`). The value for the HTML `sizes`
238+ * attribute.
239+ */
240+ sizes ?: string ;
241+
242+ /**
243+ * Candidate set with `w` or `x` descriptors. Multiple image URLs separated by
244+ * commas, each with a descriptor.
245+ */
246+ srcSet ?: string ;
247+
248+ /**
249+ * Width as a number (if `width` was provided in the input options).
250+ */
251+ width ?: number ;
252+ }
253+
178254export interface SolidColorOverlay extends BaseOverlay {
179255 /**
180256 * Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA
0 commit comments