Options
All
  • Public
  • Public/Protected
  • All
Menu

Used internally for creating and managing Blob URLs.

Hierarchy

  • IBlobUrlManager

Implemented by

Index

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 contents 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

    The URL to the contents.

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

      The Blob to create an URL for.

    Returns string

    The URL to the Blob.

revokeAllUrls

  • revokeAllUrls(): void
  • Revokes all blob URLs previously created with this instance.

    Returns 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