Skip to content

TypeScript API / @laikacms/astro/loader / ObjectsLoaderOptions

Interface: ObjectsLoaderOptions ​

Extends ​

Properties ​

catalog? ​

ts
optional catalog?: CatalogChoice;

Which catalog maps a collection to a directory. Defaults to 'convention'. Ignored when repositories is given.

Inherited from ​

LaikaRepositoryOptions.catalog


configKey? ​

ts
optional configKey?: string;

Where the Decap config lives, for catalog: 'decap'. Defaults to 'config'.

Inherited from ​

LaikaRepositoryOptions.configKey


defaultExtension? ​

ts
optional defaultExtension?: string;

File extension applied to keys without one. Defaults to 'json'.

Inherited from ​

LaikaRepositoryOptions.defaultExtension


dir? ​

ts
optional dir?: string;

Directory the default filesystem repository reads, resolved relative to the Astro project root. Ignored when storage or repositories is given. Defaults to 'content'.

Inherited from ​

LaikaRepositoryOptions.dir


entry? ​

ts
optional entry?: EntryOptions;

name? ​

ts
optional name?: string;

Loader name, which is what refreshContent({ loaders }) targets.


render? ​

ts
optional render?: RenderOptions;

repositories? ​

ts
optional repositories?: any;

Bring your own repositories. Highest precedence — nothing else in this struct is read when it is set.

Inherited from ​

LaikaRepositoryOptions.repositories


root? ​

ts
optional root?: string;

Astro project root, for resolving a relative dir before load runs.


select? ​

ts
optional select?: ObjectSelectOptions;

serializers? ​

ts
optional serializers?: StorageSerializerRegistry;

Serializer registry for the default filesystem repository.

Inherited from ​

LaikaRepositoryOptions.serializers


storage? ​

ts
optional storage?: StorageRepository;

The storage repository to read. Highest precedence.

Overrides ​

LaikaRepositoryOptions.storage


sync? ​

ts
optional sync?: ObjectsSyncOptions;

z? ​

ts
optional z?: ZodNamespace;

The z from astro:content.

Storage objects have no catalog fields to derive a schema from, so supplying z — together with an explicit select.folder — makes the loader describe the objects it actually finds and hand Astro the resulting types. entry.data is then typed instead of unknown.

The schema stays permissive: these types report what the content contains, they do not constrain what it may contain.

Released under the MIT License.