import { JsonObject } from "type-fest"; //#region src/cli/shared/seed-chunker.d.ts /** * Seed data keyed by table name, with an array of records per table. */ export type SeedData = Record; /** * A single chunk of seed data with metadata for ordered execution. */ export type SeedChunk = { data: SeedData; order: string[]; index: number; total: number; }; /** * Options for chunking seed data. */ export type ChunkSeedDataOptions = { /** Seed data keyed by type name */ data: SeedData; /** Ordered list of type names (dependency order) */ order: string[]; /** Byte size of the bundled seed script code */ codeByteSize: number; /** Maximum gRPC message size in bytes (default: 3.5MB) */ maxMessageSize?: number; }; /** * Split seed data into chunks that fit within the gRPC message size limit. * * Algorithm: * 1. Calculate the available budget for the arg field (maxMessageSize - codeByteSize - overhead) * 2. If all data fits in one message, return a single chunk * 3. Otherwise, iterate through tables in dependency order: * - If a table fits in the current chunk, add it * - If adding a table would exceed the budget, finalize the current chunk and start a new one * - If a single table exceeds the budget, split its records across multiple chunks * - If a single record exceeds the budget, throw an error * @param options - Chunking options * @returns Array of seed chunks */ export declare function chunkSeedData(options: ChunkSeedDataOptions): SeedChunk[]; //#endregion