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

    Interface IResourceResponse

    Represents a response from a IResourceProvider.fetch() operation.

    interface IResourceResponse {
        abort(): void;
        asText(): Promise<string>;
        asUint8Array(): Promise<Uint8Array<ArrayBufferLike>>;
        getMetadata(): IResourceMetadata;
        getReadableStream(): ReadableStream<Uint8Array<ArrayBufferLike>>;
    }

    Implemented by

    Methods

    • Abort any ongoing read operation with a ColibrioError with errorType set to ColibrioErrorType.ABORTED.

      Returns void

    • Fetch the response body as text.

      The supported text encodings are:

      • UTF-8
      • UTF-16LE
      • UTF-16BE

      Returns Promise<string>

    • Fetch the response body as an Uint8Array. Note that the underlying ArrayBuffer may contain more data than just the body.

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Get the body as a ReadableStream.

      Returns ReadableStream<Uint8Array<ArrayBufferLike>>