Skip to content

Commit e72d1df

Browse files
committed
reference.ts: add default DocumentData parameter type for NewDbModelType to the other withConverter() functions
1 parent 3df89be commit e72d1df

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

packages/firestore/src/lite-api/reference.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ export class DocumentReference<
252252
* @param converter - Converts objects to and from Firestore.
253253
* @returns A `DocumentReference` that uses the provided converter.
254254
*/
255-
withConverter<NewAppModelType, NewDbModelType extends DocumentData>(
255+
withConverter<
256+
NewAppModelType,
257+
NewDbModelType extends DocumentData = DocumentData
258+
>(
256259
converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>
257260
): DocumentReference<NewAppModelType, NewDbModelType>;
258261
/**
@@ -263,7 +266,10 @@ export class DocumentReference<
263266
* use a converter.
264267
*/
265268
withConverter(converter: null): DocumentReference<DocumentData, DocumentData>;
266-
withConverter<NewAppModelType, NewDbModelType extends DocumentData>(
269+
withConverter<
270+
NewAppModelType,
271+
NewDbModelType extends DocumentData = DocumentData
272+
>(
267273
converter: FirestoreDataConverter<NewAppModelType, NewDbModelType> | null
268274
): DocumentReference<NewAppModelType, NewDbModelType> {
269275
return new DocumentReference<NewAppModelType, NewDbModelType>(
@@ -334,7 +340,10 @@ export class CollectionReference<
334340
* @param converter - Converts objects to and from Firestore.
335341
* @returns A `CollectionReference` that uses the provided converter.
336342
*/
337-
withConverter<NewAppModelType, NewDbModelType extends DocumentData>(
343+
withConverter<
344+
NewAppModelType,
345+
NewDbModelType extends DocumentData = DocumentData
346+
>(
338347
converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>
339348
): CollectionReference<NewAppModelType, NewDbModelType>;
340349
/**
@@ -347,7 +356,10 @@ export class CollectionReference<
347356
withConverter(
348357
converter: null
349358
): CollectionReference<DocumentData, DocumentData>;
350-
withConverter<NewAppModelType, NewDbModelType extends DocumentData>(
359+
withConverter<
360+
NewAppModelType,
361+
NewDbModelType extends DocumentData = DocumentData
362+
>(
351363
converter: FirestoreDataConverter<NewAppModelType, NewDbModelType> | null
352364
): CollectionReference<NewAppModelType, NewDbModelType> {
353365
return new CollectionReference<NewAppModelType, NewDbModelType>(

0 commit comments

Comments
 (0)