Home / Type/ AstroAssets Type — astro Architecture

AstroAssets Type — astro Architecture

Architecture documentation for the AstroAssets type/interface in client.d.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  bbb6271c_8aac_42c9_f432_34338f204b49["AstroAssets"]
  4db49436_6875_120a_1b60_e7ec50668b56["client.d.ts"]
  bbb6271c_8aac_42c9_f432_34338f204b49 -->|defined in| 4db49436_6875_120a_1b60_e7ec50668b56
  style bbb6271c_8aac_42c9_f432_34338f204b49 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/client.d.ts lines 34–55

	type AstroAssets = {
		// getImage's type here is different from the internal function since the Vite module implicitly pass the service config
		/**
		 * Get an optimized image and the necessary attributes to render it.
		 *
		 * **Example**
		 * ```astro
		 * ---
		 * import { getImage } from 'astro:assets';
		 * import originalImage from '../assets/image.png';
		 *
		 * const optimizedImage = await getImage({src: originalImage, width: 1280 });
		 * ---
		 * <img src={optimizedImage.src} {...optimizedImage.attributes} />
		 * ```
		 *
		 * This is functionally equivalent to using the `<Image />` component, as the component calls this function internally.
		 */
		getImage: (
			options: import('./dist/assets/types.js').UnresolvedImageTransform,
		) => Promise<import('./dist/assets/types.js').GetImageResult>;
		imageConfig: import('./dist/types/public/config.js').AstroConfig['image'];

Frequently Asked Questions

What is the AstroAssets type?
AstroAssets is a type/interface in the astro codebase, defined in packages/astro/client.d.ts.
Where is AstroAssets defined?
AstroAssets is defined in packages/astro/client.d.ts at line 34.

Analyze Your Own Codebase

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

Try Supermodel Free