//#region src/commands/admin/chunk-csv/worker.d.ts /** * A unit of work: instructs a worker to chunk a single CSV file. */ type ChunkTask = { /** Absolute path of the CSV file to chunk. */filePath: string; /** Options controlling output and chunk size. */ options: { /** Optional directory where chunked output files should be written. */outputDir?: string; /** Whether to clear any pre-existing output chunks before writing new ones. */ clearOutputDir: boolean; /** Approximate target chunk size in MB (well under Node’s string size limits). */ chunkSizeMB: number; }; }; /** * Per-worker progress snapshot for the chunk-csv command. */ type ChunkProgress = { /** File being processed by the worker. */filePath: string; /** Number of rows processed so far. */ processed: number; /** Optional total rows in the file (not always known). */ total?: number; }; /** * Worker result message once a file has finished processing. */ type ChunkResult = { /** Whether the file completed successfully. */ok: boolean; /** File path for which this result applies. */ filePath: string; /** Optional error message if the file failed to chunk. */ error?: string; }; /** * Worker entrypoint. * * Lifecycle: * 1) Announce readiness to the parent via `{ type: 'ready' }`. * 2) Wait for `{ type: 'task' }` messages; for each, call `chunkOneCsvFile(...)`. * - While chunking, forward progress to the parent via `{ type: 'progress' }`. * - On completion, send `{ type: 'result', ok: true }`. * - On error, send `{ type: 'result', ok: false, error }` and exit(1). * 3) On `{ type: 'shutdown' }`, exit(0) gracefully. * * Notes: * - This process is typically spawned by a pool manager that assigns file paths to workers. * - The long-lived promise at the end keeps the worker alive between tasks until the parent * sends an explicit shutdown. */ declare function runChild(): Promise; //#endregion export { ChunkProgress, ChunkResult, ChunkTask, runChild }; //# sourceMappingURL=worker.d.mts.map