Images
Source:
src/Cloudflare/Images/Images.ts
A Cloudflare Images binding for image transformation inside Workers — a Worker-only binding with no backing cloud resource.
Images is a single value that is at once the Binding.Service tag, the
callable that produces an ImagesBinding, and the type. Declare it on a
Worker’s env (it flows through InferEnv → cf.ImagesBinding) or yield*
it inside an Effect-native Worker to attach the binding and obtain the
ImagesClient.
Effect-style Worker (recommended)
Section titled “Effect-style Worker (recommended)”import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
Cloudflare.Worker("ImageWorker", { main: import.meta.url }, Effect.gen(function* () { const images = yield* Cloudflare.Images.Images("PIPELINE"); return { fetch: Effect.gen(function* () { const request = yield* HttpServerRequest; const info = yield* images.info(request.stream); return yield* HttpServerResponse.json(info); }), }; }).pipe(Effect.provide(Cloudflare.Images.ImagesBinding)),);Binding to a Worker (declarative)
Section titled “Binding to a Worker (declarative)”export const Worker = Cloudflare.Worker("Worker", { main: "./src/worker.ts", env: { MEDIA: Cloudflare.Images.Images("PIPELINE") },});
export type WorkerEnv = Cloudflare.InferEnv<typeof Worker>;// { MEDIA: ImagesBinding }