Skip to content

Commit

Permalink
docs: add missing type to type-safe translations example
Browse files Browse the repository at this point in the history
  • Loading branch information
Curetix authored Aug 2, 2023
1 parent f639d9f commit 4f9cd03
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/type-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ To enable type safety consuming translations, you have to add this to the `next-
```ts
import type { Paths, I18n, Translate } from 'next-translate'

type Tail<T> = T extends [unknown, ...infer Rest] ? Rest : never;

export interface TranslationsKeys {
// Example with "common" and "home" namespaces in "en" (the default language):
common: Paths<typeof import('./locales/en/common.json')>
Expand Down

0 comments on commit 4f9cd03

Please sign in to comment.