@@ -28,7 +28,6 @@ import {
2828 MAX_RETRY_ATTEMPTS ,
2929} from './backoff' ;
3030import { RateLimiter } from './rate-limiter' ;
31- import { DocumentReference } from './reference' ;
3231import { Timestamp } from './timestamp' ;
3332import {
3433 Deferred ,
@@ -337,7 +336,7 @@ export class BulkWriterError extends Error {
337336 readonly message : string ,
338337
339338 /** The document reference the operation was performed on. */
340- readonly documentRef : firestore . DocumentReference < unknown > ,
339+ readonly documentRef : firestore . DocumentReference < any , any > ,
341340
342341 /** The type of operation performed. */
343342 readonly operationType : 'create' | 'set' | 'update' | 'delete' ,
@@ -576,9 +575,9 @@ export class BulkWriter {
576575 * });
577576 * ```
578577 */
579- create < T > (
580- documentRef : firestore . DocumentReference < T > ,
581- data : firestore . WithFieldValue < T >
578+ create < AppModelType , DbModelType extends firestore . DocumentData > (
579+ documentRef : firestore . DocumentReference < AppModelType , DbModelType > ,
580+ data : firestore . WithFieldValue < AppModelType >
582581 ) : Promise < WriteResult > {
583582 this . _verifyNotClosed ( ) ;
584583 return this . _enqueue ( documentRef , 'create' , bulkCommitBatch =>
@@ -616,8 +615,8 @@ export class BulkWriter {
616615 * });
617616 * ```
618617 */
619- delete < T > (
620- documentRef : firestore . DocumentReference < T > ,
618+ delete < AppModelType , DbModelType extends firestore . DocumentData > (
619+ documentRef : firestore . DocumentReference < AppModelType , DbModelType > ,
621620 precondition ?: firestore . Precondition
622621 ) : Promise < WriteResult > {
623622 this . _verifyNotClosed ( ) ;
@@ -626,14 +625,14 @@ export class BulkWriter {
626625 ) ;
627626 }
628627
629- set < T > (
630- documentRef : firestore . DocumentReference < T > ,
631- data : Partial < T > ,
628+ set < AppModelType , DbModelType extends firestore . DocumentData > (
629+ documentRef : firestore . DocumentReference < AppModelType , DbModelType > ,
630+ data : Partial < AppModelType > ,
632631 options : firestore . SetOptions
633632 ) : Promise < WriteResult > ;
634- set < T > (
635- documentRef : firestore . DocumentReference < T > ,
636- data : T
633+ set < AppModelType , DbModelType extends firestore . DocumentData > (
634+ documentRef : firestore . DocumentReference < AppModelType , DbModelType > ,
635+ data : AppModelType
637636 ) : Promise < WriteResult > ;
638637 /**
639638 * Write to the document referred to by the provided
@@ -675,9 +674,9 @@ export class BulkWriter {
675674 * });
676675 * ```
677676 */
678- set < T > (
679- documentRef : firestore . DocumentReference < T > ,
680- data : firestore . PartialWithFieldValue < T > ,
677+ set < AppModelType , DbModelType extends firestore . DocumentData > (
678+ documentRef : firestore . DocumentReference < AppModelType , DbModelType > ,
679+ data : firestore . PartialWithFieldValue < AppModelType > ,
681680 options ?: firestore . SetOptions
682681 ) : Promise < WriteResult > {
683682 this . _verifyNotClosed ( ) ;
@@ -687,7 +686,7 @@ export class BulkWriter {
687686 } else {
688687 return bulkCommitBatch . set (
689688 documentRef ,
690- data as firestore . WithFieldValue < T >
689+ data as firestore . WithFieldValue < AppModelType >
691690 ) ;
692691 }
693692 } ) ;
@@ -737,9 +736,9 @@ export class BulkWriter {
737736 * });
738737 * ```
739738 */
740- update < T > (
741- documentRef : firestore . DocumentReference < T > ,
742- dataOrField : firestore . UpdateData < T > | string | FieldPath ,
739+ update < AppModelType , DbModelType extends firestore . DocumentData > (
740+ documentRef : firestore . DocumentReference < AppModelType , DbModelType > ,
741+ dataOrField : firestore . UpdateData < DbModelType > | string | FieldPath ,
743742 ...preconditionOrValues : Array <
744743 { lastUpdateTime ?: Timestamp } | unknown | string | FieldPath
745744 >
@@ -783,7 +782,7 @@ export class BulkWriter {
783782 */
784783 onWriteResult (
785784 successCallback : (
786- documentRef : firestore . DocumentReference < unknown > ,
785+ documentRef : firestore . DocumentReference < any , any > ,
787786 result : WriteResult
788787 ) => void
789788 ) : void {
0 commit comments