/** * Synchronously reads up to `maxBytes` from the start of `filePath` and returns `op(header)`. * If the file is shorter, `header` is only the bytes actually read. */ export declare function peekFileSync(filePath: string, maxBytes: number, op: (header: Uint8Array) => T): T; /** * Like {@link peekFileSync} but uses async I/O. */ export declare function peekFile(filePath: string, maxBytes: number, op: (header: Uint8Array) => T): Promise; /** * Read up to the last `maxBytes` of `filePath` and pass that slice to `op`. * * The tail mirror of {@link peekFile}: same pooled-buffer strategy (no per-call * allocation for small reads), but the read is positioned at `size - len` so the * window ends at EOF. When the file is shorter than `maxBytes`, the whole file is * returned. A multi-byte codepoint straddling the leading cut decodes to a * replacement char — callers that parse line-oriented tails drop the partial * leading line anyway. */ export declare function peekFileTail(filePath: string, maxBytes: number, op: (tail: Uint8Array) => T): Promise; /** * Read up to the first `prefixBytes` and last `suffixBytes` of `filePath`, then * pass both slices to `op`. * * Uses a single open/stat sequence. When the whole file fits in the head window, * the tail is sliced from the already-read head bytes instead of issuing a * second read. */ export declare function peekFileEnds(filePath: string, prefixBytes: number, suffixBytes: number, op: (head: Uint8Array, tail: Uint8Array) => T): Promise;