import { type FirestoreDocument, type LimitedFirestoreDocumentAccessorFactoryConfig } from '../accessor/document'; import { type FirestoreCollectionCacheConfig } from '../cache/cache'; import { type FirestoreItemPageIterationBaseConfig } from '../query/iterator'; import { type FirestoreContextReference } from '../reference'; import { type FirestoreDrivers } from '../driver/driver'; import { type FirestoreCollectionLike } from './collection'; /** * Configuration for creating a Firestore collection group accessor. * * Collection groups allow querying across all collections with the same ID in the database, * regardless of their location in the document hierarchy. This configuration combines * several interfaces to provide complete functionality for working with collection groups, * including document access, query execution, and pagination. * * @template T - The data type of the documents in the collection group * @template D - The FirestoreDocument type that wraps the data, defaults to FirestoreDocument */ export interface FirestoreCollectionGroupConfig = FirestoreDocument> extends FirestoreContextReference, FirestoreDrivers, FirestoreItemPageIterationBaseConfig, LimitedFirestoreDocumentAccessorFactoryConfig, Partial { } /** * Interface for working with documents across a Firestore collection group. * * A collection group provides access to all collections with the same ID across the database, * regardless of their location in the document hierarchy. This interface extends * FirestoreCollectionLike to provide query capabilities and document access functions * while maintaining type safety. * * Unlike regular collections, collection groups are primarily used for querying rather than * document creation or direct access, as the paths to individual documents may not be known. * * @template T - The data type of the documents in the collection group * @template D - The FirestoreDocument type that wraps the data, defaults to FirestoreDocument */ export interface FirestoreCollectionGroup = FirestoreDocument> extends FirestoreCollectionLike { /** * The configuration used to create this collection group. */ readonly config: FirestoreCollectionGroupConfig; } /** * Creates a new FirestoreCollectionGroup instance from the provided configuration. * * This factory function sets up all the necessary components for working with a collection group, * including query factories, document accessors, and iteration utilities. It ensures type safety * throughout the querying and document conversion process. * * Collection groups in Firestore allow querying across all collections with the same ID, * which is particularly useful for modeling relationships that can exist at different points * in the document hierarchy. * * @template T - The data type of the documents in the collection group * @template D - The FirestoreDocument type that wraps the data * @param config - Configuration for the collection group * @returns A fully configured FirestoreCollectionGroup instance */ export declare function makeFirestoreCollectionGroup>(config: FirestoreCollectionGroupConfig): FirestoreCollectionGroup;