From f3062b74fe0d1bd0d64028a561e3cb3b7526331f Mon Sep 17 00:00:00 2001 From: Rishi Raj Jain Date: Thu, 28 Sep 2023 00:24:28 +0530 Subject: [PATCH] improve types --- packages/integrations/node/src/http-server.ts | 3 ++- packages/integrations/node/src/types.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/integrations/node/src/http-server.ts b/packages/integrations/node/src/http-server.ts index 8d01088cf..b1617244b 100644 --- a/packages/integrations/node/src/http-server.ts +++ b/packages/integrations/node/src/http-server.ts @@ -1,3 +1,4 @@ +import type { AstroUserConfig } from 'astro/config'; import https from 'https'; import fs from 'node:fs'; import http from 'node:http'; @@ -24,7 +25,7 @@ function parsePathname(pathname: string, host: string | undefined, port: number) export function createServer( { client, port, host, removeBase }: CreateServerOptions, handler: http.RequestListener, - trailingSlash: string + trailingSlash: AstroUserConfig['trailingSlash'] ) { const listener: http.RequestListener = (req, res) => { if (req.url) { diff --git a/packages/integrations/node/src/types.ts b/packages/integrations/node/src/types.ts index 4d22ea5b6..6d15dd4e9 100644 --- a/packages/integrations/node/src/types.ts +++ b/packages/integrations/node/src/types.ts @@ -1,3 +1,4 @@ +import type { AstroUserConfig } from 'astro/config'; import { IncomingMessage, ServerResponse } from 'node:http'; export interface UserOptions { @@ -15,7 +16,7 @@ export interface Options extends UserOptions { port: number; server: string; client: string; - trailingSlash: string; + trailingSlash: AstroUserConfig['trailingSlash']; } export type RequestHandlerParams = [