Skip to main content

Module: fsx

Provides functionallity for loading content across browser / node environment

Methods

(static) loadImage(src) → {ImageBitmap}

Parameters:
NameTypeDescription
srcURL|ArrayBuffer|Uint8Array|Blob|Image|Canvas|OffscreenCanvas
Returns:

Loaded content

Type

ImageBitmap

(static) readFile(src, typeopt, optionsopt) → {Uint8Array|Blob|JSON|Text}

Parameters:
NameTypeAttributesDefaultDescription
srcUSVString|Request
typestring<optional>binaryType could be - binary | blob | base64 | json | text.
optionsobject<optional>{mode: "no-cors"}Fetch options
Returns:

File content

Type

Uint8Array|Blob|JSON|Text

(static) saveAs(content, filename, contentTypeopt)

Parameters:
NameTypeAttributesDefaultDescription
contentBlob|TypedArray|ArrayBuffer|USVString|Array.<(ArrayBuffer|ArrayBufferView|Blob|USVString)>
filenamestring
contentTypestring<optional>application/octet-stream

Home