@devino.solutions/upup
Version:
27 lines (26 loc) • 1.05 kB
TypeScript
import { FileWithParams, UpupUploaderProps } from '../../shared/types';
/**
* @param bytes assign keyword depend on size
*/
export declare const bytesToSize: (bytes: number) => string;
/**
* @param size
* @param unit
*/
export declare const sizeToBytes: (size: number, unit?: 'B' | 'KB' | 'MB' | 'GB' | 'TB' | 'PB' | 'EB' | 'ZB' | 'YB') => number;
/**
* @param file
* @param maxFileSize
*/
export declare function checkFileSize(file: File, maxFileSize: UpupUploaderProps['maxFileSize']): boolean;
export declare const fileAppendParams: (file: File) => FileWithParams;
export declare function compressFile(file: FileWithParams): Promise<FileWithParams>;
export declare function searchDriveFiles<T extends {
name: string;
}>(files: T[], searchTerm: string, options?: {
caseSensitive?: boolean;
exactMatch?: boolean;
maxResults?: number;
}): T[];
export declare function fileGetIsImage(fileType: string): boolean;
export declare function fileGetExtension(fileType: string, fileName: string): string;