Bitbybit Docs
    Preparing search index...

    Class Asset

    Index

    Constructors

    Properties

    assetManager: AssetManager

    convert

    • Converts a File or Blob to an ArrayBuffer.

      Parameters

      • inputs: FileDto

        file or blob to convert

      Returns Promise<ArrayBuffer>

      ArrayBuffer

      to array buffer

    • Converts a File or Blob to a Uint8Array.

      Parameters

      • inputs: FileDto

        file or blob to convert

      Returns Promise<Uint8Array>

      Uint8Array

      to uint8 array

    • Converts a Blob to a File.

      Parameters

      Returns File

      File

      blob to file

    • Converts a File to a Blob.

      Parameters

      Returns Blob

      Blob

      file to blob

    • Converts an ArrayBuffer to a Uint8Array.

      Parameters

      Returns Uint8Array

      Uint8Array

      array buffer to uint8 array

    • Converts a Uint8Array to an ArrayBuffer.

      Parameters

      Returns ArrayBuffer

      ArrayBuffer

      uint8 array to array buffer

    create

    • Gets and creates the url string path to your file stored in your memory.

      Parameters

      Returns string

      URL string of a file

      object url

    • Gets and creates the url string paths to your files stored in your memory.

      Parameters

      Returns string[]

      URL strings for given files

      object urls

    download

    • Downloads a file with the given content, extension, and content type.

      Parameters

      • inputs: DownloadDto

        file name, content, extension, and content type

      Returns void

      download file

    fetch

    • Fetches the blob from the given url, must be CORS enabled accessible endpoint

      Parameters

      Returns Promise<Blob>

      Blob

      fetch blob

    • Fetches the file from the given url, must be CORS enabled accessible endpoint

      Parameters

      Returns Promise<File>

      File

      fetch file

    • Fetches the json from the given url, must be CORS enabled accessible endpoint

      Parameters

      Returns Promise<any>

      JSON

      fetch json

    • Fetches the json from the given url, must be CORS enabled accessible endpoint

      Parameters

      Returns Promise<string>

      Text

      fetch text

    get

    • Gets the asset file

      Parameters

      • inputs: GetAssetDto

        file name to get from project assets

      Returns Promise<File>

      Blob of asset

      cloud file

    • Gets the text from asset file stored in your cloud account.

      Parameters

      • inputs: GetAssetDto

        asset name to get from project assets

      Returns Promise<string>

      Text of asset

      text file

    • Gets the local asset file stored in your browser.

      Parameters

      • inputs: GetAssetDto

        asset name to get from local assets

      Returns Promise<File | File[]>

      Blob of asset

      local file

    • Gets the text from asset file stored in your browser.

      Parameters

      • inputs: GetAssetDto

        asset name to get from local assets

      Returns Promise<string | string[]>

      Text of asset or array of texts

      local text file