Skip to content

TypeScript API / @contentia/astro/loader / ContentiaLoader

Interface: ContentiaLoader ​

The loader shape these loaders produce. Assignable to Astro's Loader.

Properties ​

createSchema? ​

ts
createSchema?: () => Promise<{
  schema: unknown;
  types: string;
}>;

Supplies the collection schema and the TypeScript source describing it. Astro calls this when the collection declares no schema of its own, writes the source into .astro/loaders/, and types entries from it — which is how a schema derived from a CMS config at build time still gives you entry.data.title in an editor.

Returns ​

Promise<{ schema: unknown; types: string; }>


load ​

ts
load: (context) => Promise<void>;

Parameters ​

ParameterType
contextContentiaLoaderContext

Returns ​

Promise<void>


name ​

ts
name: string;