import type { EponymeImageCrop, EponymeImageFocal, EponymeImageInput, EponymeImageRatio, EponymeImageValue } from '../types/field.js'; /** * Pure: `field.image()` reaches this file from `eponyme.config.ts`, and public pages read it through * ``, so it cannot depend on the locale or on anything server-side. */ export declare const EPONYME_IMAGE_CENTER: Readonly; export declare const EPONYME_DEFAULT_IMAGE_CROPS: readonly EponymeImageRatio[]; /** Keys an image value may carry. Anything else is refused rather than stored. */ export declare const EPONYME_IMAGE_KEYS: readonly ["src", "alt", "width", "height", "focal", "caption", "mime", "size"]; /** `'16:9'`, `'4/5'` or `1.5` as width over height, or `undefined` for anything that is not a ratio. */ export declare function parseEponymeImageRatio(ratio: unknown): number | undefined; /** The crops a field previews, with the default applied and every ratio checked once, at config time. */ export declare function normalizeEponymeImageCrops(crops: ReadonlyArray | undefined): EponymeImageCrop[]; /** A label for a ratio the author did not name: `16:9` stays `16:9`, `1.5` becomes `1.5:1`. */ export declare function eponymeImageRatioLabel(crop: EponymeImageCrop): string; /** A focal point that can be used as is: in range, rounded, centred when absent or broken. */ export declare function toEponymeImageFocal(value: unknown): EponymeImageFocal; /** * Reads anything a template might be handed - a stored value, a value saved before images were objects, * which is a bare address, or nothing - into a value that renders. Never throws, never refuses: a broken * part falls back rather than hiding the picture. */ export declare function toEponymeImageValue(value: unknown): EponymeImageValue | null; /** * The canonical stored form, applied on every read and every write. A bare address - what this field * stored before images were objects - becomes an object centred on the picture, and an empty one becomes `null`. * * Unlike {@link toEponymeImageValue}, a value of the wrong shape is returned untouched: validation runs on * what normalising produced, and it has to see the mistake to refuse it. */ export declare function normalizeEponymeImage(value: unknown): unknown; /** For `defaultValue`, which takes a bare address as well as a value. */ export declare function normalizeEponymeImageInput(input: EponymeImageInput | null | undefined): EponymeImageValue | null | undefined; /** The address of an image value, a legacy string, or nothing. */ export declare function eponymeImageSrc(value: unknown): string; /** `object-position` for a focal point: what keeps it in view once `object-fit: cover` crops the picture. */ export declare function eponymeImageObjectPosition(focal: EponymeImageFocal | undefined): string; export interface EponymeImageAttrsOptions { /** Crops the picture to this shape around its focal point, with `object-fit: cover`. */ ratio?: EponymeImageRatio; /** Rendered width in pixels. Defaults to the picture's own; the height follows the ratio. */ width?: number; /** Replaces the stored text alternative, for a page that knows better. */ alt?: string; } /** Attributes for an ``, or `null` when there is nothing to show. */ export interface EponymeImageAttrs { src: string; alt: string; width?: number; height?: number; style: { objectPosition: string; objectFit?: 'cover'; aspectRatio?: string; }; } /** * What a page needs to render an image value: its address and alternative, a width and a height that * reserve the space before it loads, and the `object-position` that keeps the focal point in any crop. */ export declare function eponymeImageAttrs(value: unknown, options?: EponymeImageAttrsOptions): EponymeImageAttrs | null;