Resource Class

Module: Resources

Resource class is used to represent resources.

Resources store data that is used by objects.

Item Index

Methods

Methods

export

(
  • fname
)

Export resource data to file.

Parameters:

  • fname String

    File name or file path.

toJSON

(
  • meta
)
Object

Serialize resource to json.

Only serializes name, uuid and type.

Parameters:

  • meta Object

Returns:

Object:

json

Properties

data

Object

Resource data.

encoding

String, ArrayBuffer, ...

Data encoding (mp3, jpg, mp4, ...).

Indicates how the data is encoded.

format

Object

Data format (base64, arraybuffer, blob, url, ...).

Indicates the format used to store the data.

name

String

Resource name.

Not required to be unique.

type

String

Resource type. Used to identify the type of the resource, usefull for serialization.

uuid

String

UUID unique identifier.