🚀 Feature Proposal
With the latest advancements in TypeScript, it's now possible to infer the correct paths from an object type. TypeScript 4.1 introduces recursive conditional types, and there is a PR open that will enable string type concatenation on the type level.
Motivation
18next.t accepts arbitrary strings. This allows silly human errors, since it's easy to make a typo.
Example
I put together a TypeScript Playground illustrating the improved definition.
Once microsoft/TypeScript#40336 is merged and released, the improved definition can be put in a separate file loaded only for the ones using the minimum required TypeScript version. In package.json, it should say:
{
"typesVersions": {
">=4.1.0-0": {
"*": [
/* Path to the new definition */
]
}
}
}
🚀 Feature Proposal
With the latest advancements in TypeScript, it's now possible to infer the correct paths from an object type. TypeScript 4.1 introduces recursive conditional types, and there is a PR open that will enable string type concatenation on the type level.
Motivation
18next.taccepts arbitrary strings. This allows silly human errors, since it's easy to make a typo.Example
I put together a TypeScript Playground illustrating the improved definition.
Once microsoft/TypeScript#40336 is merged and released, the improved definition can be put in a separate file loaded only for the ones using the minimum required TypeScript version. In
package.json, it should say:{ "typesVersions": { ">=4.1.0-0": { "*": [ /* Path to the new definition */ ] } } }