i18n-ai-translate
Version:
AI-powered localization CLI, Node library, and GitHub Action. Translate i18next JSON, Gettext PO, Java .properties, and iOS .strings with ChatGPT, Claude, Gemini, or local Ollama models.
20 lines (19 loc) • 689 B
TypeScript
import type ChatPool from "./chat_pool";
import type Chats from "./interfaces/chats";
type ShardWorker<T> = (shard: {
[key: string]: string;
}, chats: Chats) => Promise<T>;
/**
* Share the "build shards, assign a pool triple, run in parallel"
* scaffold that both pipelines need. The pipeline supplies only the
* per-shard body via `work`.
*
* Groups stay whole within a shard so each worker's chat history
* accumulates related items. `concurrency` is implicit in `pool.size`.
*/
export declare function runAcrossShards<T>(flatInput: {
[key: string]: string;
}, groups: Array<{
[key: string]: string;
}>, pool: ChatPool, work: ShardWorker<T>): Promise<T[]>;
export {};