UNPKG

@sprucelabs/schema

Version:

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

17 lines (16 loc) • 602 B
import { FieldDefinition } from './field.static.types'; export declare const supportedFileTypes: readonly ["image/png", "image/svg+xml", "image/jpeg", "application/pdf", "text/csv", "*"]; export type SupportedFileType = (typeof supportedFileTypes)[number]; export interface FileFieldValue { name: string; type?: SupportedFileType; uri?: string; base64?: string; } export type FileFieldDefinition = FieldDefinition<FileFieldValue> & { /** * .File - a great way to deal with file management */ type: 'file'; options?: { acceptableTypes: SupportedFileType[]; }; };