@juulsgaard/ts-tools
    Preparing search index...

    Class FileTypeList<TEnum>

    A collection of file types corresponding to enum values

    Type Parameters

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

      An enum of filetypes

    Index

    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 TEnum[keyof TEnum] | null

    • 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 TEnum[keyof TEnum] | null