Skip to content

Commit 0ec05e0

Browse files
authored
Exporting DocumentReference and DocumentSnapshot types from Admin Firestore namespace (#193)
1 parent 0c4d07a commit 0ec05e0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ declare namespace admin.storage {
413413
}
414414

415415
declare namespace admin.firestore {
416+
export import DocumentReference = _firestore.DocumentReference;
417+
export import DocumentSnapshot = _firestore.DocumentSnapshot;
416418
export import FieldPath = _firestore.FieldPath;
417419
export import FieldValue = _firestore.FieldValue;
418420
export import Firestore = _firestore.Firestore;

test/integration/typescript/src/example.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,9 @@ describe('Init App', () => {
6464
const fieldValue = admin.firestore.FieldValue;
6565
expect(fieldValue).to.not.be.null;
6666
});
67+
68+
it('Should return a DocumentReference', () => {
69+
const ref: admin.firestore.DocumentReference = admin.firestore(app).collection('test').doc();
70+
expect(ref).to.not.be.null;
71+
});
6772
});

0 commit comments

Comments
 (0)