Skip to content

AssetManager

Defined in: assets/src/index.ts:135

new AssetManager(config): AssetManager

Defined in: assets/src/index.ts:145

Create assets canister manager instance

AssetManagerConfig

Additional configuration options, canister id is required

AssetManager

batch(): AssetManagerBatch

Defined in: assets/src/index.ts:267

Create a batch assets operations instance, commit multiple operations in a single request

AssetManagerBatch


clear(): Promise<void>

Defined in: assets/src/index.ts:235

Delete all files from assets canister

Promise<void>


delete(key): Promise<void>

Defined in: assets/src/index.ts:228

Delete file from assets canister

string

The path to the file on the assets canister e.g. /folder/to/my_file.txt

Promise<void>


get(key, acceptEncodings?): Promise<Asset>

Defined in: assets/src/index.ts:244

Get asset instance from assets canister

string

The path to the file on the assets canister e.g. /folder/to/my_file.txt

ContentEncoding[]

The accepted content encodings, defaults to [‘identity’]

Promise<Asset>


list(): Promise<object[]>

Defined in: assets/src/index.ts:184

Get list of all files in assets canister

Promise<object[]>

All files in asset canister


store(…args): Promise<string>

Defined in: assets/src/index.ts:192

Store data on assets canister

StoreArgs

Arguments with either a file, blob, path, bytes or custom Readable implementation

Promise<string>


static toReadable(…args): Promise<Readable>

Defined in: assets/src/index.ts:157

Create readable from store arguments

StoreArgs

Arguments with either a file, blob, path, bytes or custom Readable implementation

Promise<Readable>