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

Code before:
	}) => void | Promise<void>;
	'astro:build:start': (options: { logger: AstroIntegrationLogger }) => void | Promise<void>;
	'astro:build:setup': (options: {
		vite: ViteInlineConfig;
		pages: Map<string, PageBuildData>;
		target: 'client' | 'server';
		updateConfig: (newConfig: ViteInlineConfig) => void;
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
	'astro:build:generated': (options: {
		dir: URL;
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
	'astro:build:done': (options: {
		pages: { pathname: string }[];
		dir: URL;
		/** @deprecated Use `routes` from `astro:routes:resolved` instead */
		routes: IntegrationRouteData[];
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
	'astro:route:setup': (options: {
		route: RouteOptions;
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
	'astro:routes:resolved': (options: {
		routes: Array<IntegrationResolvedRoute>;
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
}

export interface AstroIntegration {
	/** The name of the integration. */
	name: string;
	/** The different hooks available to extend. */
	hooks: {
		[K in keyof Astro.IntegrationHooks]?: Astro.IntegrationHooks[K];
	} & Partial<Record<string, unknown>>;
}

/**
 * A smaller version of the {@link RouteData} that is used in the integrations.
 */
export type IntegrationRouteData = Omit<
	RouteData,
	'isIndex' | 'fallbackRoutes' | 'redirectRoute' | 'origin'
> & {
	/**
	 * {@link RouteData.redirectRoute}
	 */
	redirectRoute?: IntegrationRouteData;
};

Review comment (suggestion):
For consistency with the other arrays in the type
```suggestion
		routes: IntegrationResolvedRoute[];
```

Code after:
	}) => void | Promise<void>;
	'astro:build:start': (options: { logger: AstroIntegrationLogger }) => void | Promise<void>;
	'astro:build:setup': (options: {
		vite: ViteInlineConfig;
		pages: Map<string, PageBuildData>;
		target: 'client' | 'server';
		updateConfig: (newConfig: ViteInlineConfig) => void;
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
	'astro:build:generated': (options: {
		dir: URL;
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
	'astro:build:done': (options: {
		pages: { pathname: string }[];
		dir: URL;
		/** @deprecated Use the `assets` map and the new `astro:routes:resolved` hook */
		routes: IntegrationRouteData[];
		assets: Map<string, URL[]>;
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
	'astro:route:setup': (options: {
		route: RouteOptions;
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
	'astro:routes:resolved': (options: {
		routes: IntegrationResolvedRoute[];
		logger: AstroIntegrationLogger;
	}) => void | Promise<void>;
}

export interface AstroIntegration {
	/** The name of the integration. */
	name: string;
	/** The different hooks available to extend. */
	hooks: {
		[K in keyof Astro.IntegrationHooks]?: Astro.IntegrationHooks[K];
	} & Partial<Record<string, unknown>>;
}

/**
 * A smaller version of the {@link RouteData} that is used in the integrations.
 * @deprecated Use {@link IntegrationResolvedRoute}
 */
export type IntegrationRouteData = Omit<
	RouteData,
	'isIndex' | 'fallbackRoutes' | 'redirectRoute' | 'origin'
> & {
	/**
	 * {@link RouteData.redirectRoute}
	 */