From f2a5e3ddb75e8830fded04b23c2a8d2671b3af2f Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Thu, 29 Aug 2024 15:44:36 +0100 Subject: [PATCH] change type of `redirectRoute` --- packages/astro/src/integrations/hooks.ts | 2 +- packages/astro/src/types/public/integrations.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/integrations/hooks.ts b/packages/astro/src/integrations/hooks.ts index d9b2473757962..2a1bedfb0ad7e 100644 --- a/packages/astro/src/integrations/hooks.ts +++ b/packages/astro/src/integrations/hooks.ts @@ -636,7 +636,7 @@ function toIntegrationRouteData(route: RouteData): IntegrationRouteData { segments: route.segments, prerender: route.prerender, redirect: route.redirect, - redirectRoute: route.redirectRoute, + redirectRoute: route.redirectRoute ? toIntegrationRouteData(route.redirectRoute) : undefined, type: route.type, pattern: route.pattern, distURL: route.distURL, diff --git a/packages/astro/src/types/public/integrations.ts b/packages/astro/src/types/public/integrations.ts index abfaea7e3e0b6..559ee38aa3251 100644 --- a/packages/astro/src/types/public/integrations.ts +++ b/packages/astro/src/types/public/integrations.ts @@ -243,4 +243,9 @@ export interface AstroIntegration { /** * A smaller version of the {@link RouteData} that is used in the integrations. */ -export type IntegrationRouteData = Omit; +export type IntegrationRouteData = Omit & { + /** + * {@link RouteData.redirectRoute} + */ + redirectRoute?: IntegrationRouteData +};