@@ -127,7 +127,7 @@ import {
127
127
NextFn ,
128
128
PartialObserver
129
129
} from './observer' ;
130
- import { NestedPartialWithFieldValue , WithFieldValue } from '../lite/reference' ;
130
+ import { NestedPartial , WithFieldValue } from '../lite/reference' ;
131
131
132
132
/**
133
133
* A persistence provider for either memory-only or IndexedDB persistence.
@@ -441,22 +441,19 @@ export class Transaction implements PublicTransaction, Compat<ExpTransaction> {
441
441
442
442
set < T > (
443
443
documentRef : DocumentReference < T > ,
444
- data : NestedPartialWithFieldValue < T > ,
444
+ data : Partial < T > ,
445
445
options : PublicSetOptions
446
446
) : Transaction ;
447
- set < T > (
448
- documentRef : DocumentReference < T > ,
449
- data : WithFieldValue < T >
450
- ) : Transaction ;
447
+ set < T > ( documentRef : DocumentReference < T > , data : T ) : Transaction ;
451
448
set < T > (
452
449
documentRef : PublicDocumentReference < T > ,
453
- data : WithFieldValue < T > | NestedPartialWithFieldValue < T > ,
450
+ data : T | Partial < T > ,
454
451
options ?: PublicSetOptions
455
452
) : Transaction {
456
453
const ref = castReference ( documentRef ) ;
457
454
if ( options ) {
458
455
validateSetOptions ( 'Transaction.set' , options ) ;
459
- this . _delegate . set ( ref , data as NestedPartialWithFieldValue < T > , options ) ;
456
+ this . _delegate . set ( ref , data as NestedPartial < T > , options ) ;
460
457
} else {
461
458
this . _delegate . set ( ref , data as WithFieldValue < T > ) ;
462
459
}
@@ -505,22 +502,19 @@ export class WriteBatch implements PublicWriteBatch, Compat<ExpWriteBatch> {
505
502
constructor ( readonly _delegate : ExpWriteBatch ) { }
506
503
set < T > (
507
504
documentRef : DocumentReference < T > ,
508
- data : NestedPartialWithFieldValue < T > ,
505
+ data : Partial < T > ,
509
506
options : PublicSetOptions
510
507
) : WriteBatch ;
511
- set < T > (
512
- documentRef : DocumentReference < T > ,
513
- data : WithFieldValue < T >
514
- ) : WriteBatch ;
508
+ set < T > ( documentRef : DocumentReference < T > , data : Partial < T > ) : WriteBatch ;
515
509
set < T > (
516
510
documentRef : PublicDocumentReference < T > ,
517
- data : WithFieldValue < T > | NestedPartialWithFieldValue < T > ,
511
+ data : T | Partial < T > ,
518
512
options ?: PublicSetOptions
519
513
) : WriteBatch {
520
514
const ref = castReference ( documentRef ) ;
521
515
if ( options ) {
522
516
validateSetOptions ( 'WriteBatch.set' , options ) ;
523
- this . _delegate . set ( ref , data as NestedPartialWithFieldValue < T > , options ) ;
517
+ this . _delegate . set ( ref , data as NestedPartial < T > , options ) ;
524
518
} else {
525
519
this . _delegate . set ( ref , data as WithFieldValue < T > ) ;
526
520
}
@@ -606,11 +600,11 @@ class FirestoreDataConverter<U>
606
600
607
601
toFirestore ( modelObject : WithFieldValue < U > ) : PublicDocumentData ;
608
602
toFirestore (
609
- modelObject : NestedPartialWithFieldValue < U > ,
603
+ modelObject : NestedPartial < U > ,
610
604
options : PublicSetOptions
611
605
) : PublicDocumentData ;
612
606
toFirestore (
613
- modelObject : WithFieldValue < U > | NestedPartialWithFieldValue < U > ,
607
+ modelObject : WithFieldValue < U > | NestedPartial < U > ,
614
608
options ?: PublicSetOptions
615
609
) : PublicDocumentData {
616
610
if ( ! options ) {
@@ -741,11 +735,7 @@ export class DocumentReference<T = PublicDocumentData>
741
735
options = validateSetOptions ( 'DocumentReference.set' , options ) ;
742
736
try {
743
737
if ( options ) {
744
- return setDoc (
745
- this . _delegate ,
746
- value as NestedPartialWithFieldValue < T > ,
747
- options
748
- ) ;
738
+ return setDoc ( this . _delegate , value as NestedPartial < T > , options ) ;
749
739
} else {
750
740
return setDoc ( this . _delegate , value as WithFieldValue < T > ) ;
751
741
}
@@ -1302,7 +1292,7 @@ export class CollectionReference<T = PublicDocumentData>
1302
1292
}
1303
1293
1304
1294
add ( data : T ) : Promise < DocumentReference < T > > {
1305
- return addDoc ( this . _delegate , data ) . then (
1295
+ return addDoc ( this . _delegate , data as WithFieldValue < T > ) . then (
1306
1296
docRef => new DocumentReference ( this . firestore , docRef )
1307
1297
) ;
1308
1298
}
0 commit comments