@lunora/bindings 1.0.0-alpha.4 → 1.0.0-alpha.41

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 (58) hide show
  1. package/LICENSE.md +6 -0
  2. package/dist/analytics/index.d.mts +73 -84
  3. package/dist/analytics/index.d.ts +73 -84
  4. package/dist/analytics/index.mjs +1 -2
  5. package/dist/images/index.d.mts +173 -149
  6. package/dist/images/index.d.ts +173 -149
  7. package/dist/images/index.mjs +1 -3
  8. package/dist/kv/index.d.mts +74 -151
  9. package/dist/kv/index.d.ts +74 -151
  10. package/dist/kv/index.mjs +1 -2
  11. package/dist/packem_shared/AnalyticsSqlError-BEKML_Dg.mjs +1 -0
  12. package/dist/packem_shared/R2SqlError-CJ_zgztT.mjs +1 -0
  13. package/dist/packem_shared/SelectBuilder-Dnqem9T0.mjs +1 -0
  14. package/dist/packem_shared/SetOperation-kiI5Wnlm.mjs +1 -0
  15. package/dist/packem_shared/Sql-BfnxRway.mjs +1 -0
  16. package/dist/packem_shared/WindowExpression-VX7EEV3h.mjs +1 -0
  17. package/dist/packem_shared/WindowFunction-CL4jYy2l.mjs +1 -0
  18. package/dist/packem_shared/asc-DP_WFiAE.mjs +1 -0
  19. package/dist/packem_shared/buildImageDeliveryUrl-Brqs-dcZ.mjs +1 -0
  20. package/dist/packem_shared/buildSignedImageUrl-DbSDmjWK.mjs +4 -0
  21. package/dist/packem_shared/concurrent-vRmSvRpF.mjs +1 -0
  22. package/dist/packem_shared/createAnalytics-BXTNc57d.mjs +1 -0
  23. package/dist/packem_shared/createContextVectors-Bk6ZVCqQ.mjs +6 -0
  24. package/dist/packem_shared/createImages-CHgMZP4g.mjs +1 -0
  25. package/dist/packem_shared/createKv-B0RfMMal.mjs +1 -0
  26. package/dist/packem_shared/createKvIntrospector-DT1k8mCG.mjs +1 -0
  27. package/dist/packem_shared/createPipelines-CIvqrc7E.mjs +1 -0
  28. package/dist/packem_shared/createVectorAdminIntrospector-DrsigTJs.mjs +1 -0
  29. package/dist/packem_shared/createVectors-DirhBYpw.mjs +1 -0
  30. package/dist/pipelines/index.d.mts +24 -24
  31. package/dist/pipelines/index.d.ts +24 -24
  32. package/dist/pipelines/index.mjs +1 -1
  33. package/dist/r2sql/index.d.mts +148 -123
  34. package/dist/r2sql/index.d.ts +148 -123
  35. package/dist/r2sql/index.mjs +1 -7
  36. package/dist/vectors/index.d.mts +185 -134
  37. package/dist/vectors/index.d.ts +185 -134
  38. package/dist/vectors/index.mjs +1 -3
  39. package/package.json +3 -2
  40. package/dist/packem_shared/AnalyticsSqlError-C2nz3jpH.mjs +0 -41
  41. package/dist/packem_shared/R2SqlError-Boygg3S0.mjs +0 -65
  42. package/dist/packem_shared/SelectBuilder-DHaXZwn_.mjs +0 -167
  43. package/dist/packem_shared/SetOperation-RDHcxccj.mjs +0 -80
  44. package/dist/packem_shared/Sql-DceGtcUd.mjs +0 -68
  45. package/dist/packem_shared/WindowExpression-Cg9s2xcr.mjs +0 -44
  46. package/dist/packem_shared/WindowFunction-DA3pGC3N.mjs +0 -82
  47. package/dist/packem_shared/asc-Cur-xO8v.mjs +0 -16
  48. package/dist/packem_shared/buildImageDeliveryUrl-B6_QU91n.mjs +0 -33
  49. package/dist/packem_shared/buildSignedImageUrl-6iibA9v1.mjs +0 -113
  50. package/dist/packem_shared/concurrent-Dj5sOibv.mjs +0 -23
  51. package/dist/packem_shared/createAnalytics-CEEI69o9.mjs +0 -57
  52. package/dist/packem_shared/createContextVectors-BSizpmu5.mjs +0 -140
  53. package/dist/packem_shared/createImages-BzRnsz3H.mjs +0 -85
  54. package/dist/packem_shared/createKv-7lNrS1W2.mjs +0 -143
  55. package/dist/packem_shared/createKvIntrospector-CrAgQp1w.mjs +0 -77
  56. package/dist/packem_shared/createPipelines-CfyJ6VGu.mjs +0 -10
  57. package/dist/packem_shared/createVectorAdminIntrospector-C-qTDWA1.mjs +0 -53
  58. package/dist/packem_shared/createVectors-DqxgEPQb.mjs +0 -95
@@ -1,41 +1,41 @@
1
1
  /**
2
- * Structural projections of the Cloudflare **Images** binding (`env.IMAGES`).
3
- *
4
- * Declared structurally — the same pattern `@lunora/storage` uses for
5
- * `R2BucketLike` — so a unit test can pass a plain object double and the real
6
- * `ImagesBinding` from `@cloudflare/workers-types` satisfies the same shape. We
7
- * project only the slice of the chain we actually call
8
- * (`input(stream).transform(opts).output(opts)` + `info(stream)`), not the full
9
- * hosted-images CRUD surface.
10
- *
11
- * TODO(workers-types): the 2026-06-16 optimization features — the `aspect-crop`
12
- * / `scale-up` fit modes and the `upscale` param — are modeled here by hand
13
- * because `@cloudflare/workers-types` (through 4.20260616.1) does not type them
14
- * yet. Re-check on the next `@cloudflare/workers-types` bump: once `ImageTransform`
15
- * carries `fit: "aspect-crop" | "scale-up"` and `upscale`, drop our hand-rolled
16
- * additions and lean on the upstream type.
17
- */
2
+ * Structural projections of the Cloudflare **Images** binding (`env.IMAGES`).
3
+ *
4
+ * Declared structurally — the same pattern `@lunora/storage` uses for
5
+ * `R2BucketLike` — so a unit test can pass a plain object double and the real
6
+ * `ImagesBinding` from `@cloudflare/workers-types` satisfies the same shape. We
7
+ * project only the slice of the chain we actually call
8
+ * (`input(stream).transform(opts).output(opts)` + `info(stream)`), not the full
9
+ * hosted-images CRUD surface.
10
+ *
11
+ * TODO(workers-types): the 2026-06-16 optimization features — the `aspect-crop`
12
+ * / `scale-up` fit modes and the `upscale` param — are modeled here by hand
13
+ * because `@cloudflare/workers-types` (through 4.20260616.1) does not type them
14
+ * yet. Re-check on the next `@cloudflare/workers-types` bump: once `ImageTransform`
15
+ * carries `fit: "aspect-crop" | "scale-up"` and `upscale`, drop our hand-rolled
16
+ * additions and lean on the upstream type.
17
+ */
18
18
  /**
19
- * Porter-Duff compositing operation controlling how an overlay is blended onto
20
- * the image beneath it. Mirrors the binding's `ImageCompositeMode`.
21
- *
22
- * - `over` — foreground drawn on top of the backdrop (default).
23
- * - `in` — foreground shown only where the backdrop is opaque.
24
- * - `atop` — foreground drawn on top, clipped to the backdrop's shape.
25
- * - `out` — foreground shown only where the backdrop is transparent.
26
- * - `xor` — foreground and backdrop visible only where the other is not.
27
- * - `lighter` — foreground and backdrop channels added (brightening).
28
- */
19
+ * Porter-Duff compositing operation controlling how an overlay is blended onto
20
+ * the image beneath it. Mirrors the binding's `ImageCompositeMode`.
21
+ *
22
+ * - `over` — foreground drawn on top of the backdrop (default).
23
+ * - `in` — foreground shown only where the backdrop is opaque.
24
+ * - `atop` — foreground drawn on top, clipped to the backdrop's shape.
25
+ * - `out` — foreground shown only where the backdrop is transparent.
26
+ * - `xor` — foreground and backdrop visible only where the other is not.
27
+ * - `lighter` — foreground and backdrop channels added (brightening).
28
+ */
29
29
  type ImageCompositeMode = "atop" | "in" | "lighter" | "out" | "over" | "xor";
30
30
  /**
31
- * One overlay in a {@link TransformOptions.draw} list — the **URL-form** overlay
32
- * (the `cf.image.draw` / `/cdn-cgi/image` shape), where the overlay image is
33
- * referenced by absolute `url`. For the **binding** path use {@link ImageOverlay}
34
- * instead, which carries the overlay bytes as a stream.
35
- *
36
- * `width`/`height` accept either an integer (pixels) or a decimal in `(0, 1]`
37
- * interpreted as a fraction of the base image's corresponding dimension.
38
- */
31
+ * One overlay in a {@link TransformOptions.draw} list — the **URL-form** overlay
32
+ * (the `cf.image.draw` / `/cdn-cgi/image` shape), where the overlay image is
33
+ * referenced by absolute `url`. For the **binding** path use {@link ImageOverlay}
34
+ * instead, which carries the overlay bytes as a stream.
35
+ *
36
+ * `width`/`height` accept either an integer (pixels) or a decimal in `(0, 1]`
37
+ * interpreted as a fraction of the base image's corresponding dimension.
38
+ */
39
39
  interface DrawOverlay {
40
40
  /** Offset, in pixels, from the bottom edge. */
41
41
  bottom?: number;
@@ -59,11 +59,11 @@ interface DrawOverlay {
59
59
  width?: number;
60
60
  }
61
61
  /**
62
- * Transform parameters threaded into `binding.input(stream).transform(...)`.
63
- * A structural subset of the real `ImageTransform`; the keys here are the
64
- * resize/format/optimize knobs apps reach for. Unknown extra keys on the real
65
- * binding are still accepted because the binding owns the authoritative type.
66
- */
62
+ * Transform parameters threaded into `binding.input(stream).transform(...)`.
63
+ * A structural subset of the real `ImageTransform`; the keys here are the
64
+ * resize/format/optimize knobs apps reach for. Unknown extra keys on the real
65
+ * binding are still accepted because the binding owns the authoritative type.
66
+ */
67
67
  interface TransformOptions {
68
68
  /** Background color (CSS color) painted under transparent images. */
69
69
  background?: string;
@@ -74,24 +74,24 @@ interface TransformOptions {
74
74
  /** Contrast multiplier (1 = unchanged). */
75
75
  contrast?: number;
76
76
  /**
77
- * URL-form overlays composited over the result, in paint order (last entry on
78
- * top). Consumed by the URL builders ({@link DrawOverlay} references each
79
- * overlay by `url`); the binding path applies overlays via the `overlays`
80
- * argument to `Images.transform` instead, so this key is ignored there.
81
- */
77
+ * URL-form overlays composited over the result, in paint order (last entry on
78
+ * top). Consumed by the URL builders ({@link DrawOverlay} references each
79
+ * overlay by `url`); the binding path applies overlays via the `overlays`
80
+ * argument to `Images.transform` instead, so this key is ignored there.
81
+ */
82
82
  draw?: DrawOverlay[];
83
83
  /**
84
- * Resize mode. Affects how `width`/`height` are interpreted.
85
- *
86
- * - `scale-down` — contain, but never enlarges.
87
- * - `contain` — fit within the box, preserving aspect ratio.
88
- * - `cover` — fill the box, cropping overflow.
89
- * - `crop` — shrink-and-crop to fit, but never enlarges.
90
- * - `aspect-crop` — crop to the target aspect ratio, but never enlarges.
91
- * - `pad` — fit within the box, padding the remainder with `background`.
92
- * - `squeeze` — stretch to the exact box, distorting aspect ratio.
93
- * - `scale-up` — enlarge to show the whole image, but never downscales.
94
- */
84
+ * Resize mode. Affects how `width`/`height` are interpreted.
85
+ *
86
+ * - `scale-down` — contain, but never enlarges.
87
+ * - `contain` — fit within the box, preserving aspect ratio.
88
+ * - `cover` — fill the box, cropping overflow.
89
+ * - `crop` — shrink-and-crop to fit, but never enlarges.
90
+ * - `aspect-crop` — crop to the target aspect ratio, but never enlarges.
91
+ * - `pad` — fit within the box, padding the remainder with `background`.
92
+ * - `squeeze` — stretch to the exact box, distorting aspect ratio.
93
+ * - `scale-up` — enlarge to show the whole image, but never downscales.
94
+ */
95
95
  fit?: "aspect-crop" | "contain" | "cover" | "crop" | "pad" | "scale-down" | "scale-up" | "squeeze";
96
96
  /** Mirror the image horizontally, vertically, or both. */
97
97
  flip?: "h" | "hv" | "v";
@@ -114,11 +114,11 @@ interface TransformOptions {
114
114
  /** Sharpen strength (0–10). */
115
115
  sharpen?: number;
116
116
  /**
117
- * Algorithm used when a transform enlarges the image (e.g. `fit: "scale-up"`).
118
- *
119
- * - `interpolate` — bicubic interpolation (default), may soften detail.
120
- * - `generate` — AI upscaling for sharper, more detailed enlargements.
121
- */
117
+ * Algorithm used when a transform enlarges the image (e.g. `fit: "scale-up"`).
118
+ *
119
+ * - `interpolate` — bicubic interpolation (default), may soften detail.
120
+ * - `generate` — AI upscaling for sharper, more detailed enlargements.
121
+ */
122
122
  upscale?: "generate" | "interpolate";
123
123
  /** Target width in pixels (integer). Clamped to the configured ceiling. */
124
124
  width?: number;
@@ -137,10 +137,10 @@ interface OutputOptions {
137
137
  quality?: number;
138
138
  }
139
139
  /**
140
- * The result of `binding.input(...).transform(...).output(...)`. Mirrors the
141
- * real `ImageTransformationResult` — a `Response`, the content type, and the
142
- * raw byte stream.
143
- */
140
+ * The result of `binding.input(...).transform(...).output(...)`. Mirrors the
141
+ * real `ImageTransformationResult` — a `Response`, the content type, and the
142
+ * raw byte stream.
143
+ */
144
144
  interface ImageTransformationResultLike {
145
145
  contentType: () => string;
146
146
  image: () => ReadableStream<Uint8Array>;
@@ -156,11 +156,11 @@ type ImageInfoLike = {
156
156
  format: string;
157
157
  };
158
158
  /**
159
- * Binding-side overlay options for `transformer.draw(image, options)` — the
160
- * blend/position/opacity knobs. Unlike {@link DrawOverlay} there is no `url`
161
- * (the overlay bytes are passed as the stream) and no `width`/`height` (the
162
- * overlay is pre-sized via its own transform); mirrors `ImageDrawOptions`.
163
- */
159
+ * Binding-side overlay options for `transformer.draw(image, options)` — the
160
+ * blend/position/opacity knobs. Unlike {@link DrawOverlay} there is no `url`
161
+ * (the overlay bytes are passed as the stream) and no `width`/`height` (the
162
+ * overlay is pre-sized via its own transform); mirrors `ImageDrawOptions`.
163
+ */
164
164
  interface ImageDrawOptions {
165
165
  /** Offset, in pixels, from the bottom edge. */
166
166
  bottom?: number;
@@ -178,10 +178,10 @@ interface ImageDrawOptions {
178
178
  top?: number;
179
179
  }
180
180
  /**
181
- * One overlay applied through the **binding** path (`Images.transform`'s
182
- * `overlays` argument). The overlay bytes come from `image` (any {@link ImageInput});
183
- * an optional `transform` pre-sizes/reformats the overlay before it is drawn.
184
- */
181
+ * One overlay applied through the **binding** path (`Images.transform`'s
182
+ * `overlays` argument). The overlay bytes come from `image` (any {@link ImageInput});
183
+ * an optional `transform` pre-sizes/reformats the overlay before it is drawn.
184
+ */
185
185
  interface ImageOverlay extends ImageDrawOptions {
186
186
  /** The overlay image bytes — a stream, buffer, `Blob`, or R2 object body. */
187
187
  image: ImageInput;
@@ -195,19 +195,19 @@ interface ImageTransformerLike {
195
195
  transform: (transform: TransformOptions) => ImageTransformerLike;
196
196
  }
197
197
  /**
198
- * Minimal projection of `ImagesBinding`. Declared structurally so unit tests can
199
- * pass a plain object double; the real `env.IMAGES` binding satisfies the same
200
- * shape. Only the input/transform/output chain and `info` are projected — the
201
- * hosted-images CRUD surface is out of scope.
202
- */
198
+ * Minimal projection of `ImagesBinding`. Declared structurally so unit tests can
199
+ * pass a plain object double; the real `env.IMAGES` binding satisfies the same
200
+ * shape. Only the input/transform/output chain and `info` are projected — the
201
+ * hosted-images CRUD surface is out of scope.
202
+ */
203
203
  interface ImagesBindingLike {
204
204
  info: (stream: ReadableStream<Uint8Array>) => Promise<ImageInfoLike>;
205
205
  input: (stream: ReadableStream<Uint8Array>) => ImageTransformerLike;
206
206
  }
207
207
  /**
208
- * An R2 object body (as returned by `ctx.storage.download(key)`) — first-class
209
- * transform input. Only `.body` is read, so a structural projection is enough.
210
- */
208
+ * An R2 object body (as returned by `ctx.storage.download(key)`) — first-class
209
+ * transform input. Only `.body` is read, so a structural projection is enough.
210
+ */
211
211
  interface R2ObjectBodyLike {
212
212
  body: ReadableStream | null;
213
213
  }
@@ -220,74 +220,89 @@ interface LunoraImagesOptions {
220
220
  maxDimension?: number;
221
221
  }
222
222
  /**
223
- * The action-only Images client wired onto `ctx.images`.
224
- *
225
- * The binding-backed `transform`/`info` calls are non-deterministic network /
226
- * compute I/O, so this lives on **ActionCtx only** — the same seam as `ctx.ai`.
227
- * The pure URL/signed-URL builders are exported as free functions (see
228
- * `index.ts`) and are safe to call from any handler.
229
- */
223
+ * The action-only Images client wired onto `ctx.images`.
224
+ *
225
+ * The binding-backed `transform`/`info` calls are non-deterministic network /
226
+ * compute I/O, so this lives on **ActionCtx only** — the same seam as `ctx.ai`.
227
+ * The pure URL/signed-URL builders are exported as free functions (see
228
+ * `index.ts`) and are safe to call from any handler.
229
+ */
230
230
  interface Images {
231
231
  /**
232
- * Probe an image for its format and (for raster formats) dimensions + byte
233
- * size, without running a transform. Wraps `binding.info(...)`.
234
- */
232
+ * Probe an image for its format and (for raster formats) dimensions + byte
233
+ * size, without running a transform. Wraps `binding.info(...)`.
234
+ */
235
235
  info: (input: ImageInput) => Promise<ImageInfoLike>;
236
236
  /**
237
- * Resize / reformat / optimize `input`, returning the transformed result
238
- * (a `Response`, content type, and byte stream). Accepts a raw stream/buffer,
239
- * a `Blob`, or an R2 object body straight from `ctx.storage.download(key)`.
240
- *
241
- * `transform` dimensions are clamped to the configured ceiling and the output
242
- * `format` is validated against the allowlist, so a hostile request can't
243
- * mint a multi-gigapixel canvas or an unexpected content type.
244
- *
245
- * `overlays` are composited over the result in order (last on top) via the
246
- * binding's `draw` step — each overlay's bytes come from its own `image`, with
247
- * optional per-overlay `transform` (resize/reformat) and blend/position options.
248
- */
237
+ * Resize / reformat / optimize `input`, returning the transformed result
238
+ * (a `Response`, content type, and byte stream). Accepts a raw stream/buffer,
239
+ * a `Blob`, or an R2 object body straight from `ctx.storage.download(key)`.
240
+ *
241
+ * `transform` dimensions are clamped to the configured ceiling and the output
242
+ * `format` is validated against the allowlist, so a hostile request can't
243
+ * mint a multi-gigapixel canvas or an unexpected content type.
244
+ *
245
+ * `overlays` are composited over the result in order (last on top) via the
246
+ * binding's `draw` step — each overlay's bytes come from its own `image`, with
247
+ * optional per-overlay `transform` (resize/reformat) and blend/position options.
248
+ */
249
249
  transform: (input: ImageInput, transform?: TransformOptions, output?: OutputOptions, overlays?: ImageOverlay[]) => Promise<ImageTransformationResultLike>;
250
250
  }
251
251
  /**
252
- * Build the action-only {@link Images} client over a Cloudflare Images binding.
253
- *
254
- * ```ts
255
- * const images = createImages({ binding: env.IMAGES });
256
- * const result = await images.transform(
257
- * await ctx.storage.download("uploads/avatar.png"),
258
- * { width: 256, height: 256, fit: "cover" },
259
- * { format: "image/webp", quality: 82 },
260
- * );
261
- * ```
262
- */
252
+ * Build the action-only {@link Images} client over a Cloudflare Images binding.
253
+ *
254
+ * ```ts
255
+ * const images = createImages({ binding: env.IMAGES });
256
+ * const result = await images.transform(
257
+ * await ctx.storage.download("uploads/avatar.png"),
258
+ * { width: 256, height: 256, fit: "cover" },
259
+ * { format: "image/webp", quality: 82 },
260
+ * );
261
+ * ```
262
+ */
263
263
  declare const createImages: (options: LunoraImagesOptions) => Images;
264
264
  interface ImageDeliveryUrlOptions {
265
265
  /** Delivery / transform origin, e.g. `https://cdn.acme.test`. */
266
266
  baseUrl: string;
267
267
  /**
268
- * Hosted-Images image id. When set, the **delivery-variant** form is built
269
- * (`&lt;baseUrl>/&lt;imageId>/&lt;variant>`) and `transform`/`key` are ignored.
270
- */
268
+ * Hosted-Images image id. When set, the **delivery-variant** form is built
269
+ * (`<baseUrl>/<imageId>/<variant>`) and `transform`/`key` are ignored.
270
+ */
271
271
  imageId?: string;
272
272
  /**
273
- * Source image — an absolute URL or an origin-relative key. Used by the
274
- * `/cdn-cgi/image/...` transform form. Ignored when `imageId` is set.
275
- */
273
+ * Source image — an absolute URL or an origin-relative key. Used by the
274
+ * `/cdn-cgi/image/...` transform form. Ignored when `imageId` is set.
275
+ */
276
276
  key?: string;
277
- /** Transform options for the `/cdn-cgi/image/&lt;options>/&lt;source>` form. */
277
+ /** Transform options for the `/cdn-cgi/image/<options>/<source>` form. */
278
278
  transform?: TransformOptions;
279
279
  /** Named delivery variant (e.g. `public`, `thumbnail`). Used with `imageId`; default `public`. */
280
280
  variant?: string;
281
281
  }
282
282
  /**
283
- * Build a Cloudflare Images delivery / transform URL.
284
- *
285
- * - With `imageId`: `&lt;baseUrl>/&lt;imageId>/&lt;variant>` (hosted delivery variant).
286
- * - With `key`: `&lt;baseUrl>/cdn-cgi/image/&lt;options>/&lt;source>` (URL-based transform).
287
- *
288
- * Pure and deterministic — usable from any handler.
289
- */
283
+ * Build a Cloudflare Images delivery / transform URL.
284
+ *
285
+ * - With `imageId`: `<baseUrl>/<imageId>/<variant>` (hosted delivery variant).
286
+ * - With `key`: `<baseUrl>/cdn-cgi/image/<options>/<source>` (URL-based transform).
287
+ *
288
+ * Pure and deterministic — usable from any handler.
289
+ */
290
290
  declare const buildImageDeliveryUrl: (options: ImageDeliveryUrlOptions) => string;
291
+ /**
292
+ * Parse a verified transform string (the `t` query value handed back by
293
+ * {@link verifySignedImageUrl}) back into the {@link TransformOptions} it was
294
+ * serialized from, so the Worker can apply exactly the signed transform via
295
+ * `ctx.images.transform(...)` without hand-writing the inverse encoding.
296
+ *
297
+ * The exact inverse of `serializeTransform` above — the two MUST evolve
298
+ * together (the round-trip test in
299
+ * `__tests__/images/signed-delivery-url.test.ts` pins the pairing). Throws a
300
+ * `TypeError` on an unknown key or an uncoercible value: the input is meant to
301
+ * be a string whose HMAC already verified, so a parse failure means
302
+ * encoder/decoder drift in the library, never user input — fail loud rather
303
+ * than silently un-binding the transform the signature protects.
304
+ */
305
+ declare const parseSignedTransform: (t: string) => TransformOptions;
291
306
  interface SignedImageUrlOptions {
292
307
  /** Delivery / Worker origin the signed URL points at (e.g. `https://cdn.acme.test`). */
293
308
  baseUrl: string;
@@ -298,41 +313,50 @@ interface SignedImageUrlOptions {
298
313
  /** HMAC secret. MUST NOT be shared across tenants. */
299
314
  secret: string;
300
315
  /**
301
- * Transform requested by this URL. Bound into the signature, so a client
302
- * can't alter the render without invalidating it. The Worker should apply
303
- * exactly this (verified) transform via `ctx.images.transform(...)`.
304
- */
316
+ * Transform requested by this URL. Bound into the signature, so a client
317
+ * can't alter the render without invalidating it. The Worker should apply
318
+ * exactly this (verified) transform via `ctx.images.transform(...)`.
319
+ */
305
320
  transform?: TransformOptions;
306
321
  }
307
322
  /**
308
- * Mint a Worker-signed image URL: `baseUrl` joined to `key`, plus `exp` (unix
309
- * seconds), the serialized `t` (transform), and `sig` (base64url HMAC). The
310
- * canonical binds host + key + expiry + transform.
311
- *
312
- * The Worker handling the route should call {@link verifySignedImageUrl} to
313
- * validate before serving / transforming.
314
- */
323
+ * Mint a Worker-signed image URL: `baseUrl` joined to `key`, plus `exp` (unix
324
+ * seconds), the serialized `t` (transform), and `sig` (base64url HMAC). The
325
+ * canonical binds host + key + expiry + transform.
326
+ *
327
+ * The Worker handling the route should call {@link verifySignedImageUrl} to
328
+ * validate before serving / transforming.
329
+ */
315
330
  declare const buildSignedImageUrl: (options: SignedImageUrlOptions) => Promise<string>;
316
331
  interface VerifyImageResult {
317
332
  /** The verified image key (route pathname). */
318
333
  key?: string;
319
334
  /**
320
- * Internal-only failure reason for server logs/diagnostics. **Do not echo to
321
- * clients** — a precise reason ("expired" vs "bad_signature") is a signing
322
- * oracle. Public responses should expose only `valid`.
323
- */
335
+ * Internal-only failure reason for server logs/diagnostics. **Do not echo to
336
+ * clients** — a precise reason ("expired" vs "bad_signature") is a signing
337
+ * oracle. Public responses should expose only `valid`.
338
+ */
324
339
  reason?: "bad_signature" | "expired" | "malformed";
325
340
  /** The raw, verified transform string (the `t` query value), when present. */
326
341
  transform?: string;
342
+ /**
343
+ * The verified transform decoded back into the options object to pass to
344
+ * `ctx.images.transform(...)` — {@link parseSignedTransform} applied to
345
+ * `transform`. Left `undefined` when `transform` is absent, and also when a
346
+ * genuinely signed transform carries a key this build does not know (an
347
+ * old URL minted before a key was renamed): the request stays `valid`, the
348
+ * raw `transform` is still returned, and the caller decides.
349
+ */
350
+ transformOptions?: TransformOptions;
327
351
  valid: boolean;
328
352
  }
329
353
  /**
330
- * Verify a {@link buildSignedImageUrl} output. By default the signature is
331
- * canonicalized against the inbound `url.host`; pass `expectedHost` for a
332
- * CDN/host-rewrite topology where the Worker sees a different host than the one
333
- * the URL was minted for.
334
- */
354
+ * Verify a {@link buildSignedImageUrl} output. By default the signature is
355
+ * canonicalized against the inbound `url.host`; pass `expectedHost` for a
356
+ * CDN/host-rewrite topology where the Worker sees a different host than the one
357
+ * the URL was minted for.
358
+ */
335
359
  declare const verifySignedImageUrl: (input: string | URL, secret: string, options?: {
336
360
  expectedHost?: string;
337
361
  }) => Promise<VerifyImageResult>;
338
- export { type DrawOverlay, type ImageCompositeMode, type ImageDeliveryUrlOptions, type ImageDrawOptions, type ImageInfoLike, type ImageInput, type ImageOutputFormat, type ImageOverlay, type ImageTransformationResultLike, type ImageTransformerLike, type Images, type ImagesBindingLike, type LunoraImagesOptions, type OutputOptions, type R2ObjectBodyLike, type SignedImageUrlOptions, type TransformOptions, type VerifyImageResult, buildImageDeliveryUrl, buildSignedImageUrl, createImages, verifySignedImageUrl };
362
+ export { type DrawOverlay, type ImageCompositeMode, type ImageDeliveryUrlOptions, type ImageDrawOptions, type ImageInfoLike, type ImageInput, type ImageOutputFormat, type ImageOverlay, type ImageTransformationResultLike, type ImageTransformerLike, type Images, type ImagesBindingLike, type LunoraImagesOptions, type OutputOptions, type R2ObjectBodyLike, type SignedImageUrlOptions, type TransformOptions, type VerifyImageResult, buildImageDeliveryUrl, buildSignedImageUrl, createImages, parseSignedTransform, verifySignedImageUrl };