diff --git a/.changeset/olive-moles-tan.md b/.changeset/olive-moles-tan.md new file mode 100644 index 000000000..9840fd4e3 --- /dev/null +++ b/.changeset/olive-moles-tan.md @@ -0,0 +1,5 @@ +--- +'@astrojs/deno': patch +--- + +TypeScript users now get better suggestions when configuring the Deno adapter. diff --git a/packages/integrations/deno/src/index.ts b/packages/integrations/deno/src/index.ts index 3b011c830..d1dd6103d 100644 --- a/packages/integrations/deno/src/index.ts +++ b/packages/integrations/deno/src/index.ts @@ -3,17 +3,7 @@ import esbuild from 'esbuild'; import * as fs from 'node:fs'; import * as npath from 'node:path'; import { fileURLToPath } from 'node:url'; - -interface BuildConfig { - server: URL; - serverEntry: string; - assets: string; -} - -interface Options { - port?: number; - hostname?: string; -} +import type { BuildConfig, Options } from './types'; const SHIM = `globalThis.process = { argv: [], diff --git a/packages/integrations/deno/src/server.ts b/packages/integrations/deno/src/server.ts index 90a4a1237..95c638b65 100644 --- a/packages/integrations/deno/src/server.ts +++ b/packages/integrations/deno/src/server.ts @@ -1,16 +1,11 @@ // Normal Imports import type { SSRManifest } from 'astro'; import { App } from 'astro/app'; +import type { Options } from './types'; // @ts-expect-error import { fromFileUrl, serveFile, Server } from '@astrojs/deno/__deno_imports.js'; -interface Options { - port?: number; - hostname?: string; - start?: boolean; -} - let _server: Server | undefined = undefined; let _startPromise: Promise | undefined = undefined; diff --git a/packages/integrations/deno/src/types.ts b/packages/integrations/deno/src/types.ts new file mode 100644 index 000000000..c44d0a842 --- /dev/null +++ b/packages/integrations/deno/src/types.ts @@ -0,0 +1,11 @@ +export interface Options { + port?: number; + hostname?: string; + start?: boolean; +} + +export interface BuildConfig { + server: URL; + serverEntry: string; + assets: string; +}