This commit is contained in:
Luke Vella 2024-12-01 23:16:39 +00:00
parent 00bf548b56
commit e4cdb512fa
No known key found for this signature in database
GPG key ID: 469CAD687F0D784C

View file

@ -1,11 +1,3 @@
import type app from "../../public/locales/en/app.json";
// Use the actual translation type from the JSON file
export type TxKeyPath = RecursiveKeyOf<typeof app>;
// Helper type to get all possible paths in dot notation
type RecursiveKeyOf<TObj extends Record<string, unknown>> = {
[TKey in keyof TObj & string]: TObj[TKey] extends Record<string, unknown>
? `${TKey}.${RecursiveKeyOf<TObj[TKey]>}`
: TKey;
}[keyof TObj & string];
export type TxKeyPath = keyof typeof app;