UNPKG

@sprucelabs/schema

Version:

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

19 lines (18 loc) • 1.32 kB
import { FieldDefinition } from './field.static.types'; export declare const supportedFileTypes: readonly ["image/png", "image/jpeg", "image/gif", "image/webp", "image/svg+xml", "image/bmp", "image/tiff", "image/heic", "video/mp4", "video/webm", "video/quicktime", "video/x-msvideo", "video/x-matroska", "audio/mpeg", "audio/wav", "audio/ogg", "audio/aac", "application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "text/plain", "text/csv", "application/rtf", "application/zip", "application/x-tar", "application/x-7z-compressed", "application/x-rar-compressed", "image/*", "video/*", "audio/*", "*"]; export type SupportedFileType = (typeof supportedFileTypes)[number]; export interface FileFieldValue { name: string; id?: string; type?: SupportedFileType; uri?: string; base64?: string; previewUrl?: string; } export type FileFieldDefinition = FieldDefinition<FileFieldValue> & { /** * .File - a great way to deal with file management */ type: 'file'; options?: { acceptableTypes: SupportedFileType[]; }; };