ParamName
Extract the Name
type variable from a Param
type.
This utility type may be useful for implementing custom parameters whose type
is in some way based on the type of another parameter. Currently, it's provided
mostly as a counterpart to ParamArg
, although unfortunately there are no
real-world examples of it in use at the time of writing.
import { Param, ParamName } from "@snout/router-path";
type ParamA = Param<"a">; // a parameter named "a"
type Name = ParamName<ParamA>; // the extracted Name type is "a"