Sha256: 24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b

Contents?: true

Size: 1.56 KB

Versions: 29

Compression:

Stored size: 1.56 KB

Contents

import { Readable } from "stream";
import { Blob } from 'buffer'

export default BodyReadable

declare class BodyReadable extends Readable {
  constructor(
    resume?: (this: Readable, size: number) => void | null,
    abort?: () => void | null,
    contentType?: string
  )

  /** Consumes and returns the body as a string
   *  https://fetch.spec.whatwg.org/#dom-body-text
   */
  text(): Promise<string>

  /** Consumes and returns the body as a JavaScript Object
   *  https://fetch.spec.whatwg.org/#dom-body-json
   */
  json(): Promise<unknown>

  /** Consumes and returns the body as a Blob
   *  https://fetch.spec.whatwg.org/#dom-body-blob
   */
  blob(): Promise<Blob>

  /** Consumes and returns the body as an ArrayBuffer
   *  https://fetch.spec.whatwg.org/#dom-body-arraybuffer
   */
  arrayBuffer(): Promise<ArrayBuffer>

  /** Not implemented
   *
   *  https://fetch.spec.whatwg.org/#dom-body-formdata
   */
  formData(): Promise<never>

  /** Returns true if the body is not null and the body has been consumed
   *
   *  Otherwise, returns false
   *
   * https://fetch.spec.whatwg.org/#dom-body-bodyused
   */
  readonly bodyUsed: boolean

  /** 
   * If body is null, it should return null as the body
   *
   *  If body is not null, should return the body as a ReadableStream
   *
   *  https://fetch.spec.whatwg.org/#dom-body-body
   */
  readonly body: never | undefined

  /** Dumps the response body by reading `limit` number of bytes.
   * @param opts.limit Number of bytes to read (optional) - Default: 262144
   */
  dump(opts?: { limit: number }): Promise<void>
}

Version data entries

29 entries across 29 versions & 3 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/undici-types/readable.d.ts