Skip to content
1 min read · 160 words

Interface: OpfsBlob

Defined in: src/batteries/storage/opfs/index.ts:119

Minimal subset of the DOM Blob interface used by OpfsSpoolReader streaming-mode random-access reads. Real OPFS handles return a File here; we narrow to the methods we actually call.

Extended by

Properties

PropertyModifierTypeDescriptionDefined in
sizereadonlynumberByte length of the blob.src/batteries/storage/opfs/index.ts:121

Methods

slice()

ts
slice(
   start?: number,
   end?: number,
   contentType?: string): OpfsBlob;

Defined in: src/batteries/storage/opfs/index.ts:123

Return a sub-range of the blob as a new blob.

Parameters

ParameterType
start?number
end?number
contentType?string

Returns

OpfsBlob


stream()

ts
stream(): OpfsReadableStream;

Defined in: src/batteries/storage/opfs/index.ts:127

Open a readable byte stream over the blob.

Returns

OpfsReadableStream


text()

ts
text(): Promise<string>;

Defined in: src/batteries/storage/opfs/index.ts:125

Read the blob's contents as text.

Returns

Promise<string>