diff --git a/packages/firestore/lib/index.d.ts b/packages/firestore/lib/index.d.ts index 5a46fdc944..0920501df7 100644 --- a/packages/firestore/lib/index.d.ts +++ b/packages/firestore/lib/index.d.ts @@ -2340,6 +2340,8 @@ export const firebase: ReactNativeFirebase.Module & { ): ReactNativeFirebase.FirebaseApp & { firestore(): FirebaseFirestoreTypes.Module }; }; +export * from './modular'; + export const Filter: FilterFunction; export default defaultExport; diff --git a/packages/firestore/lib/modular/index.d.ts b/packages/firestore/lib/modular/index.d.ts index 74b27ab853..c161da7ae0 100644 --- a/packages/firestore/lib/modular/index.d.ts +++ b/packages/firestore/lib/modular/index.d.ts @@ -532,3 +532,11 @@ export function namedQuery(firestore: Firestore, name: string): Query {}); +onSnapshot(doc(firebase.firestore(), 'foo', 'foo'), { + next: (snapshot: FirebaseFirestoreTypes.DocumentSnapshot) => { + console.log(snapshot.get('foo')); + }, + error: (error: { message: any }) => { + console.log(error.message); + }, +}); +onSnapshot( + doc(firebase.firestore(), 'foo', 'foo'), + { + includeMetadataChanges: true, + }, + { + next: (snapshot: FirebaseFirestoreTypes.DocumentSnapshot) => { + console.log(snapshot.get('foo')); + }, + error: (error: { message: any }) => { + console.log(error.message); + }, + complete() {}, + }, +); +onSnapshot( + collection(firebase.firestore(), 'foo'), + (snapshot: FirebaseFirestoreTypes.QuerySnapshot) => { + console.log(snapshot.docs); + }, + (error: { message: any }) => { + console.log(error.message); + }, + () => {}, +); +onSnapshot( + collection(firebase.firestore(), 'foo'), + { + includeMetadataChanges: true, + }, + { + next: (snapshot: FirebaseFirestoreTypes.QuerySnapshot) => { + console.log(snapshot.docs); + }, + error: (error: { message: any }) => { + console.log(error.message); + }, + complete() {}, + }, +);