Skip to content

TypeScript API / @laikacms/astro/loader / LaikaLoader

Interface: LaikaLoader ​

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

Properties ​

createSchema? ​

ts
optional 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
contextLaikaLoaderContext

Returns ​

Promise<void>


name ​

ts
name: string;

Released under the MIT License.