UNPKG

@sprucelabs/schema

Version:

Static and dynamic binding plus runtime validation and transformation to ensure your app is sound. 🤓

29 lines (28 loc) • 764 B
import { FieldDefinition } from './field.static.types'; import { SupportedFileType } from './FileField.types'; /** * Min dimension for each size xl: 1024 l: 500 m: 60 s: 30 */ export declare const requiredImageSizes: readonly ["s", "m", "l", "xl", "*"]; export type RequiredImageSize = (typeof requiredImageSizes)[number]; export interface ImageFieldValue { name: string; id?: string; base64?: string; type?: SupportedFileType; sUri?: string; mUri?: string; lUri?: string; xlUri?: string; } export type ImageFieldDefinition = FieldDefinition<ImageFieldValue> & { /** * .image - a great way to deal with file management */ type: 'image'; options?: { requiredSizes: RequiredImageSize[]; }; };