Askr documentation
Generated API snapshot

@askrjs/vite/image

Exports from the declarations published in @askrjs/vite. Signatures reflect the published artifact.

Exports

This entrypoint publishes 10 exports. Use the anchored symbol rows for direct links. Type-only exports are labeled separately from runtime values.

image

image: { (source: URL, options?: ImageOptions): ResponsiveImage; (source: ResponsiveImage): ResponsiveImage; }

Declare a source-controlled image for the opt-in Vite image pipeline.

Image

Image: (props: ImageProps) => ReturnType<typeof jsxs>

Render responsive metadata as accessible picture/source/img markup.

ImageFittype

ImageFit: "inside" | "cover"

Resize strategy: `"inside"` fits within bounds, `"cover"` crops to fill.

ImageOptionstype

ImageOptions: any

Per-declaration overrides for a single `image()` call.

widths
widths?: readonly number[];
formats
formats?: readonly ImageOutputFormat[];
quality
quality?: ImageQualityOptions;
fit
fit?: ImageFit;
aspectRatio
Required output width/height ratio when fit is cover.
position
Sharp-compatible crop position. Defaults to centre.

ImageOutputFormattype

ImageOutputFormat: "avif" | "webp" | "source"

Output image formats the pipeline can emit; `"source"` keeps the original format.

ImagePipelineOptionstype

ImagePipelineOptions: any

Plugin-level defaults applied to every `image()` declaration.

widths
widths?: readonly number[];
formats
formats?: readonly ImageOutputFormat[];
quality
quality?: ImageQualityOptions;

ImagePropstype

ImageProps: any

Props accepted by the {@link Image} component.

alt
alt: string;
image
image: ResponsiveImage;
sizes
sizes?: string | undefined;

ImageQualityOptionstype

ImageQualityOptions: any

Per-format quality settings (0-100) used when encoding output images.

avif
avif?: number;
webp
webp?: number;
jpeg
jpeg?: number;
png
png?: number;

ResponsiveImagetype

ResponsiveImage: any

Build-time-resolved metadata for a declared image, ready to render.

__askrImage
readonly __askrImage: true;
src
readonly src: string;
srcset
readonly srcset?: string;
width
readonly width: number;
height
readonly height: number;
sources
readonly sources: readonly ResponsiveImageSource[];

ResponsiveImageSourcetype

ResponsiveImageSource: any

A single `<source>` candidate within a {@link ResponsiveImage}.

type
type: string;
srcset
srcset: string;