Open History to see the last commit
1import { ARCHIVE_MAX_BYTES } from "@t3tools/client-runtime/zip/bounded-zip";
2
3export {
4 ARCHIVE_ENTRY_MAX_BYTES,
5 ARCHIVE_MAX_ENTRIES,
6 ARCHIVE_MAX_RATIO,
7} from "@t3tools/client-runtime/zip/bounded-zip";
8export const BINARY_PREVIEW_MAX_BYTES = ARCHIVE_MAX_BYTES;
9export const SQLITE_PAGE_SIZE = 50;
10
11export interface ArchiveEntry {
12 path: string;
13 size: number;
14 modified: string | null;
15 directory: boolean;
16}
17
18export type BinaryWorkerRequest =
19 | { type: "open"; kind: "archive" | "sqlite"; name: string; bytes: ArrayBuffer }
20 | { type: "entry"; path: string }
21 | { type: "rows"; table: string; page: number };
22
23export type BinaryWorkerResult =
24 | { type: "error"; message: string }
25 | { type: "archive"; entries: ArchiveEntry[] }
26 | { type: "entry"; path: string; bytes: Uint8Array<ArrayBuffer> }
27 | { type: "sqlite"; tables: { name: string; count: number }[] }
28 | { type: "rows"; table: string; page: number; columns: string[]; rows: string[][] };