Type Generation
Auto-generated TypeScript definitions for type-safe translation keys with full IDE autocomplete.
How It Works
When you run i1n pull, the CLI generates an i1n.d.ts file containing TypeScript type definitions for all translation keys in your project.
This file maps every translation key to its dot-notation path, providing compile-time validation and full IDE autocomplete.
Benefits
Type-safe translation keys eliminate runtime errors caused by typos or missing keys. Your IDE shows all available keys as you type, with autocomplete suggestions.
Refactoring is safe: renaming a key in your source file is caught at compile time across your entire codebase.
Usage
The generated i1n.d.ts file is automatically included in your TypeScript compilation. Never modify this file directly — it is regenerated on every i1n pull.
Import the type-safe key constants from i1n.d.ts and use them with your translation function for guaranteed correctness.
export const common = {
greeting: "common.greeting",
errors: {
not_found: "common.errors.not_found"
}
} as const;