One provides full TypeScript support for route parameters and loader props, automatically generating types from your file system routes.
Overview
When you create route files with dynamic segments like [slug] or [...rest], One automatically generates TypeScript types that make your route parameters fully type-safe.
false (default): No auto-generation, manually add types yourself
'type': Auto-inserts type-only helpers:
importtype{ RouteType }from'one'
typeRoute= RouteType<'/your/[route]'>
'runtime': Auto-inserts runtime helpers:
import{ createRoute }from'one'
const route =createRoute<'/your/[route]'>()
The insertion happens automatically when route files are created or modified, with proper spacing and without modifying your existing loader code.
CLI Command
Generate route types manually using the One CLI:
yarn
npm
bun
pnpm
npx one generate-routes # Generate types only
npx one generate-routes --typed=runtime # Generate + inject runtime helpers
npx one generate-routes --typed=type # Generate + inject type helpers
Note: The CLI command requires --typed to inject helpers. The typedRoutesGeneration config option works automatically during development (watches files and injects on changes), while the CLI flag gives you manual control when needed.