Home / Type/ LocalImageService Type — astro Architecture

LocalImageService Type — astro Architecture

Architecture documentation for the LocalImageService type/interface in service.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  0ce13480_1b4b_2428_9754_e9f2b3963690["LocalImageService"]
  f0f55fc4_9c63_b35c_86d8_8eb3e4fa20ee["service.ts"]
  0ce13480_1b4b_2428_9754_e9f2b3963690 -->|defined in| f0f55fc4_9c63_b35c_86d8_8eb3e4fa20ee
  style 0ce13480_1b4b_2428_9754_e9f2b3963690 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/services/service.ts lines 102–129

export interface LocalImageService<T extends Record<string, any> = Record<string, any>>
	extends SharedServiceProps<T> {
	/**
	 * Parse the requested parameters passed in the URL from `getURL` back into an object to be used later by `transform`.
	 *
	 * In most cases, this will get query parameters using, for example, `params.get('width')` and return those.
	 */
	parseURL: (
		url: URL,
		imageConfig: ImageConfig<T>,
	) => LocalImageTransform | undefined | Promise<LocalImageTransform> | Promise<undefined>;
	/**
	 * Performs the image transformations on the input image and returns both the binary data and
	 * final image format of the optimized image.
	 */
	transform: (
		inputBuffer: Uint8Array,
		transform: LocalImageTransform,
		imageConfig: ImageConfig<T>,
	) => Promise<{ data: Uint8Array; format: ImageOutputFormat }>;

	/**
	 * A list of properties that should be used to generate the hash for the image.
	 *
	 * Generally, this should be all the properties that can change the result of the image. By default, this is `src`, `width`, `height`, `format`, `quality`, `fit`, `position`, and `background`.
	 */
	propertiesToHash?: string[];
}

Frequently Asked Questions

What is the LocalImageService type?
LocalImageService is a type/interface in the astro codebase, defined in packages/astro/src/assets/services/service.ts.
Where is LocalImageService defined?
LocalImageService is defined in packages/astro/src/assets/services/service.ts at line 102.

Analyze Your Own Codebase

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

Try Supermodel Free