Blob

interface

interface Blob

A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.

variable

var Blob: { … }

A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system.

Constructors

constructor

new Blob(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob

Properties

size

readonly size: number

type

readonly type: string

prototype

readonly prototype: Blob

Methods

arrayBuffer

arrayBuffer(): Promise<ArrayBuffer>

bytes

bytes(): Promise<Uint8Array<ArrayBuffer>>

slice

slice(start?: number, end?: number, contentType?: string): Blob

stream

stream(): ReadableStream<Uint8Array<ArrayBuffer>>

text

text(): Promise<string>

textStream

textStream(): ReadableStream<string>

Returns a ReadableStream<string> that streams the blob's data decoded as UTF-8 text.