-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
/
Copy pathglobal.d.ts
29 lines (26 loc) · 884 Bytes
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type baseMessages from '@node-core/website-i18n/locales/en.json';
import type { MessageKeys, NestedValueOf, NestedKeyOf } from 'next-intl';
declare global {
// Defines a type for all the IntlMessage shape (which is used internall by next-intl)
// @see https://next-intl.dev/docs/workflows/typescript
type IntlMessages = typeof baseMessages;
// Defines a generic type for all available i18n translation keys, by default not using any namespace
type IntlMessageKeys<
NestedKey extends NamespaceKeys<
IntlMessages,
NestedKeyOf<IntlMessages>
> = never,
> = MessageKeys<
NestedValueOf<
{ '!': IntlMessages },
[NestedKey] extends [never] ? '!' : `!.${NestedKey}`
>,
NestedKeyOf<
NestedValueOf<
{ '!': IntlMessages },
[NestedKey] extends [never] ? '!' : `!.${NestedKey}`
>
>
>;
}
export {};