Closed chertik77 closed 4 hours ago
Yes, I would like to have typed hooks or functions through declarations or out of the box.
const locale = useLocale() as Locale
const locale = (await getLocale()) as Locale
I have predefined type for my locales and I dont want to type this hook and function again and again.
export const routing = defineRouting({ locales: ['uk', 'en'], defaultLocale: 'uk' }) export type Locale = (typeof routing.locales)[number]
Be able to add declaration, like for messages. Or infer types from routing.locales and type them inside of the library.
routing.locales
-
Sorry, I didn't see your pr about strict types
Is your feature request related to a problem? Please describe.
Yes, I would like to have typed hooks or functions through declarations or out of the box.
I have predefined type for my locales and I dont want to type this hook and function again and again.
Describe the solution you'd like
Be able to add declaration, like for messages. Or infer types from
routing.locales
and type them inside of the library.Describe alternatives you've considered
-