Skip to content

Commit

Permalink
feat: add fallbacks for every export
Browse files Browse the repository at this point in the history
  • Loading branch information
florian-lefebvre committed Feb 1, 2024
1 parent 94b5c5a commit f661e84
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions packages/astro/src/virtual-modules/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ type BaseSchemaWithoutEffects =
| z.ZodDiscriminatedUnion<string, z.AnyZodObject[]>
| z.ZodIntersection<BaseSchemaWithoutEffects, BaseSchemaWithoutEffects>;

type BaseSchema =
| BaseSchemaWithoutEffects
| z.ZodEffects<BaseSchemaWithoutEffects>;
type BaseSchema = BaseSchemaWithoutEffects | z.ZodEffects<BaseSchemaWithoutEffects>;

export type SchemaContext = { image: ImageFunction };

Expand All @@ -51,3 +49,27 @@ export function defineCollection<S extends BaseSchema>(
): CollectionConfig<S> {
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<C> = 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;

0 comments on commit f661e84

Please sign in to comment.