Skip to content

Commit 1aa784b

Browse files
committed
refactor: add TranslationsLike
1 parent 6800476 commit 1aa784b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/i18n/types.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1+
/* eslint-disable @typescript-eslint/no-empty-object-type */
12
/* eslint-disable @typescript-eslint/consistent-type-definitions */
23
/* eslint-disable @typescript-eslint/no-namespace */
34

45
import type { OmitIndexSignature, Primitive, Simplify } from 'type-fest';
56

67
import type libuiTranslations from './translations/libui.json';
78

9+
interface TranslationsLike {
10+
[key: string]: TranslationsLike | { [L in Language]?: string };
11+
}
12+
813
export declare namespace UserConfig {
914
interface LanguageOptions {
1015
[key: string]: boolean;
1116
}
12-
interface Translations {
13-
[key: string]:
14-
| Translations
15-
| {
16-
[L in Language]?: string;
17-
};
18-
}
17+
interface Translations extends TranslationsLike {}
1918
}
2019

2120
export type LanguageOptions = UserConfig.LanguageOptions & {

0 commit comments

Comments
 (0)