import type { Server } from 'node:http'; import type { AstroTimer } from '../core/config/timer.js'; import type { TSConfig } from '../core/config/tsconfig.js'; import type { AstroLogger, AstroLoggerLevel } from '../core/logger/core.js'; import type { AstroPreferences } from '../preferences/index.js'; import type { AstroComponentFactory } from '../runtime/server/index.js'; import type { GetStaticPaths } from './public/common.js'; import type { AstroConfig } from './public/config.js'; import type { ContentEntryType, DataEntryType } from './public/content.js'; import type { AstroAdapter, AstroPrerenderer, AstroRenderer, InjectedScriptStage, InjectedType } from './public/integrations.js'; import type { InternalInjectedRoute, ResolvedInjectedRoute, RouteData } from './public/internal.js'; import type { DevToolbarAppEntry } from './public/toolbar.js'; export type SerializedRouteData = Omit & { pattern: string; redirectRoute: SerializedRouteData | undefined; fallbackRoutes: SerializedRouteData[]; _meta: { trailingSlash: AstroConfig['trailingSlash']; }; }; type CspObject = Required>; export interface AstroSettings { config: AstroConfig; adapter: AstroAdapter | undefined; prerenderer: AstroPrerenderer | ((defaultPrerenderer: AstroPrerenderer) => AstroPrerenderer) | undefined; preferences: AstroPreferences; injectedRoutes: InternalInjectedRoute[]; resolvedInjectedRoutes: ResolvedInjectedRoute[]; pageExtensions: string[]; contentEntryTypes: ContentEntryType[]; dataEntryTypes: DataEntryType[]; renderers: AstroRenderer[]; scripts: { stage: InjectedScriptStage; content: string; }[]; /** * Map of directive name (e.g. `load`) to the directive script code */ clientDirectives: Map; devToolbarApps: (DevToolbarAppEntry | string)[]; middlewares: { pre: string[]; post: string[]; }; tsConfig: TSConfig | undefined; tsConfigPath: string | undefined; watchFiles: string[]; timer: AstroTimer; dotAstroDir: URL; /** * Latest version of Astro, will be undefined if: * - unable to check * - the user has disabled the check * - the check has not completed yet * - the user is on the latest version already */ latestAstroVersion: string | undefined; injectedTypes: Array & Partial>>; /** * Determine if the build output should be a static, dist folder or an adapter-based server output * undefined when unknown */ buildOutput: undefined | 'static' | 'server'; injectedCsp: { fontResources: Set; styleHashes: Required['hashes']; }; logLevel: AstroLoggerLevel; fontsHttpServer: Server | null; } /** Generic interface for a component (Astro, Svelte, React, etc.) */ export interface ComponentInstance { default: AstroComponentFactory; css?: string[]; partial?: boolean; prerender?: boolean; getStaticPaths?: GetStaticPaths; } export interface RoutesList { routes: RouteData[]; } export interface AstroPluginOptions { settings: AstroSettings; logger: AstroLogger; } export interface ImportedDevStyle { id: string; url: string; content: string; } export {};