File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -47,12 +47,12 @@ declare namespace pathToRegexp {
47
47
/**
48
48
* Transforming an Express-style path into a valid path.
49
49
*/
50
- export function compile ( path : string , options ?: ParseOptions ) : PathFunction ;
50
+ export function compile < P extends object = object > ( path : string , options ?: ParseOptions ) : PathFunction < P > ;
51
51
52
52
/**
53
53
* Transform an array of tokens into a path generator function.
54
54
*/
55
- export function tokensToFunction ( tokens : Token [ ] ) : PathFunction ;
55
+ export function tokensToFunction < P extends object = object > ( tokens : Token [ ] ) : PathFunction < P > ;
56
56
57
57
/**
58
58
* Transform an array of tokens into a matching regular expression.
@@ -78,7 +78,7 @@ declare namespace pathToRegexp {
78
78
79
79
export type Token = string | Key ;
80
80
export type Path = string | RegExp | Array < string | RegExp > ;
81
- export type PathFunction = ( data ?: Object , options ?: PathFunctionOptions ) => string ;
81
+ export type PathFunction < P extends object = object > = ( data ?: P , options ?: PathFunctionOptions ) => string ;
82
82
}
83
83
84
84
export = pathToRegexp ;
You can’t perform that action at this time.
0 commit comments