file-type-checker
Version:
Detect and validate file types by their signatures (✨magic numbers✨)
17 lines (16 loc) • 711 B
TypeScript
import { ValidateFileTypeOptions } from "../core";
export * from "./audio";
export * from "./compressed";
export * from "./image";
export * from "./other";
export * from "./video";
/**
* Validates the requested file signature against a list of accepted file types
*
* @param file File content represents in Array<number> / ArrayBuffer / Uint8Array
* @param types A list of accepted file types
* @param options parameters for additional actions
*
* @returns {boolean} True if found a type signature from the accepted file types, otherwise false
*/
export declare function validateFileType(file: Array<number> | ArrayBuffer | Uint8Array, types: Array<string>, options?: ValidateFileTypeOptions): boolean;