UNPKG

sfs-file-type

Version:

File type mappings for SFS

33 lines (32 loc) 1.24 kB
export type sfsFileType = "archieve" | "audio" | "book" | "code" | "document" | "executable" | "font" | "image" | "sheet" | "slide" | "video" | "web" | "other"; /** * An object mapping file categories to their respective file extension arrays. */ export declare const fileExtensions: { archive: string[]; audio: string[]; book: string[]; code: string[]; document: string[]; executable: string[]; font: string[]; image: string[]; sheet: string[]; slide: string[]; video: string[]; web: string[]; }; /** * Determines the file type for a given file extension that includes a leading dot. * * @param extension - The file extension string, including the leading dot (e.g., ".jpg"). * @returns The type name as a string if found, otherwise "other". */ export declare function dotExtensionToCategotry(extension: string): sfsFileType; /** * Determines the file type for a given file extension without a leading dot. * * @param extension - The file extension string without the leading dot (e.g., "jpg"). * @returns The type name as a string if found, otherwise "other". */ export declare function extensionToCategotry(extension: string): sfsFileType;