Home Manual Reference Source
public class | source

DownloadedResource

Downloaded resource from the api

Static Method Summary

Static Public Methods
public static

fromAxiosResponse(axiosResponse: AxiosResponse): DownloadedResource

Build instance from Axios response

Constructor Summary

Public Constructor
public

constructor(data: ArrayBuffer | Buffer, type: string, fileName: string)

Member Summary

Public Members
public get

data: ArrayBuffer | Buffer: *

In Nodejs it will return a Buffer and in the browser it will respond with a ArrayBuffer

public get

Resource file name, if available

public get

size: Number: *

Get the size of the data

public get

type: string: *

Resource mime-type

Method Summary

Public Methods
public

Create a object url The URL lifetime is tied to the document in the window on which it was created.

public

Base64 encode data

public

Get base64-encoded data uri

public

toString(): *

Static Public Methods

public static fromAxiosResponse(axiosResponse: AxiosResponse): DownloadedResource source

Build instance from Axios response

Params:

NameTypeAttributeDescription
axiosResponse AxiosResponse

axios response

Return:

DownloadedResource

instance

Public Constructors

public constructor(data: ArrayBuffer | Buffer, type: string, fileName: string) source

Params:

NameTypeAttributeDescription
data ArrayBuffer | Buffer

data

type string
  • optional
  • default: application/octet-stream

mime-type

fileName string
  • optional
  • default: Untitled

file name

Public Members

public get data: ArrayBuffer | Buffer: * source

In Nodejs it will return a Buffer and in the browser it will respond with a ArrayBuffer

Return:

ArrayBuffer | Buffer

resource data

public get fileName: string: * source

Resource file name, if available

Return:

string

file name

public get size: Number: * source

Get the size of the data

Return:

Number

size in bytes

public get type: string: * source

Resource mime-type

Return:

string

mime-type

Public Methods

public createObjectUrl(): string source

Create a object url The URL lifetime is tied to the document in the window on which it was created. The new object URL represents the resource. Do not forget to release the object urls once used.

Return:

string

object url

See:

public toBase64(): string source

Base64 encode data

Return:

string

base64 encoded data

public toDataUri(): string source

Get base64-encoded data uri

Return:

string

data uri

See:

public toString(): * source

Return:

*