Blob
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1023
The Blob interface represents a blob, which is a file-like object of immutable, raw data; they can be read as text or binary data, or converted into a ReadableStream so its methods can be used for processing the data.
Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Blob(
type?,options?):Blob
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1024
Parameters
Section titled “Parameters”(string | ArrayBuffer | Blob | ArrayBufferView<ArrayBufferLike>)[]
options?
Section titled “options?”Returns
Section titled “Returns”Blob
Properties
Section titled “Properties”
readonlysize:number
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1033
The size read-only property of the Blob interface returns the size of the Blob or File in bytes.
readonlytype:string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1039
The type read-only property of the Blob interface returns the MIME type of the file.
Methods
Section titled “Methods”arrayBuffer()
Section titled “arrayBuffer()”arrayBuffer():
Promise<ArrayBuffer>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1051
The arrayBuffer() method of the Blob interface returns a Promise that resolves with the contents of the blob as binary data contained in an ArrayBuffer.
Returns
Section titled “Returns”Promise<ArrayBuffer>
bytes()
Section titled “bytes()”bytes():
Promise<Uint8Array<ArrayBufferLike>>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1057
The bytes() method of the Blob interface returns a Promise that resolves with a Uint8Array containing the contents of the blob as an array of bytes.
Returns
Section titled “Returns”Promise<Uint8Array<ArrayBufferLike>>
slice()
Section titled “slice()”slice(
start?,end?,type?):Blob
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1045
The slice() method of the Blob interface creates and returns a new Blob object which contains data from a subset of the blob on which it’s called.
Parameters
Section titled “Parameters”start?
Section titled “start?”number
number
string
Returns
Section titled “Returns”Blob
stream()
Section titled “stream()”stream():
ReadableStream
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1069
The stream() method of the Blob interface returns a ReadableStream which upon reading returns the data contained within the Blob.
Returns
Section titled “Returns”text()
Section titled “text()”text():
Promise<string>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1063
The text() method of the string containing the contents of the blob, interpreted as UTF-8.
Returns
Section titled “Returns”Promise<string>