UNPKG

@llamaindex/ui

Version:

A comprehensive UI component library built with React, TypeScript, and Tailwind CSS for LlamaIndex applications

86 lines (84 loc) 2.53 kB
/** * Supported file types for document parsing and extraction */ declare enum FileType { JPEG = "jpeg", JPG = "jpg", PNG = "png", WEBP = "webp", PDF = "pdf", DOC = "doc", DOCX = "docx", XLS = "xls", XLSX = "xlsx", PPT = "ppt", PPTX = "pptx", TXT = "txt", CSV = "csv", JSON = "json", XML = "xml", HTML = "html", CSS = "css", JS = "js", TS = "ts", MD = "md" } /** * Predefined file type groups for common use cases */ declare const FILE_TYPE_GROUPS: { IMAGES: FileType[]; DOCUMENTS: FileType[]; TEXT: FileType[]; SPREADSHEETS: FileType[]; PRESENTATIONS: FileType[]; COMMON_IMAGES: FileType[]; OFFICE_DOCS: FileType[]; }; /** * Gets file type definition by FileType enum */ declare const getFileTypeDefinition: (fileType: FileType) => { extensions: string[]; mimeTypes: string[]; displayName: string; category: string; }; /** * Gets all supported extensions for a FileType */ declare const getFileExtensions: (fileType: FileType) => string[]; /** * Gets all supported MIME types for a FileType */ declare const getFileMimeTypes: (fileType: FileType) => string[]; /** * Checks if a file matches the given FileType */ declare const isFileTypeMatch: (file: File, fileType: FileType) => boolean; /** * File validation with FileType enum system */ declare const validateFile: (file: File, allowedFileTypes?: FileType[], maxFileSizeBytes?: number) => string | null; /** * Gets all file types by category */ declare const getFileTypesByCategory: (category: string) => FileType[]; /** * Creates a validation function for a specific file type group */ declare const createFileTypeValidator: (allowedTypes: FileType[], maxSizeBytes?: number) => (file: File) => string | null; /** * Formats file size in human-readable format using decimal (SI) units * Uses powers of 1000 for true KB, MB, GB calculations */ declare const formatFileSize: (bytes: number) => string; /** * Checks if the current environment supports the File API */ declare const isFileApiSupported: () => boolean; /** * Checks if the current environment supports the Web Crypto API */ declare const isCryptoSupported: () => boolean; export { FileType as F, FILE_TYPE_GROUPS as a, getFileExtensions as b, getFileMimeTypes as c, getFileTypesByCategory as d, createFileTypeValidator as e, formatFileSize as f, getFileTypeDefinition as g, isFileApiSupported as h, isFileTypeMatch as i, isCryptoSupported as j, validateFile as v };