UNPKG

tar

Version:
22 lines • 1.03 kB
import type { TarFS, TarFSSync } from './fs.js'; /** * The key of the method of a chunk source that skips input. A * `TarReader` calls it with the number of bytes of a body that are * after the chunks given so far, when no consumer reads that body. * If it returns true, the next chunk starts after those bytes. */ export declare const SKIP: unique symbol; /** A chunk source that can skip input. */ export type Skip = { [SKIP](n: number): boolean; }; /** * Read a file in chunks of `maxReadSize` bytes at most. The default, * and the value for 0, is 16 MiB. Each chunk is a new array. The * first chunk is small, and the chunks grow. A reader can skip a * large part of the file. */ export declare const readFile: (fs: TarFS, file: string, maxReadSize?: number) => AsyncGenerator<Uint8Array, void, void> & Skip; /** The sync form of `readFile`. */ export declare const readFileSync: (fs: TarFSSync, file: string, maxReadSize?: number) => Generator<Uint8Array, void, void> & Skip; //# sourceMappingURL=read-file.d.ts.map