From f661e84ba58b10c4d43f7e292307ef86b1ebec13 Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Thu, 1 Feb 2024 11:44:32 +0100 Subject: [PATCH] feat: add fallbacks for every export --- packages/astro/src/virtual-modules/content.ts | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/packages/astro/src/virtual-modules/content.ts b/packages/astro/src/virtual-modules/content.ts index c885ebe3368c..a3e9a68289ae 100644 --- a/packages/astro/src/virtual-modules/content.ts +++ b/packages/astro/src/virtual-modules/content.ts @@ -28,9 +28,7 @@ type BaseSchemaWithoutEffects = | z.ZodDiscriminatedUnion | z.ZodIntersection; -type BaseSchema = - | BaseSchemaWithoutEffects - | z.ZodEffects; +type BaseSchema = BaseSchemaWithoutEffects | z.ZodEffects; export type SchemaContext = { image: ImageFunction }; @@ -51,3 +49,27 @@ export function defineCollection( ): CollectionConfig { return _defineCollection(input); } + +const noop: (...args: any[]) => any = () => {}; +/** Run `astro sync` to generate high fidelity types */ +export const getEntryBySlug = noop; +/** Run `astro sync` to generate high fidelity types */ +export const getDataEntryById = noop; +/** Run `astro sync` to generate high fidelity types */ +export const getCollection = noop; +/** Run `astro sync` to generate high fidelity types */ +export const getEntry = noop; +/** Run `astro sync` to generate high fidelity types */ +export const getEntries = noop; +/** Run `astro sync` to generate high fidelity types */ +export const reference = noop; +/** Run `astro sync` to generate high fidelity types */ +export type CollectionKey = any; +/** Run `astro sync` to generate high fidelity types */ +export type CollectionEntry = any; +/** Run `astro sync` to generate high fidelity types */ +export type ContentCollectionKey = any; +/** Run `astro sync` to generate high fidelity types */ +export type DataCollectionKey = any; +/** Run `astro sync` to generate high fidelity types */ +export type ContentConfig = any;