Documentation / @zerotal/client / index / PathParams
Type Alias: PathParams<Path>
PathParams<
Path> =Pathextends`${string}{${infer Param}}${infer Tail}`?Param|PathParams<Tail> :never
Defined in: client/src/types.ts:10
Extract the names of all {param} placeholders from a URL path string.
Type Parameters
Path
Path extends string
Example
PathParams<'/api/users/{id}/posts/{postId}'>
// → 'id' | 'postId'