Home / Type/ Loader Type — astro Architecture

Loader Type — astro Architecture

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

Entity Profile

Dependency Diagram

graph TD
  ebfbff05_4740_c1de_c965_4f6d5ac9c1f4["Loader"]
  a146b99b_6ede_06f0_3c83_b19531b5f76a["types.ts"]
  ebfbff05_4740_c1de_c965_4f6d5ac9c1f4 -->|defined in| a146b99b_6ede_06f0_3c83_b19531b5f76a
  style ebfbff05_4740_c1de_c965_4f6d5ac9c1f4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/content/loaders/types.ts lines 57–74

export type Loader = {
	/** Unique name of the loader, e.g. the npm package name */
	name: string;
	/** Do the actual loading of the data */
	load: (context: LoaderContext) => Promise<void>;
} & (
	| {
			/** Optionally, define the schema of the data. Will be overridden by user-defined schema */
			schema?: z.$ZodType;
	  }
	| {
			/** Optionally, provide a function to dynamically provide a schema. Will be overridden by user-defined schema */
			createSchema?: () => Promise<{
				schema: z.$ZodType;
				types: string;
			}>;
	  }
);

Frequently Asked Questions

What is the Loader type?
Loader is a type/interface in the astro codebase, defined in packages/astro/src/content/loaders/types.ts.
Where is Loader defined?
Loader is defined in packages/astro/src/content/loaders/types.ts at line 57.

Analyze Your Own Codebase

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

Try Supermodel Free