AssetManager
Defined in: assets/src/index.ts:135
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new AssetManager(
config
):AssetManager
Defined in: assets/src/index.ts:145
Create assets canister manager instance
Parameters
Section titled “Parameters”config
Section titled “config”Additional configuration options, canister id is required
Returns
Section titled “Returns”AssetManager
Methods
Section titled “Methods”batch()
Section titled “batch()”batch():
AssetManagerBatch
Defined in: assets/src/index.ts:267
Create a batch assets operations instance, commit multiple operations in a single request
Returns
Section titled “Returns”AssetManagerBatch
clear()
Section titled “clear()”clear():
Promise
<void
>
Defined in: assets/src/index.ts:235
Delete all files from assets canister
Returns
Section titled “Returns”Promise
<void
>
delete()
Section titled “delete()”delete(
key
):Promise
<void
>
Defined in: assets/src/index.ts:228
Delete file from assets canister
Parameters
Section titled “Parameters”string
The path to the file on the assets canister e.g. /folder/to/my_file.txt
Returns
Section titled “Returns”Promise
<void
>
get(
key
,acceptEncodings?
):Promise
<Asset
>
Defined in: assets/src/index.ts:244
Get asset instance from assets canister
Parameters
Section titled “Parameters”string
The path to the file on the assets canister e.g. /folder/to/my_file.txt
acceptEncodings?
Section titled “acceptEncodings?”The accepted content encodings, defaults to [‘identity’]
Returns
Section titled “Returns”Promise
<Asset
>
list()
Section titled “list()”list():
Promise
<object
[]>
Defined in: assets/src/index.ts:184
Get list of all files in assets canister
Returns
Section titled “Returns”Promise
<object
[]>
All files in asset canister
store()
Section titled “store()”store(…
args
):Promise
<string
>
Defined in: assets/src/index.ts:192
Store data on assets canister
Parameters
Section titled “Parameters”Arguments with either a file, blob, path, bytes or custom Readable implementation
Returns
Section titled “Returns”Promise
<string
>
toReadable()
Section titled “toReadable()”
static
toReadable(…args
):Promise
<Readable
>
Defined in: assets/src/index.ts:157
Create readable from store arguments
Parameters
Section titled “Parameters”Arguments with either a file, blob, path, bytes or custom Readable implementation
Returns
Section titled “Returns”Promise
<Readable
>