UNPKG

@cf-wasm/og

Version:

Generate Open Graph Images dynamically from HTML/CSS without a browser.

24 lines 1.05 kB
import { OnlyProps } from "./types.js"; import { VNode } from "./satori.js"; import { RenderOptions } from "./render.js"; import { ReactNode } from "react"; //#region src/core/response.d.ts interface RenderAsResponseOptions extends OnlyProps<ResponseInit, 'headers' | 'status' | 'statusText' | 'cf'> { format?: 'svg' | 'png'; } /** An interface representing options for ImageResponse */ interface ImageResponseOptions extends RenderOptions, RenderAsResponseOptions {} /** A class for rendering {@link ReactNode} to image as {@link Response} */ declare class ImageResponse extends Response { /** * Creates an instance of {@link ImageResponse} * * @param element The {@link ReactNode} * @param options The {@link ImageResponseOptions} */ constructor(element: ReactNode | VNode, options?: ImageResponseOptions); static async(element: ReactNode | VNode, options?: ImageResponseOptions): Promise<Response>; } //#endregion export { ImageResponse, ImageResponseOptions, RenderAsResponseOptions }; //# sourceMappingURL=response.d.ts.map