@@ -68,9 +68,11 @@ export function average(field: string | FieldPath): AggregateField<number | null
68
68
// @public
69
69
export class Bytes {
70
70
static fromBase64String(base64 : string ): Bytes ;
71
+ static fromJSON(json : object ): Bytes ;
71
72
static fromUint8Array(array : Uint8Array ): Bytes ;
72
73
isEqual(other : Bytes ): boolean ;
73
74
toBase64(): string ;
75
+ toJSON(): object ;
74
76
toString(): string ;
75
77
toUint8Array(): Uint8Array ;
76
78
}
@@ -161,9 +163,12 @@ export function documentId(): FieldPath;
161
163
export class DocumentReference <AppModelType = DocumentData , DbModelType extends DocumentData = DocumentData > {
162
164
readonly converter: FirestoreDataConverter <AppModelType , DbModelType > | null ;
163
165
readonly firestore: Firestore ;
166
+ static fromJSON(firestore : Firestore , json : object ): DocumentReference ;
167
+ static fromJSON<NewAppModelType = DocumentData , NewDbModelType extends DocumentData = DocumentData >(firestore : Firestore , json : object , converter : FirestoreDataConverter <NewAppModelType , NewDbModelType >): DocumentReference <NewAppModelType , NewDbModelType >;
164
168
get id(): string ;
165
169
get parent(): CollectionReference <AppModelType , DbModelType >;
166
170
get path(): string ;
171
+ toJSON(): object ;
167
172
readonly type = " document" ;
168
173
withConverter<NewAppModelType , NewDbModelType extends DocumentData = DocumentData >(converter : FirestoreDataConverter <NewAppModelType , NewDbModelType >): DocumentReference <NewAppModelType , NewDbModelType >;
169
174
withConverter(converter : null ): DocumentReference <DocumentData , DocumentData >;
@@ -178,8 +183,15 @@ export class DocumentSnapshot<AppModelType = DocumentData, DbModelType extends D
178
183
get id(): string ;
179
184
readonly metadata: SnapshotMetadata ;
180
185
get ref(): DocumentReference <AppModelType , DbModelType >;
186
+ toJSON(): object ;
181
187
}
182
188
189
+ // @public
190
+ export function documentSnapshotFromJSON(db : Firestore , json : object ): DocumentSnapshot ;
191
+
192
+ // @public
193
+ export function documentSnapshotFromJSON<AppModelType , DbModelType extends DocumentData = DocumentData >(db : Firestore , json : object , converter : FirestoreDataConverter <AppModelType , DbModelType >): DocumentSnapshot <AppModelType , DbModelType >;
194
+
183
195
export { EmulatorMockTokenOptions }
184
196
185
197
// @public @deprecated
@@ -264,12 +276,14 @@ export interface FirestoreSettings {
264
276
// @public
265
277
export class GeoPoint {
266
278
constructor (latitude : number , longitude : number );
279
+ static fromJSON(json : object ): GeoPoint ;
267
280
isEqual(other : GeoPoint ): boolean ;
268
281
get latitude(): number ;
269
282
get longitude(): number ;
270
283
toJSON(): {
271
284
latitude: number ;
272
285
longitude: number ;
286
+ type: string ;
273
287
};
274
288
}
275
289
@@ -459,6 +473,46 @@ export function onSnapshot<AppModelType, DbModelType extends DocumentData>(query
459
473
// @public
460
474
export function onSnapshot<AppModelType , DbModelType extends DocumentData >(query : Query <AppModelType , DbModelType >, options : SnapshotListenOptions , onNext : (snapshot : QuerySnapshot <AppModelType , DbModelType >) => void , onError ? : (error : FirestoreError ) => void , onCompletion ? : () => void ): Unsubscribe ;
461
475
476
+ // @public
477
+ export function onSnapshotResume<AppModelType , DbModelType extends DocumentData >(firestore : Firestore , snapshotJson : object , onNext : (snapshot : QuerySnapshot <AppModelType , DbModelType >) => void , onError ? : (error : FirestoreError ) => void , onCompletion ? : () => void , converter ? : FirestoreDataConverter <DbModelType >): Unsubscribe ;
478
+
479
+ // @public
480
+ export function onSnapshotResume<AppModelType , DbModelType extends DocumentData >(firestore : Firestore , snapshotJson : object , onNext : (snapshot : DocumentSnapshot <AppModelType , DbModelType >) => void , onError ? : (error : FirestoreError ) => void , onCompletion ? : () => void , converter ? : FirestoreDataConverter <DbModelType >): Unsubscribe ;
481
+
482
+ // @public
483
+ export function onSnapshotResume<AppModelType , DbModelType extends DocumentData >(firestore : Firestore , snapshotJson : object , options : SnapshotListenOptions , onNext : (snapshot : QuerySnapshot <AppModelType , DbModelType >) => void , onError ? : (error : FirestoreError ) => void , onCompletion ? : () => void , converter ? : FirestoreDataConverter <DbModelType >): Unsubscribe ;
484
+
485
+ // @public
486
+ export function onSnapshotResume<AppModelType , DbModelType extends DocumentData >(firestore : Firestore , snapshotJson : object , options : SnapshotListenOptions , onNext : (snapshot : DocumentSnapshot <AppModelType , DbModelType >) => void , onError ? : (error : FirestoreError ) => void , onCompletion ? : () => void , converter ? : FirestoreDataConverter <DbModelType >): Unsubscribe ;
487
+
488
+ // @public
489
+ export function onSnapshotResume<AppModelType , DbModelType extends DocumentData >(firestore : Firestore , snapshotJson : object , observer : {
490
+ next: (snapshot : QuerySnapshot <AppModelType , DbModelType >) => void ;
491
+ error? : (error : FirestoreError ) => void ;
492
+ complete? : () => void ;
493
+ }, converter ? : FirestoreDataConverter <DbModelType >): Unsubscribe ;
494
+
495
+ // @public
496
+ export function onSnapshotResume<AppModelType , DbModelType extends DocumentData >(firestore : Firestore , snapshotJson : object , observer : {
497
+ next: (snapshot : DocumentSnapshot <AppModelType , DbModelType >) => void ;
498
+ error? : (error : FirestoreError ) => void ;
499
+ complete? : () => void ;
500
+ }, converter ? : FirestoreDataConverter <DbModelType >): Unsubscribe ;
501
+
502
+ // @public
503
+ export function onSnapshotResume<AppModelType , DbModelType extends DocumentData >(firestore : Firestore , snapshotJson : object , options : SnapshotListenOptions , observer : {
504
+ next: (snapshot : QuerySnapshot <AppModelType , DbModelType >) => void ;
505
+ error? : (error : FirestoreError ) => void ;
506
+ complete? : () => void ;
507
+ }, converter ? : FirestoreDataConverter <DbModelType >): Unsubscribe ;
508
+
509
+ // @public
510
+ export function onSnapshotResume<AppModelType , DbModelType extends DocumentData >(firestore : Firestore , snapshotJson : object , options : SnapshotListenOptions , observer : {
511
+ next: (snapshot : DocumentSnapshot <AppModelType , DbModelType >) => void ;
512
+ error? : (error : FirestoreError ) => void ;
513
+ complete? : () => void ;
514
+ }, converter ? : FirestoreDataConverter <DbModelType >): Unsubscribe ;
515
+
462
516
// @public
463
517
export function onSnapshotsInSync(firestore : Firestore , observer : {
464
518
next? : (value : void ) => void ;
@@ -610,8 +664,15 @@ export class QuerySnapshot<AppModelType = DocumentData, DbModelType extends Docu
610
664
readonly metadata: SnapshotMetadata ;
611
665
readonly query: Query <AppModelType , DbModelType >;
612
666
get size(): number ;
667
+ toJSON(): object ;
613
668
}
614
669
670
+ // @public
671
+ export function querySnapshotFromJSON(db : Firestore , json : object ): QuerySnapshot ;
672
+
673
+ // @public
674
+ export function querySnapshotFromJSON<AppModelType , DbModelType extends DocumentData = DocumentData >(db : Firestore , json : object , converter : FirestoreDataConverter <AppModelType , DbModelType >): QuerySnapshot <AppModelType , DbModelType >;
675
+
615
676
// @public
616
677
export class QueryStartAtConstraint extends QueryConstraint {
617
678
readonly type: ' startAt' | ' startAfter' ;
@@ -696,6 +757,7 @@ export class Timestamp {
696
757
seconds : number ,
697
758
nanoseconds : number );
698
759
static fromDate(date : Date ): Timestamp ;
760
+ static fromJSON(json : object ): Timestamp ;
699
761
static fromMillis(milliseconds : number ): Timestamp ;
700
762
isEqual(other : Timestamp ): boolean ;
701
763
readonly nanoseconds: number ;
@@ -705,6 +767,7 @@ export class Timestamp {
705
767
toJSON(): {
706
768
seconds: number ;
707
769
nanoseconds: number ;
770
+ type: string ;
708
771
};
709
772
toMillis(): number ;
710
773
toString(): string ;
@@ -751,8 +814,10 @@ export function vector(values?: number[]): VectorValue;
751
814
// @public
752
815
export class VectorValue {
753
816
/* Excluded from this release type: __constructor */
817
+ static fromJSON(json : object ): VectorValue ;
754
818
isEqual(other : VectorValue ): boolean ;
755
819
toArray(): number [];
820
+ toJSON(): object ;
756
821
}
757
822
758
823
// @public
0 commit comments