Module: fsx
Provides functionallity for loading content across browser / node environment
Methods
(static) loadImage(src) → {ImageBitmap}
Parameters:
Name | Type | Description |
---|---|---|
src | URL|ArrayBuffer|Uint8Array|Blob|Image|Canvas|OffscreenCanvas |
Returns:
Loaded content
Type
ImageBitmap
(static) readFile(src, typeopt, optionsopt) → {Uint8Array|Blob|JSON|Text}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
src | USVString|Request | |||
type | string | <optional> | binary | Type could be - binary | blob | base64 | json | text. |
options | object | <optional> | {mode: "no-cors"} | Fetch options |
Returns:
File content
Type
Uint8Array|Blob|JSON|Text
(static) saveAs(content, filename, contentTypeopt)
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
content | Blob|TypedArray|ArrayBuffer|USVString|Array.<(ArrayBuffer|ArrayBufferView|Blob|USVString)> | |||
filename | string | |||
contentType | string | <optional> | application/octet-stream |