Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AssetManager

Hierarchy

  • AssetManager

Index

Constructors

Properties

_actor: ActorSubclass<default>
_limit: (<T>(fn: (() => Promise<T>)) => Promise<T>)

Type declaration

    • <T>(fn: (() => Promise<T>)): Promise<T>
    • Type Parameters

      • T

      Parameters

      • fn: (() => Promise<T>)
          • (): Promise<T>
          • Returns Promise<T>

      Returns Promise<T>

_maxChunkSize: number
_maxSingleFileSize: number

Methods

  • batch(): AssetManagerBatch
  • Create a batch assets operations instance, commit multiple operations in a single request

    Returns AssetManagerBatch

  • clear(): Promise<void>
  • delete(key: string): Promise<void>
  • Delete file from assets canister

    Parameters

    • key: string

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

    Returns Promise<void>

  • Get asset instance from assets canister

    Parameters

    • key: string

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

    • Optional acceptEncodings: ContentEncoding[]

      The accepted content encodings, defaults to ['identity']

    Returns Promise<Asset>

  • list(): Promise<{ content_type: string; encodings: { content_encoding: string; length: bigint; modified: bigint; sha256: [] | [Uint8Array] }[]; key: string }[]>
  • Get list of all files in assets canister

    Returns Promise<{ content_type: string; encodings: { content_encoding: string; length: bigint; modified: bigint; sha256: [] | [Uint8Array] }[]; key: string }[]>

    All files in asset canister

  • Store data on assets canister

    Parameters

    • Rest ...args: StoreArgs

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

    Returns Promise<string>

  • toReadable(...args: StoreArgs): Promise<Readable>
  • Create readable from store arguments

    Parameters

    • Rest ...args: StoreArgs

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

    Returns Promise<Readable>

Generated using TypeDoc