Saltar al contenido
⌘K

ImageProvider

Ver como Markdown
En esta página
Esta referencia de la API se genera a partir de los comentarios de TypeScript en inglés. Los nombres, las firmas y los ejemplos corresponden al paquete publicado.

Deterministic, synchronous delivery hooks. Ardo emits originals; a site's deploy uploads them.

import type { ImageProvider } from "ardo/config"

type ImageProvider = {
    source: (input: {
        /** SHA-256 of the original bytes, all 64 hexadecimal characters. */
        sha256: string;
        extension: string;
        /** Dimensions after applying EXIF orientation. */
        width: number;
        height: number;
        /** EXIF orientation of the original bytes. Apply it before the crop. */
        orientation: number;
        /** Deployment base Ardo uses for its own URLs; root-relative provider URLs must include it. */
        base: string;
    }) => {
        fileName: string;
        url: string;
    };
    url: (input: {
        source: string;
        crop: ImageCropRectangle;
        width: number;
        height: number;
        kind: "rendition" | "fallback";
    }) => {
        url: string;
        type: ImageMimeType;
    };
};

Properties

NameTypeRequired
source(input: { sha256: string; extension: string; width: number; height: number; orientation: number; base: string }) => { fileName: string; url: string }Yes
url(input: { source: string; crop: ImageCropRectangle; width: number; height: number; kind: "rendition" | "fallback" }) => { url: string; type: ImageMimeType }Yes