Skip to content

Commit

Permalink
fix: use more accurate return type for app router patchers
Browse files Browse the repository at this point in the history
  • Loading branch information
Xunnamius committed Jan 9, 2024
1 parent fdfec8c commit 62f1d0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,16 @@ export interface NtarhInitAppRouter<NextResponseJsonType = unknown>
* `NextRequest`, it will be wrapped with `NextRequest`, e.g. `new
* NextRequest(returnedRequest, { ... })`.
*/
requestPatcher?: (request: import('next/server').NextRequest) => Promisable<Request>;
requestPatcher?: (
request: import('next/server').NextRequest
) => Promisable<void | Request>;
/**
* A function that receives the `Response` object returned from
* `appHandler` and returns a `Response` instance. Use this function to
* edit the response _after_ your handler runs but _before_ it's processed
* by the server.
*/
responsePatcher?: (res: Response) => Promisable<Response>;
responsePatcher?: (res: Response) => Promisable<void | Response>;
/**
* `url: 'your-url'` is shorthand for `requestPatcher: (req) => new
* NextRequest('your-url', req)`
Expand Down

0 comments on commit 62f1d0b

Please sign in to comment.