Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MimeData

An object which stores MIME data for general application use.

Notes

This class does not attempt to enforce "correctness" of MIME types and their associated data. Since this class is designed to transfer arbitrary data and objects within the same application, it assumes that the user provides correct and accurate data.

Hierarchy

  • MimeData

Index

Properties

Private _types

_types: string[] = []

Private _values

_values: any[] = []

Methods

clear

  • clear(): void
  • Remove all data entries from the dataset.

    Returns void

clearData

  • clearData(mime: string): void
  • Remove the data entry for the given MIME type.

    Parameters

    • mime: string

      The MIME type of interest.

      Notes

      This is a no-op if there is no entry for the given MIME type.

    Returns void

getData

  • getData(mime: string): any | undefined
  • Get the data value for the given MIME type.

    Parameters

    • mime: string

      The MIME type of interest.

    Returns any | undefined

    The value for the given MIME type, or undefined if the dataset does not contain a value for the type.

hasData

  • hasData(mime: string): boolean
  • Test whether the dataset has an entry for the given type.

    Parameters

    • mime: string

      The MIME type of interest.

    Returns boolean

    true if the dataset contains a value for the given MIME type, false otherwise.

setData

  • setData(mime: string, data: any): void
  • Set the data value for the given MIME type.

    Parameters

    • mime: string

      The MIME type of interest.

    • data: any

      The data value for the given MIME type.

      Notes

      This will overwrite any previous entry for the MIME type.

    Returns void

types

  • types(): string[]
  • Get an array of the MIME types contained within the dataset.

    Returns string[]

    A new array of the MIME types, in order of insertion.

Generated using TypeDoc