alinea
Version:
Headless git-based CMS
53 lines (52 loc) • 2.49 kB
TypeScript
import type { WithoutLabel } from 'alinea/core/Field';
import type { InferStoredValue } from 'alinea/core/Infer';
import type { Label } from 'alinea/core/Label';
import type { Type } from 'alinea/core/Type';
import type { ListRow } from 'alinea/core/shape/ListShape';
import { type LinkField, type LinkFieldOptions, type LinksField } from 'alinea/field/link/LinkField';
import { type EntryPickerOptions } from 'alinea/picker/entry';
import type { EntryReference } from 'alinea/picker/entry/EntryReference';
export interface ImageLink<InferredFields = undefined> extends EntryReference {
title: string;
src: string;
url: string;
extension: string;
size: number;
hash: string;
width: number;
height: number;
averageColor: string;
thumbHash: string;
focus: {
x: number;
y: number;
};
fields: InferredFields;
}
export declare namespace ImageLink {
const title: import("alinea/core/Expr").Expr<string>;
const src: import("../hidden").HiddenField<string>;
const extension: import("../hidden").HiddenField<string>;
const size: import("../hidden").HiddenField<number>;
const hash: import("../hidden").HiddenField<string>;
const width: import("../hidden").HiddenField<number>;
const height: import("../hidden").HiddenField<number>;
const averageColor: import("../hidden").HiddenField<string>;
const thumbHash: import("../hidden").HiddenField<string>;
const focus: import("../hidden").HiddenField<{
x: number;
y: number;
}>;
}
export interface ImageField<Fields = undefined> extends LinkField<EntryReference & InferStoredValue<Fields>, ImageLink<Type.Infer<Fields>>> {
}
export interface ImageOptions<Fields> extends LinkFieldOptions<EntryReference & InferStoredValue<Fields>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
}
export declare function image<Fields = undefined>(label: Label, options?: WithoutLabel<ImageOptions<Fields>>): ImageField<Fields>;
export interface ImagesField<Fields = undefined> extends LinksField<EntryReference & ListRow & InferStoredValue<Fields>, ImageLink<Type.Infer<Fields>>> {
}
export declare namespace image {
interface ImagesOptions<Fields> extends LinkFieldOptions<Array<EntryReference & ListRow & InferStoredValue<Fields>>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
}
function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<ImagesOptions<Fields>>): ImagesField<Fields>;
}