Skip to content

Commit 110d716

Browse files
author
Rich Harris
committed
add resolvePath to types/index.d.ts
1 parent ab7078b commit 110d716

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

packages/kit/types/index.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,3 +1310,18 @@ export interface Snapshot<T = any> {
13101310
capture: () => T;
13111311
restore: (snapshot: T) => void;
13121312
}
1313+
1314+
/**
1315+
* Populate a route ID with params to resolve a pathname.
1316+
* @example
1317+
* ```js
1318+
* resolvePath(
1319+
* `/blog/[slug]/[...somethingElse]`,
1320+
* {
1321+
* slug: 'hello-world',
1322+
* somethingElse: 'something/else'
1323+
* }
1324+
* ); // `/blog/hello-world/something/else`
1325+
* ```
1326+
*/
1327+
export function resolvePath(id: string, params: Record<string, string | undefined>): string;

0 commit comments

Comments
 (0)