feat: plan index;flat i18n and add variable value type (#2762)

* feat: plan index

* flat i18n and add variable value type

* fix: ts

* perf: free plan tip
This commit is contained in:
Archer
2024-09-20 17:36:33 +08:00
committed by GitHub
parent 75af549c7f
commit 9eb02b7e38
25 changed files with 2830 additions and 3545 deletions

View File

@@ -23,14 +23,8 @@ export interface I18nNamespaces {
export type I18nNsType = (keyof I18nNamespaces)[];
export type NestedKeyOf<ObjectType extends object> = {
[Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object
? `${Key}` | `${Key}.${NestedKeyOf<ObjectType[Key]>}`
: `${Key}`;
}[keyof ObjectType & (string | number)];
export type ParseKeys<Ns extends keyof I18nNamespaces = keyof I18nNamespaces> = {
[K in Ns]: `${K}:${NestedKeyOf<I18nNamespaces[K]>}`;
[K in Ns]: `${K}:${keyof I18nNamespaces[K] & string}`;
}[Ns];
export type I18nKeyFunction = {