Home / File/ types.ts — astro Source File

types.ts — astro Source File

Architecture documentation for types.ts, a typescript file in the astro codebase. 2 imports, 0 dependents.

File typescript CoreAstro CoreMiddleware 2 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  fcb0b8cf_45f8_2d29_61ca_f2b1b437b94b["types.ts"]
  c2f6615e_96e9_c4eb_5f71_cf120e271705["node:http"]
  fcb0b8cf_45f8_2d29_61ca_f2b1b437b94b --> c2f6615e_96e9_c4eb_5f71_cf120e271705
  f16d8c76_2866_6150_bd14_0347b59abfe9["astro"]
  fcb0b8cf_45f8_2d29_61ca_f2b1b437b94b --> f16d8c76_2866_6150_bd14_0347b59abfe9
  style fcb0b8cf_45f8_2d29_61ca_f2b1b437b94b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { IncomingMessage, ServerResponse } from 'node:http';
import type { SSRManifest } from 'astro';

export interface UserOptions {
	/**
	 * Specifies the mode that the adapter builds to.
	 *
	 * - 'middleware' - Build to middleware, to be used within another Node.js server, such as Express.
	 * - 'standalone' - Build to a standalone server. The server starts up just by running the built script.
	 */
	mode: 'middleware' | 'standalone';
	/**
	 * Disables HTML streaming. This is useful for example if there are constraints from your host.
	 */
	experimentalDisableStreaming?: boolean;

	/**
	 * If enabled, the adapter will save [static headers in the framework API file](https://docs.netlify.com/frameworks-api/#headers).
	 *
	 * Here the list of the headers that are added:
	 * - The CSP header of the static pages is added when CSP support is enabled.
	 */
	staticHeaders?: boolean;

	/**
	 * The host that should be used if the server needs to fetch the prerendered error page.
	 * If not provided, this will default to the host of the server. This should be set if the server
	 * should fetch prerendered error pages from a different host than the public URL of the server.
	 * This is useful for example if the server is behind a reverse proxy or a load balancer, or if
	 * static files are hosted on a different domain. Do not include a path in the URL: it will be ignored.
	 */
	experimentalErrorPageHost?: string | URL;
}

export interface Options extends UserOptions {
	host: string | boolean;
	port: number;
	server: string;
	client: string;
	assets: string;
	trailingSlash?: SSRManifest['trailingSlash'];
	staticHeaders: boolean;
}

export type RequestHandler = (...args: RequestHandlerParams) => void | Promise<void>;
type RequestHandlerParams = [
	req: IncomingMessage,
	res: ServerResponse,
	next?: (err?: unknown) => void,
	locals?: object,
];

Domain

Subdomains

Functions

Dependencies

  • astro
  • node:http

Frequently Asked Questions

What does types.ts do?
types.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What functions are defined in types.ts?
types.ts defines 2 function(s): args, err.
What does types.ts depend on?
types.ts imports 2 module(s): astro, node:http.
Where is types.ts in the architecture?
types.ts is located at packages/integrations/node/src/types.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/integrations/node/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free