Skip to main content
Skip to main content

Blob

admin/discounts.internal.Blob

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

Since

v15.7.0, v14.18.0

Properties

sizenumberRequired
The total size of the Blob in bytes. #### Since v15.7.0, v14.18.0
typestringRequired
The content-type of the Blob. #### Since v15.7.0, v14.18.0

Methods

arrayBuffer

arrayBuffer(): Promise<ArrayBuffer>

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

Returns

Promise<ArrayBuffer>

PromisePromise<ArrayBuffer>Required

Since

v15.7.0, v14.18.0


slice

slice(start?, end?, type?): Blob

Creates and returns a new Blob containing a subset of this Blob objects data. The original Blob is not altered.

Parameters

startnumber
The starting index.
endnumber
The ending index.
typestring
The content-type for the new Blob

Returns

Blob

BlobBlobRequired

Since

v15.7.0, v14.18.0


stream

stream(): ReadableStream<any>

Returns a new ReadableStream that allows the content of the Blob to be read.

Returns

ReadableStream<any>

ReadableStreamReadableStream<any>Required

Since

v16.7.0


text

text(): Promise<string>

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

Returns

Promise<string>

PromisePromise<string>Required

Since

v15.7.0, v14.18.0

Was this section helpful?