UNPKG

@stoar/sdk

Version:

JavaScript/TypeScript SDK for STOAR - Decentralized file storage on Arweave

49 lines 1.74 kB
/** * Get MIME type for a file based on its name or extension * @param fileName - The file name or path * @returns The MIME type or 'application/octet-stream' as default */ export declare function getMimeType(fileName: string): string; /** * Get file extension for a MIME type * @param mimeType - The MIME type * @returns The file extension (without dot) or false if not found */ export declare function getExtension(mimeType: string): string | false; /** * Get content type with charset for text-based MIME types * @param fileName - The file name or path * @returns The content type with charset if applicable */ export declare function getContentType(fileName: string): string; /** * Check if a file is likely to be text-based * @param fileName - The file name or path * @returns True if the file is likely text-based */ export declare function isTextFile(fileName: string): boolean; /** * Check if a file is an image * @param fileName - The file name or path * @returns True if the file is an image */ export declare function isImageFile(fileName: string): boolean; /** * Check if a file is a video * @param fileName - The file name or path * @returns True if the file is a video */ export declare function isVideoFile(fileName: string): boolean; /** * Check if a file is audio * @param fileName - The file name or path * @returns True if the file is audio */ export declare function isAudioFile(fileName: string): boolean; /** * Get a human-readable file type category * @param fileName - The file name or path * @returns A category string like 'image', 'video', 'audio', 'text', 'document', or 'other' */ export declare function getFileCategory(fileName: string): string; //# sourceMappingURL=mime.d.ts.map