Repository: withastro/astro
File: packages/astro/src/types/public/integrations.ts (TypeScript)

Code before:
	 * `astro:build:generated` hook, so adapters can consume them and add them inside
	 * their hosting headers configuration file.
	 *
	 * NOTE: the semantics and list of headers might change until the feature
	 * is out of experimental
	 */
	experimentalStaticHeaders?: boolean;
}

export interface AstroAdapter {
	name: string;
	serverEntrypoint?: string | URL;
	previewEntrypoint?: string | URL;
	exports?: string[];
	args?: any;
	adapterFeatures?: AstroAdapterFeatures;
	/**
	 * List of features supported by an adapter.
	 *
	 * If the adapter is not able to handle certain configurations, Astro will throw an error.
	 */
	supportedAstroFeatures: AstroAdapterFeatureMap;
	/**
	 * Runtime configuration that will be available to Astro's client-side code.
	 */
	runtimeConfig?: {
		/**
		 * Headers to inject into Astro's internal fetch calls (Actions, View Transitions, Server Islands, Prefetch).
		 * Can be an object of headers or a function that returns headers.
		 */
		internalFetchHeaders?: Record<string, string> | (() => Record<string, string>);
	};
}

export type AstroAdapterFeatureMap = {
	/**
	 * The adapter is able to serve static pages
	 */
	staticOutput?: AdapterSupport;

	/**
	 * The adapter is able to serve pages that are static or rendered via server
	 */
	hybridOutput?: AdapterSupport;

	/**
	 * The adapter is able to serve SSR pages
	 */
	serverOutput?: AdapterSupport;

	/**

Review comment (suggestion):
We are already inside a configuration, so calling this `Config` seems redundant.

Also, "runtime" and client-side code have different meanings to us, so I would look for a better name or a better description.

Code after:
	 * `astro:build:generated` hook, so adapters can consume them and add them inside
	 * their hosting headers configuration file.
	 *
	 * NOTE: the semantics and list of headers might change until the feature
	 * is out of experimental
	 */
	experimentalStaticHeaders?: boolean;
}

export interface AstroAdapter {
	name: string;
	serverEntrypoint?: string | URL;
	previewEntrypoint?: string | URL;
	exports?: string[];
	args?: any;
	adapterFeatures?: AstroAdapterFeatures;
	/**
	 * List of features supported by an adapter.
	 *
	 * If the adapter is not able to handle certain configurations, Astro will throw an error.
	 */
	supportedAstroFeatures: AstroAdapterFeatureMap;
	/**
	 * Configuration for Astro's client-side code.
	 */
	client?: {
		/**
		 * Headers to inject into Astro's internal fetch calls (Actions, View Transitions, Server Islands, Prefetch).
		 * Can be an object of headers or a function that returns headers.
		 */
		internalFetchHeaders?: Record<string, string> | (() => Record<string, string>);
		/**
		 * Query parameters to append to all asset URLs (images, stylesheets, scripts, etc.).
		 * Useful for adapters that need to track deployment versions or other metadata.
		 */
		assetQueryParams?: URLSearchParams;
	};
}

export type AstroAdapterFeatureMap = {
	/**
	 * The adapter is able to serve static pages
	 */
	staticOutput?: AdapterSupport;

	/**
	 * The adapter is able to serve pages that are static or rendered via server
	 */
	hybridOutput?: AdapterSupport;

	/**