INNER CODE UNIT · TypeScript
createBlobTempStream
gildas-lormeau/zip.js · index.d.ts:801
export function createBlobTempStream(options?: BlobTempStreamOptions): () => TempStream;
/**
* Builds a {@link ZipWriterConstructorOptions.createTempStream} factory that spills the data of buffered entries to the Origin Private File System (OPFS) via `FileSystemSyncAccessHandle` instead of keeping it in memory.
*
* This is the fastest disk-backed temporary storage on the web platform: it behaves like {@link createOPFSTempStream} (same options, same bounded-memory profile) but writes roughly 2.5 times faster in Chromium and Firefox and reads back several times faster in Firefox and Safari, making disk-backed staging nearly as fast as the in-memory default.
*
* `FileSystemSyncAccessHandle` is only exposed in dedicated workers, so this helper requires running the {@link ZipWriter} inside a worker; it throws when created in an unsupported context unless `getDirectory` is provided.
*
* @param options The options.
* @returns A factory suitable for {@link ZipWriterConstructorOptions.createTempStream}.
*/
export function createSyncAccessHandleTempStream(options?: OPFSTempStreamOptions): () => TempStream;
/**
* Represents an instance used to read or write unknown type of data.
*
* zip.js can handle multiple types of data thanks to a generic API. This feature is based on 2 abstract constructors: {@link Reader} and {@link Writer}.