From 81667b274bf2f85432aeaa0d55425df2e60a0285 Mon Sep 17 00:00:00 2001 From: Philip Su <39933441+fivecar@users.noreply.github.com> Date: Wed, 26 Feb 2025 14:08:34 -0800 Subject: [PATCH] chore: Allow type-safety for subcollections --- packages/firestore/lib/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/firestore/lib/index.d.ts b/packages/firestore/lib/index.d.ts index 157ab293bd..2c6264874f 100644 --- a/packages/firestore/lib/index.d.ts +++ b/packages/firestore/lib/index.d.ts @@ -253,7 +253,10 @@ export namespace FirebaseFirestoreTypes { * to the location. The document at the referenced location may or may not exist. A `DocumentReference` can also be used * to create a `CollectionReference` to a subcollection. */ - export interface DocumentReference { + export interface DocumentReference< + T extends DocumentData = DocumentData, + C extends DocumentData = DocumentData, + > { /** * The Firestore instance the document is in. This is useful for performing transactions, for example. */ @@ -285,7 +288,7 @@ export namespace FirebaseFirestoreTypes { * * @param collectionPath A slash-separated path to a collection. */ - collection(collectionPath: string): CollectionReference; + collection(collectionPath: string): CollectionReference; /** * Deletes the document referred to by this DocumentReference.