Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Interface IBlobUrlManager

    Used internally for creating and managing Blob URLs.

    interface IBlobUrlManager {
        createUrl(
            contentParts: (string | ArrayBuffer | ArrayBufferView<ArrayBufferLike>)[],
            mediaType: string,
            forceDataUrl: boolean,
        ): IBlobUrlManagerResult;
        createUrlForBlob(blob: Blob): string;
        revokeAllUrls(): void;
        revokeUrl(url: string): void;
    }

    Implemented by

    Methods

    • 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<ArrayBufferLike>)[]

        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.

    • 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.

    • Revokes all blob URLs previously created with this instance.

      Returns 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