module:bajaux/dragdrop/Envelope

module:bajaux/dragdrop/Envelope

(abstract) new (require("bajaux/dragdrop/Envelope"))(arr)

Description:
  • Base class for Envelope implementations. These define methods of
    transformation between raw JSON and data values (Baja values or otherwise),
    for use in drag/drop or other data-transfer situations.

Source:
Parameters:
Name Type Description
arr Array

an array of values to store in this envelope

Methods

(abstract) getMimeType() → {String}

Description:
  • Get a mime type to identify the data type transformed by this envelope.

Source:
Returns:
Type
String

(abstract) toJson() → {Promise.<Array.<object>>}

Description:
  • Get a JSON representation of the data contained in this envelope.

Source:
Returns:

a promise to be resolved with an array of
raw JSON objects

Type
Promise.<Array.<object>>

(abstract) toValues() → {Promise.<Array.<object>>}

Description:
  • Get the actual values represented by this envelope.

Source:
Returns:

a promise to be resolved with an array of
data values

Type
Promise.<Array.<object>>