/// <reference path="../virtual.d.ts" />

import { BaseSchema, SchemaContext, defineCollection as defineCollection$1 } from 'astro:content';
export { BaseSchema } from 'astro:content';
import { ZodIntersection } from 'astro/zod';

/** Type that extends a collection's default schema with an optional, user-defined schema. */
type ExtendedSchema<S extends BaseSchema, T extends BaseSchema | never = never> = [
    T
] extends [never] ? S : T extends BaseSchema ? ZodIntersection<S, T> : S;
type CollectionConfig<S extends BaseSchema> = ReturnType<typeof defineCollection$1<S>>;
interface CollectionExtensionOptions<E extends BaseSchema> {
    extends?: E | ((context: SchemaContext) => E);
}
type ExtendedCollection<S extends BaseSchema, E extends BaseSchema> = ExtendedSchema<S, E> extends BaseSchema ? CollectionConfig<ExtendedSchema<S, E>> : CollectionConfig<S>;
type FancyCollection<S extends BaseSchema = BaseSchema> = <E extends BaseSchema>(options?: CollectionExtensionOptions<E>) => ExtendedCollection<S, E>;
/**
 * Define a collection from an integration that can be extended by users of the integration.
 *
 * Also known as a FancyCollection 💅
 */
declare function defineCollection<S extends BaseSchema>(config: CollectionConfig<S>): FancyCollection<S>;
/**
 * Guard checking that a value is a FancyCollection.
 */
declare function isFancyCollection(something: any): something is FancyCollection;
/**
 * Extract the original FancyCollection from a value, if it was derived from one.
 *
 * If the value was not derived from a FancyCollection, return null;
 */
declare function tryGetOriginalFancyCollection(something: any): FancyCollection | null;

export { type CollectionExtensionOptions, type ExtendedCollection, type ExtendedSchema, type FancyCollection, defineCollection, isFancyCollection, tryGetOriginalFancyCollection };
