@inox-tools/content-utils
Version:
Utilities to work with content collections on an Astro project from an integration or library.
43 lines (37 loc) • 1.82 kB
TypeScript
/// <reference path="../virtual.d.ts" />
import * as _inox_tools_modular_station from '@inox-tools/modular-station';
import * as astro_integration_kit from 'astro-integration-kit';
type SeedCollectionsOptions = {
/**
* Seed collections using this template if they are not present.
*/
templateDirectory: string;
};
type InjectCollectionOptions = {
/**
* Module to be imported with the configured collections.
*
* This module should be resolvable from the root of the Astro project and must export a `collections` object.
*/
entrypoint: string;
/**
* Seed collections using this template if they are not present.
*
* @see {seedCollections}
*/
seedTemplateDirectory?: string;
};
declare const integration: _inox_tools_modular_station.NeighborIntegration<[options?: {
staticOnlyCollections?: string[] | undefined;
} | undefined], {
injectCollection: _inox_tools_modular_station.HookLimitedApi<"astro:config:setup" | "astro:config:done" | "astro:server:setup" | "astro:build:start", (options: InjectCollectionOptions) => void>;
seedCollections: _inox_tools_modular_station.HookLimitedApi<"astro:config:setup" | "astro:config:done" | "astro:server:setup" | "astro:build:start", (options: SeedCollectionsOptions) => void>;
}>;
/**
* Inject a content collection definition alongside the project.
*
* Collections defined here can be overriden by the project.
*/
declare const injectCollections: astro_integration_kit.HookUtility<"astro:config:setup", [options: InjectCollectionOptions], void>;
declare const seedCollections: astro_integration_kit.HookUtility<"astro:config:setup", [options: SeedCollectionsOptions], void>;
export { type InjectCollectionOptions, integration as default, injectCollections, integration, seedCollections };