From 980ba5bed706b546f292ffba9712a92a338184dd Mon Sep 17 00:00:00 2001 From: Nikola Hristov Date: Fri, 29 Nov 2024 08:11:28 +0200 Subject: [PATCH] --- .astro/content.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.astro/content.d.ts b/.astro/content.d.ts index 283b21a..74dadfa 100644 --- a/.astro/content.d.ts +++ b/.astro/content.d.ts @@ -1,15 +1,19 @@ declare module 'astro:content' { export interface RenderResult { Content: import('astro/runtime/server/index.js').AstroComponentFactory; + headings: import('astro').MarkdownHeading[]; + remarkPluginFrontmatter: Record; } + interface Render { '.md': Promise; } export interface RenderedContent { html: string; + metadata?: { imagePaths: Array; [key: string]: unknown; @@ -21,12 +25,15 @@ declare module 'astro:content' { type Flatten = T extends { [K: string]: infer U } ? U : never; export type CollectionKey = keyof AnyEntryMap; + export type CollectionEntry = Flatten; export type ContentCollectionKey = keyof ContentEntryMap; + export type DataCollectionKey = keyof DataEntryMap; type AllValuesOf = T extends any ? T[keyof T] : never; + type ValidContentEntrySlug = AllValuesOf< ContentEntryMap[C] >['slug']; @@ -53,6 +60,7 @@ declare module 'astro:content' { collection: C, filter?: (entry: CollectionEntry) => entry is E, ): Promise; + export function getCollection( collection: C, filter?: (entry: CollectionEntry) => unknown, @@ -63,19 +71,23 @@ declare module 'astro:content' { E extends ValidContentEntrySlug | (string & {}), >(entry: { collection: C; + slug: E; }): E extends ValidContentEntrySlug ? Promise> : Promise | undefined>; + export function getEntry< C extends keyof DataEntryMap, E extends keyof DataEntryMap[C] | (string & {}), >(entry: { collection: C; + id: E; }): E extends keyof DataEntryMap[C] ? Promise : Promise | undefined>; + export function getEntry< C extends keyof ContentEntryMap, E extends ValidContentEntrySlug | (string & {}), @@ -85,6 +97,7 @@ declare module 'astro:content' { ): E extends ValidContentEntrySlug ? Promise> : Promise | undefined>; + export function getEntry< C extends keyof DataEntryMap, E extends keyof DataEntryMap[C] | (string & {}), @@ -99,12 +112,15 @@ declare module 'astro:content' { export function getEntries( entries: { collection: C; + slug: ValidContentEntrySlug; }[], ): Promise[]>; + export function getEntries( entries: { collection: C; + id: keyof DataEntryMap[C]; }[], ): Promise[]>; @@ -120,10 +136,12 @@ declare module 'astro:content' { C extends keyof ContentEntryMap ? { collection: C; + slug: ValidContentEntrySlug; } : { collection: C; + id: keyof DataEntryMap[C]; } >; @@ -135,6 +153,7 @@ declare module 'astro:content' { ): import('astro/zod').ZodEffects; type ReturnTypeOrOriginal = T extends (...args: any[]) => infer R ? R : T; + type InferEntrySchema = import('astro/zod').infer< ReturnTypeOrOriginal['schema']> >;