File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,7 @@ export type SetOptions =
232
232
233
233
export class DocumentReference < T = DocumentData > {
234
234
private constructor ( ) ;
235
+ readonly type : 'document' ;
235
236
readonly id : string ;
236
237
readonly firestore : FirebaseFirestore ;
237
238
readonly path : string ;
@@ -272,6 +273,7 @@ export type WhereFilterOp =
272
273
273
274
export class Query < T = DocumentData > {
274
275
protected constructor ( ) ;
276
+ readonly type : 'query' | 'collection' ;
275
277
readonly firestore : FirebaseFirestore ;
276
278
where (
277
279
fieldPath : string | FieldPath ,
@@ -320,6 +322,7 @@ export interface DocumentChange<T = DocumentData> {
320
322
321
323
export class CollectionReference < T = DocumentData > extends Query < T > {
322
324
private constructor ( ) ;
325
+ readonly type : 'collection' ;
323
326
readonly id : string ;
324
327
readonly path : string ;
325
328
withConverter < U > (
Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ export type SetOptions =
193
193
194
194
export class DocumentReference < T = DocumentData > {
195
195
private constructor ( ) ;
196
+ readonly type : 'document' ;
196
197
readonly id : string ;
197
198
readonly firestore : FirebaseFirestore ;
198
199
readonly path : string ;
@@ -227,6 +228,7 @@ export type WhereFilterOp =
227
228
228
229
export class Query < T = DocumentData > {
229
230
protected constructor ( ) ;
231
+ readonly type : 'query' | 'collection' ;
230
232
readonly firestore : FirebaseFirestore ;
231
233
where (
232
234
fieldPath : string | FieldPath ,
@@ -264,6 +266,7 @@ export class QuerySnapshot<T = DocumentData> {
264
266
265
267
export class CollectionReference < T = DocumentData > extends Query < T > {
266
268
private constructor ( ) ;
269
+ readonly type : 'collection' ;
267
270
readonly id : string ;
268
271
readonly path : string ;
269
272
withConverter < U > (
Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ import { Code, FirestoreError } from '../../../src/util/error';
74
74
export class DocumentReference < T = firestore . DocumentData >
75
75
extends DocumentKeyReference < T >
76
76
implements firestore . DocumentReference < T > {
77
+ readonly type = 'document' ;
78
+
77
79
constructor (
78
80
readonly firestore : Firestore ,
79
81
key : DocumentKey ,
@@ -99,6 +101,8 @@ export class DocumentReference<T = firestore.DocumentData>
99
101
100
102
export class Query < T = firestore . DocumentData > extends BaseQuery
101
103
implements firestore . Query < T > {
104
+ readonly type : 'query' | 'collection' = 'query' ;
105
+
102
106
// This is the lite version of the Query class in the main SDK.
103
107
constructor (
104
108
readonly firestore : Firestore ,
@@ -256,6 +260,8 @@ export class Query<T = firestore.DocumentData> extends BaseQuery
256
260
257
261
export class CollectionReference < T = firestore . DocumentData > extends Query < T >
258
262
implements firestore . CollectionReference < T > {
263
+ readonly type = 'collection' ;
264
+
259
265
constructor (
260
266
readonly firestore : Firestore ,
261
267
readonly _path : ResourcePath ,
You can’t perform that action at this time.
0 commit comments