Asset
Asset
A model representing a file reference in Skygear record.
Static Method Summary
Static Public Methods | ||
public static |
Constructs a new Asset object from JSON object. |
Constructor Summary
Public Constructor | ||
public |
constructor(attrs: Object) Constructs a new Asset object. |
Member Summary
Public Members | ||
public |
contentType: String Mime of the file |
|
public |
file: File | Blob File object |
|
public |
name: String Asset name |
|
public |
url: String Url of the file on Skygear server |
Method Summary
Public Methods | ||
public |
toJSON(): Object Serializes Asset to a JSON object. |
Static Public Methods
Public Constructors
public constructor(attrs: Object) source
Constructs a new Asset object. Either file, url or base64 must be provided.
Params:
Name | Type | Attribute | Description |
attrs | Object | ||
attrs.name | String | asset name |
|
attrs.file | File | Blob | Buffer |
|
file or buffer object |
attrs.base64 | String |
|
base64 encoded file content |
attrs.contentType | String |
|
mime of the file |
attrs.url | String |
|
url of the file on Skygear server |