Home / Class/ options Class — astro Architecture

options Class — astro Architecture

Architecture documentation for the options class in client.d.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  ed8521e6_c420_e42a_20af_ebef472e723b["options"]
  4db49436_6875_120a_1b60_e7ec50668b56["client.d.ts"]
  ed8521e6_c420_e42a_20af_ebef472e723b -->|defined in| 4db49436_6875_120a_1b60_e7ec50668b56

Relationship Graph

Source Code

packages/astro/client.d.ts lines 32–62

declare module 'astro:assets' {
	// Exporting things one by one is a bit cumbersome, not sure if there's a better way - erika, 2023-02-03
	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'];
		getConfiguredImageService: typeof import('./dist/assets/index.js').getConfiguredImageService;
		inferRemoteSize: typeof import('./dist/assets/utils/index.js').inferRemoteSize;
		Image: typeof import('./components/Image.astro').default;
		Picture: typeof import('./components/Picture.astro').default;
		Font: typeof import('./components/Font.astro').default;
		fontData: Record<import('astro:assets').CssVariable, Array<import('astro:assets').FontData>>;
	};

Domain

Frequently Asked Questions

What is the options class?
options is a class in the astro codebase, defined in packages/astro/client.d.ts.
Where is options defined?
options is defined in packages/astro/client.d.ts at line 32.

Analyze Your Own Codebase

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

Try Supermodel Free