@theredhead — Frontend Library - v1.0.0
    Preparing search index...

    Parsed representation of an allowed-types mask.

    Build one from a comma-separated string (the HTML <input accept> format) using parseAllowedTypes, or construct it directly.

    const types = parseAllowedTypes(".ts, .tsx, image/*, application/json");
    types.matches("photo.png", "image/png"); // true
    types.matches("README.md"); // false
    interface AllowedFileTypes {
        entries: readonly AllowedFileType[];
        matches(name: string, mimeType?: string): boolean;
    }
    Index

    Properties

    Methods

    Properties

    entries: readonly AllowedFileType[]

    The individual type rules that make up this mask.

    Methods

    • Returns true if the given filename (and optional MIME type) is permitted by at least one rule. Directories always return true.

      Parameters

      • name: string

        The file name (used for extension matching).

      • OptionalmimeType: string

        Optional MIME type string (used for mime rules).

      Returns boolean