File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @sveltejs/kit ' : patch
3
+ ---
4
+
5
+ [ breaking] allow providing ` Params ` type argument for ` RequestHandler `
Original file line number Diff line number Diff line change @@ -340,10 +340,10 @@ export interface PrerenderErrorHandler {
340
340
} ) : void ;
341
341
}
342
342
343
- export interface RequestEvent {
343
+ export interface RequestEvent < Params = Record < string , string > > {
344
344
request : Request ;
345
345
url : URL ;
346
- params : Record < string , string > ;
346
+ params : Params ;
347
347
locals : App . Locals ;
348
348
platform : Readonly < App . Platform > ;
349
349
}
@@ -354,8 +354,8 @@ export interface RequestEvent {
354
354
* that method. Note that since 'delete' is a reserved word in
355
355
* JavaScript, delete handles are called 'del' instead.
356
356
*/
357
- export interface RequestHandler < Output extends Body = Body > {
358
- ( event : RequestEvent ) : MaybePromise <
357
+ export interface RequestHandler < Params = Record < string , string > , Output extends Body = Body > {
358
+ ( event : RequestEvent < Params > ) : MaybePromise <
359
359
Either < Output extends Response ? Response : EndpointOutput < Output > , Fallthrough >
360
360
> ;
361
361
}
You can’t perform that action at this time.
0 commit comments