Options
All
  • Public
  • Public/Protected
  • All
Menu

Used internally for creating and managing Blob URLs.

Hierarchy

  • BlobUrlManager

Implements

Index

Constructors

constructor

Methods

createUrl

  • createUrl(contentParts: (string | ArrayBuffer | ArrayBufferView)[], mediaType: string, forceDataUrl: boolean): IBlobUrlManagerResult
  • Converts the passed content to a Blob and creates an Object URL. If the runtime platform does not support blob URLs, a base64 URL will be returned.

    The life-time of the URL is connected to this instance. Free memory by either:

    • calling revokeUrl() to revoke a single blob url created with this instance.
    • calling revokeAllUrls() will revoke all blob URLs created with this instance.

    Parameters

    • contentParts: (string | ArrayBuffer | ArrayBufferView)[]

      The contentParts that should be wrapped in a Blob and served with an URL. If a string is passed, text content is assumed.

    • mediaType: string

      The media type the content should be served with.

    • forceDataUrl: boolean

      If set to true, always create a data URL, even if URL.createObjectURL() exists.

    Returns IBlobUrlManagerResult

createUrlForBlob

  • createUrlForBlob(blob: Blob): string
  • Creates an Object URL from the provided Blob.

    The life-time of the URL is connected to this instance. Free memory by either:

    • calling revokeUrl() to revoke a single blob URL created with this instance.
    • calling revokeAllUrls() will revoke all blob URLs created with this instance.

    Parameters

    • blob: Blob

    Returns string

revokeAllUrls

  • revokeAllUrls(): void

revokeUrl

  • revokeUrl(url: string): void
  • Revokes a blob URL previously created with this instance. If url is not a blob URL, or was created using another instance, nothing happens.

    Parameters

    • url: string

    Returns void

Generated using TypeDoc