@@ -52,11 +52,17 @@ export function setLogLevel(logLevel: LogLevel): void;
52
52
export interface FirestoreDataConverter <
53
53
AppModelType ,
54
54
DbModelType extends DocumentData = DocumentData
55
- > {
55
+ > {
56
56
toFirestore ( modelObject : AppModelType ) : DocumentData ;
57
- toFirestore ( modelObject : Partial < AppModelType > , options : SetOptions ) : DocumentData ;
57
+ toFirestore (
58
+ modelObject : Partial < AppModelType > ,
59
+ options : SetOptions
60
+ ) : DocumentData ;
58
61
59
- fromFirestore ( snapshot : QueryDocumentSnapshot < AppModelType , DbModelType > , options : SnapshotOptions ) : AppModelType ;
62
+ fromFirestore (
63
+ snapshot : QueryDocumentSnapshot < AppModelType , DbModelType > ,
64
+ options : SnapshotOptions
65
+ ) : AppModelType ;
60
66
}
61
67
62
68
export class FirebaseFirestore {
@@ -213,7 +219,9 @@ export class Transaction {
213
219
...moreFieldsAndValues : any [ ]
214
220
) : Transaction ;
215
221
216
- delete < AppModelType , DbModelType extends DocumentData > ( documentRef : DocumentReference < AppModelType , DbModelType > ) : Transaction ;
222
+ delete < AppModelType , DbModelType extends DocumentData > (
223
+ documentRef : DocumentReference < AppModelType , DbModelType >
224
+ ) : Transaction ;
217
225
}
218
226
219
227
export class WriteBatch {
@@ -224,17 +232,25 @@ export class WriteBatch {
224
232
data : Partial < AppModelType > ,
225
233
options : SetOptions
226
234
) : WriteBatch ;
227
- set < AppModelType , DbModelType extends DocumentData > ( documentRef : DocumentReference < AppModelType , DbModelType > , data : UpdateData ) : WriteBatch ;
235
+ set < AppModelType , DbModelType extends DocumentData > (
236
+ documentRef : DocumentReference < AppModelType , DbModelType > ,
237
+ data : UpdateData
238
+ ) : WriteBatch ;
228
239
229
- update < AppModelType , DbModelType extends DocumentData > ( documentRef : DocumentReference < AppModelType , DbModelType > , data : UpdateData ) : WriteBatch ;
240
+ update < AppModelType , DbModelType extends DocumentData > (
241
+ documentRef : DocumentReference < AppModelType , DbModelType > ,
242
+ data : UpdateData
243
+ ) : WriteBatch ;
230
244
update < AppModelType , DbModelType extends DocumentData > (
231
245
documentRef : DocumentReference < AppModelType , DbModelType > ,
232
246
field : string | FieldPath ,
233
247
value : any ,
234
248
...moreFieldsAndValues : any [ ]
235
249
) : WriteBatch ;
236
250
237
- delete < AppModelType , DbModelType extends DocumentData > ( documentRef : DocumentReference < AppModelType , DbModelType > ) : WriteBatch ;
251
+ delete < AppModelType , DbModelType extends DocumentData > (
252
+ documentRef : DocumentReference < AppModelType , DbModelType >
253
+ ) : WriteBatch ;
238
254
239
255
commit ( ) : Promise < void > ;
240
256
}
@@ -276,7 +292,9 @@ export class DocumentReference<AppModelType, DbModelType> {
276
292
277
293
delete ( ) : Promise < void > ;
278
294
279
- get ( options ?: GetOptions ) : Promise < DocumentSnapshot < AppModelType , DbModelType > > ;
295
+ get (
296
+ options ?: GetOptions
297
+ ) : Promise < DocumentSnapshot < AppModelType , DbModelType > > ;
280
298
281
299
onSnapshot ( observer : {
282
300
next ?: ( snapshot : DocumentSnapshot < AppModelType , DbModelType > ) => void ;
@@ -335,8 +353,10 @@ export class DocumentSnapshot<AppModelType, DbModelType> {
335
353
isEqual ( other : DocumentSnapshot < AppModelType , DbModelType > ) : boolean ;
336
354
}
337
355
338
- export class QueryDocumentSnapshot < AppModelType , DbModelType >
339
- extends DocumentSnapshot < AppModelType , DbModelType > {
356
+ export class QueryDocumentSnapshot <
357
+ AppModelType ,
358
+ DbModelType
359
+ > extends DocumentSnapshot < AppModelType , DbModelType > {
340
360
private constructor ( ) ;
341
361
342
362
data ( options ?: SnapshotOptions ) : AppModelType ;
@@ -356,7 +376,10 @@ export type WhereFilterOp =
356
376
| 'array-contains-any'
357
377
| 'not-in' ;
358
378
359
- export class Query < AppModelType = DocumentData , DbModelType extends DocumentData = DocumentData > {
379
+ export class Query <
380
+ AppModelType = DocumentData ,
381
+ DbModelType extends DocumentData = DocumentData
382
+ > {
360
383
protected constructor ( ) ;
361
384
362
385
readonly firestore : FirebaseFirestore ;
@@ -376,16 +399,24 @@ export class Query<AppModelType = DocumentData, DbModelType extends DocumentData
376
399
377
400
limitToLast ( limit : number ) : Query < AppModelType , DbModelType > ;
378
401
379
- startAt ( snapshot : DocumentSnapshot < AppModelType , DbModelType > ) : Query < AppModelType , DbModelType > ;
402
+ startAt (
403
+ snapshot : DocumentSnapshot < AppModelType , DbModelType >
404
+ ) : Query < AppModelType , DbModelType > ;
380
405
startAt ( ...fieldValues : any [ ] ) : Query < AppModelType , DbModelType > ;
381
406
382
- startAfter ( snapshot : DocumentSnapshot < AppModelType , DbModelType > ) : Query < AppModelType , DbModelType > ;
407
+ startAfter (
408
+ snapshot : DocumentSnapshot < AppModelType , DbModelType >
409
+ ) : Query < AppModelType , DbModelType > ;
383
410
startAfter ( ...fieldValues : any [ ] ) : Query < AppModelType , DbModelType > ;
384
411
385
- endBefore ( snapshot : DocumentSnapshot < AppModelType , DbModelType > ) : Query < AppModelType , DbModelType > ;
412
+ endBefore (
413
+ snapshot : DocumentSnapshot < AppModelType , DbModelType >
414
+ ) : Query < AppModelType , DbModelType > ;
386
415
endBefore ( ...fieldValues : any [ ] ) : Query < AppModelType , DbModelType > ;
387
416
388
- endAt ( snapshot : DocumentSnapshot < AppModelType , DbModelType > ) : Query < AppModelType , DbModelType > ;
417
+ endAt (
418
+ snapshot : DocumentSnapshot < AppModelType , DbModelType >
419
+ ) : Query < AppModelType , DbModelType > ;
389
420
endAt ( ...fieldValues : any [ ] ) : Query < AppModelType , DbModelType > ;
390
421
391
422
isEqual ( other : Query < AppModelType , DbModelType > ) : boolean ;
@@ -430,10 +461,14 @@ export class QuerySnapshot<AppModelType, DbModelType> {
430
461
readonly size : number ;
431
462
readonly empty : boolean ;
432
463
433
- docChanges ( options ?: SnapshotListenOptions ) : Array < DocumentChange < AppModelType , DbModelType > > ;
464
+ docChanges (
465
+ options ?: SnapshotListenOptions
466
+ ) : Array < DocumentChange < AppModelType , DbModelType > > ;
434
467
435
468
forEach (
436
- callback : ( result : QueryDocumentSnapshot < AppModelType , DbModelType > ) => void ,
469
+ callback : (
470
+ result : QueryDocumentSnapshot < AppModelType , DbModelType >
471
+ ) => void ,
437
472
thisArg ?: any
438
473
) : void ;
439
474
@@ -452,7 +487,7 @@ export interface DocumentChange<AppModelType, DbModelType> {
452
487
export class CollectionReference <
453
488
AppModelType = DocumentData ,
454
489
DbModelType extends DocumentData = DocumentData
455
- > extends Query < AppModelType , DbModelType > {
490
+ > extends Query < AppModelType , DbModelType > {
456
491
private constructor ( ) ;
457
492
458
493
readonly id : string ;
@@ -461,7 +496,9 @@ export class CollectionReference<
461
496
462
497
doc ( documentPath ?: string ) : DocumentReference < AppModelType , DbModelType > ;
463
498
464
- add ( data : AppModelType ) : Promise < DocumentReference < AppModelType , DbModelType > > ;
499
+ add (
500
+ data : AppModelType
501
+ ) : Promise < DocumentReference < AppModelType , DbModelType > > ;
465
502
466
503
isEqual ( other : CollectionReference < AppModelType , DbModelType > ) : boolean ;
467
504
0 commit comments