Home / Type/ WithOptions Type — astro Architecture

WithOptions Type — astro Architecture

Architecture documentation for the WithOptions type/interface in types.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  ade98113_5142_3656_e0a8_ce2101ab95b6["WithOptions"]
  0414cf8f_0404_f03b_316f_0d732aa66968["types.ts"]
  ade98113_5142_3656_e0a8_ce2101ab95b6 -->|defined in| 0414cf8f_0404_f03b_316f_0d732aa66968
  style ade98113_5142_3656_e0a8_ce2101ab95b6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/assets/fonts/types.ts lines 91–119

type WithOptions<TFontProvider extends FontProvider> = TFontProvider extends FontProvider<
	infer TFamilyOptions
>
	? [TFamilyOptions] extends [never]
		? {
				/**
				 * An object to pass provider specific options. It is typed automatically based on the font family provider.
				 */
				options?: undefined;
			}
		: undefined extends TFamilyOptions
			? {
					/**
					 * An object to pass provider specific options. It is typed automatically based on the font family provider.
					 */
					options?: TFamilyOptions;
				}
			: {
					/**
					 * An object to pass provider specific options. It is typed automatically based on the font family provider.
					 */
					options: TFamilyOptions;
				}
	: {
			/**
			 * An object to pass provider specific options. It is typed automatically based on the font family provider.
			 */
			options?: undefined;
		};

Frequently Asked Questions

What is the WithOptions type?
WithOptions is a type/interface in the astro codebase, defined in packages/astro/src/assets/fonts/types.ts.
Where is WithOptions defined?
WithOptions is defined in packages/astro/src/assets/fonts/types.ts at line 91.

Analyze Your Own Codebase

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

Try Supermodel Free