Class FileTypeList<TEnum>

A collection of file types corresponding to enum values

Type Parameters

  • TEnum extends {
        [key: string]: string;
    }

    An enum of filetypes

Constructors

Properties

Accessors

Methods

Constructors

Properties

mimeFilter: string

A mimetype filter for use in file inputs

Accessors

Methods

  • Get the first match in the collection which matches the file

    Parameters

    • file: File

    Returns null | TEnum[keyof TEnum]

  • Get the first match in the collection which matches the filename and mimetype

    Parameters

    • filename: string

      The filename of the file

    • type: string

      The mimetype of the file

    Returns null | TEnum[keyof TEnum]