Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

456 B
Raw Blame
type Sections = Readonly<Record<string, Readonly<Record<string, string>>>>;
type Keys<T> = T extends unknown ? keyof T : never;
type TranslationValue<T, K> = T extends unknown ? (K extends keyof T ? T[K] : never) : never;

export function mergeTranslations<const T extends Sections>(sections: T) {
  type Tables = T[keyof T];
  return Object.assign({}, ...Object.values(sections)) as {
    readonly [K in Keys<Tables>]: TranslationValue<Tables, K>;
  };
}