Skip to content

types

Terminal window
localive types [options]
OptionDefaultDescription
--locale-file <path>src/locales/*.jsonLocale JSON file(s)
--out <path>stdoutOutput file path

Generates a TypeScript declaration file with a union type of all translation keys:

// Auto-generated by @localive/cli
export type TranslationKey =
| 'app.title'
| 'app.subtitle'
| 'nav.home'
| 'nav.about'
| 'card.welcome'
| 'card.description'
| 'footer.rights';
Terminal window
# Output to stdout
localive types --locale-file src/locales/en.json
# Write to a .d.ts file
localive types --locale-file src/locales/en.json --out src/i18n.d.ts