File tree 4 files changed +26
-12
lines changed 4 files changed +26
-12
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ---
Original file line number Diff line number Diff line change @@ -65,7 +65,10 @@ export function setLogLevel(logLevel: LogLevel): void;
65
65
export interface FirestoreDataConverter < T > {
66
66
toFirestore ( modelObject : T ) : DocumentData ;
67
67
toFirestore ( modelObject : Partial < T > , options : SetOptions ) : DocumentData ;
68
- fromFirestore ( snapshot : QueryDocumentSnapshot < DocumentData > ) : T ;
68
+ fromFirestore (
69
+ snapshot : QueryDocumentSnapshot < DocumentData > ,
70
+ options : SnapshotOptions
71
+ ) : T ;
69
72
}
70
73
71
74
export class FirebaseFirestore {
@@ -219,10 +222,13 @@ export class WriteBatch {
219
222
commit ( ) : Promise < void > ;
220
223
}
221
224
222
- export interface SetOptions {
223
- readonly merge ?: boolean ;
224
- readonly mergeFields ?: Array < string | FieldPath > ;
225
- }
225
+ export type SetOptions =
226
+ | {
227
+ readonly merge ?: boolean ;
228
+ }
229
+ | {
230
+ readonly mergeFields ?: Array < string | FieldPath > ;
231
+ } ;
226
232
227
233
export class DocumentReference < T = DocumentData > {
228
234
private constructor ( ) ;
@@ -249,7 +255,7 @@ export class DocumentSnapshot<T = DocumentData> {
249
255
export class QueryDocumentSnapshot < T = DocumentData > extends DocumentSnapshot <
250
256
T
251
257
> {
252
- data ( ) : T ;
258
+ data ( options ?: SnapshotOptions ) : T ;
253
259
}
254
260
255
261
export type OrderByDirection = 'desc' | 'asc' ;
Original file line number Diff line number Diff line change @@ -183,10 +183,13 @@ export class WriteBatch {
183
183
commit ( ) : Promise < void > ;
184
184
}
185
185
186
- export interface SetOptions {
187
- readonly merge ?: boolean ;
188
- readonly mergeFields ?: Array < string | FieldPath > ;
189
- }
186
+ export type SetOptions =
187
+ | {
188
+ readonly merge ?: boolean ;
189
+ }
190
+ | {
191
+ readonly mergeFields ?: Array < string | FieldPath > ;
192
+ } ;
190
193
191
194
export class DocumentReference < T = DocumentData > {
192
195
private constructor ( ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ import { DocumentKey } from '../../../src/model/document_key';
25
25
import { Document } from '../../../src/model/document' ;
26
26
import { UserDataWriter } from '../../../src/api/user_data_writer' ;
27
27
import { FieldPath as InternalFieldPath } from '../../../src/model/path' ;
28
- import { fieldPathFromDotSeparatedString } from '../../../src/api/user_data_reader' ;
28
+ import {
29
+ fieldPathFromDotSeparatedString ,
30
+ UntypedFirestoreDataConverter
31
+ } from '../../../src/api/user_data_reader' ;
29
32
import { arrayEquals } from '../../../src/util/misc' ;
30
33
31
34
export class DocumentSnapshot < T = firestore . DocumentData >
@@ -39,7 +42,7 @@ export class DocumentSnapshot<T = firestore.DocumentData>
39
42
public _firestore : Firestore ,
40
43
public _key : DocumentKey ,
41
44
public _document : Document | null ,
42
- public _converter : firestore . FirestoreDataConverter < T > | null
45
+ public _converter : UntypedFirestoreDataConverter < T > | null
43
46
) { }
44
47
45
48
get id ( ) : string {
You can’t perform that action at this time.
0 commit comments