diff --git a/@types/index.d.ts b/@types/index.d.ts index 9854261f2..959d9b0a5 100644 --- a/@types/index.d.ts +++ b/@types/index.d.ts @@ -157,6 +157,7 @@ export class Response extends BodyMixin { clone(): Response; static error(): Response; + static redirect(url: string, status?: number): Response; } export class FetchError extends Error { diff --git a/@types/index.test-d.ts b/@types/index.test-d.ts index 4b280f1cd..4b24dcbb1 100644 --- a/@types/index.test-d.ts +++ b/@types/index.test-d.ts @@ -88,6 +88,9 @@ async function run() { new Map([['a', null], ['3', null]]).keys() ]); /* eslint-enable no-new */ + + expectType(Response.redirect('https://google.com')); + expectType(Response.redirect('https://google.com', 301)); } run().finally(() => {