mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-28 17:56:37 +02:00
Simplify
This commit is contained in:
parent
00bf548b56
commit
e4cdb512fa
1 changed files with 1 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue