File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ import { SnapshotListenOptions } from './reference_impl';
85
85
*/
86
86
export interface FirestoreDataConverter <
87
87
ModelT ,
88
- SerializedModelT extends DocumentData
88
+ SerializedModelT extends DocumentData = ModelT extends DocumentData ? ModelT : DocumentData
89
89
> extends LiteFirestoreDataConverter < ModelT , SerializedModelT > {
90
90
/**
91
91
* Called by the Firestore SDK to convert a custom model object of type
@@ -97,7 +97,7 @@ export interface FirestoreDataConverter<
97
97
* The `WithFieldValue<ModelT>` type extends `ModelT` to also allow
98
98
* FieldValues such as {@link (deleteField:1)} to be used as property values.
99
99
*/
100
- toFirestore ( modelObject : WithFieldValue < ModelT > ) : SerializedModelT ;
100
+ toFirestore ( modelObject : WithFieldValue < ModelT > ) : WithFieldValue < SerializedModelT > ;
101
101
102
102
/**
103
103
* Called by the Firestore SDK to convert a custom model object of type
@@ -124,7 +124,7 @@ export interface FirestoreDataConverter<
124
124
* @param options - The `SnapshotOptions` from the initial call to `data()`.
125
125
*/
126
126
fromFirestore (
127
- snapshot : QueryDocumentSnapshot < DocumentData , DocumentData > ,
127
+ snapshot : QueryDocumentSnapshot < SerializedModelT , SerializedModelT > ,
128
128
options ?: SnapshotOptions
129
129
) : ModelT ;
130
130
}
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export interface FirestoreDataConverter<
92
92
* The `WithFieldValue<ModelT>` type extends `ModelT` to also allow
93
93
* FieldValues such as {@link (deleteField:1)} to be used as property values.
94
94
*/
95
- toFirestore ( modelObject : WithFieldValue < ModelT > ) : SerializedModelT ;
95
+ toFirestore ( modelObject : WithFieldValue < ModelT > ) : WithFieldValue < SerializedModelT > ;
96
96
97
97
/**
98
98
* Called by the Firestore SDK to convert a custom model object of type
@@ -119,7 +119,7 @@ export interface FirestoreDataConverter<
119
119
* metadata.
120
120
*/
121
121
fromFirestore (
122
- snapshot : QueryDocumentSnapshot < DocumentData , DocumentData >
122
+ snapshot : QueryDocumentSnapshot < SerializedModelT , SerializedModelT >
123
123
) : ModelT ;
124
124
}
125
125
You can’t perform that action at this time.
0 commit comments