/** Read a Response body but stop once it passes `maxBytes` (returning `tooLarge`), so an object whose listed size is missing or under-reported can't be pulled fully into the tab. */ export declare function readCappedBytes(response: Response, maxBytes: number): Promise<{ bytes: Uint8Array; tooLarge: boolean; }>; /** Lines a preview will render; a trailing newline doesn't open another line. */ export declare function countLines(text: string): number; interface CappedText { text: string; tooLarge: boolean; truncated: boolean; } /** Read a Response as text capped at `maxBytes`; when `maxLines` is given, cancel the stream * once that many `\n` arrive. Cutting on `\n` keeps the returned prefix on a clean UTF-8 boundary. */ export declare function readCappedText(response: Response, maxBytes: number, maxLines?: number): Promise; /** Keep the last `maxLines` lines, ignoring a single trailing newline so a file * ending in one doesn't spend a line on the empty remainder. */ export declare function lastLines(text: string, maxLines: number): { text: string; truncated: boolean; }; /** Range header for reading the start of an object that is larger than `maxBytes`, * one byte past the cap so the read still sees the overflow and cuts on a line, as it * does for an unranged body. The bytes past it never leave the server. */ export declare function headRangeFor(knownSize: number | undefined, maxBytes: number): string | null; /** Range header for reading the last `maxBytes` of an object. A closed range is a * CORS-safelisted header value, so it travels without a preflight that a bucket's * CORS rules may not answer; the suffix form is not safelisted, and is only reached * for workspace files, which are same-origin and list no size. Closing the range at * the listed size also bounds the window: left open, an object that grew since the * listing would serve more than `maxBytes` and the read would refuse it. */ export declare function tailRangeFor(knownSize: number | undefined, maxBytes: number): string | null; /** What a ranged response actually delivered: whether its first line arrives cut in * half, or `null` when the body can't be the object's end at all. */ export declare function tailWindow(response: Response, maxBytes: number): { startsMidObject: boolean; } | null; /** Read a range covering the end of an object as text. `startsMidObject` says the * range began at an arbitrary byte, so the first line arrives cut in half. */ export declare function readTailText(response: Response, maxBytes: number, maxLines: number | undefined, startsMidObject: boolean): Promise; export {};