Options
All
  • Public
  • Public/Protected
  • All
Menu

A Blob encapsulates immutable, raw data that can be safely shared across multiple worker threads.

since

v15.7.0, v14.18.0

experimental

Hierarchy

  • Blob

Index

Constructors

  • Creates a new Blob object containing a concatenation of the given sources.

    {ArrayBuffer}, {TypedArray}, {DataView}, and {Buffer} sources are copied into the 'Blob' and can therefore be safely modified after the 'Blob' is created.

    String sources are also copied into the Blob.

    Parameters

    Returns Blob

Properties

size: number

The total size of the Blob in bytes.

since

v15.7.0, v14.18.0

type: string

The content-type of the Blob.

since

v15.7.0, v14.18.0

Methods

  • Returns a promise that fulfills with an ArrayBuffer containing a copy of the Blob data.

    since

    v15.7.0, v14.18.0

    Returns Promise<ArrayBuffer>

  • slice(start?: number, end?: number, type?: string): Blob
  • Creates and returns a new Blob containing a subset of this Blob objects data. The original Blob is not altered.

    since

    v15.7.0, v14.18.0

    Parameters

    • Optional start: number

      The starting index.

    • Optional end: number

      The ending index.

    • Optional type: string

      The content-type for the new Blob

    Returns Blob

  • stream(): unknown
  • Returns a new ReadableStream that allows the content of the Blob to be read.

    since

    v16.7.0

    Returns unknown

  • Returns a promise that fulfills with the contents of the Blob decoded as a UTF-8 string.

    since

    v15.7.0, v14.18.0

    Returns Promise<string>

Generated using TypeDoc