We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Right now the typing for URL pattern component result groups is basically just Record<string, string | undefined>.
Record<string, string | undefined>
However, take a look at this: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/7d182347b9be493cd37ad26a0b7a8285310cc914/types/express-serve-static-core/index.d.ts#L108
You can see it is able to infer the correct params based on a string.
For example:
const pathname = "/about/:name/:age?"; const props = async (groups: RouteParameters<typeof pathname>) => { return { name: groups.name }; };
It infers the types perfectly, and works with optional params, and infinite params:
(parameter) groups: { name: string; } & { age?: string | undefined; }
For now I have added this package to my project, but it would be nice if this lib implemented the same typing for groups.
groups
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Right now the typing for URL pattern component result groups is basically just
Record<string, string | undefined>
.However, take a look at this: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/7d182347b9be493cd37ad26a0b7a8285310cc914/types/express-serve-static-core/index.d.ts#L108
You can see it is able to infer the correct params based on a string.
For example:
It infers the types perfectly, and works with optional params, and infinite params:
For now I have added this package to my project, but it would be nice if this lib implemented the same typing for
groups
.The text was updated successfully, but these errors were encountered: