Skip to content

Commit f88748f

Browse files
committed
onNext overloads and toJSON type
1 parent 10bf743 commit f88748f

File tree

3 files changed

+237
-109
lines changed

3 files changed

+237
-109
lines changed

common/api-review/firestore.api.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ export class DocumentSnapshot<AppModelType = DocumentData, DbModelType extends D
179179
readonly metadata: SnapshotMetadata;
180180
get ref(): DocumentReference<AppModelType, DbModelType>;
181181
// (undocumented)
182-
toJSON(): object;
182+
toJSON(): {
183+
bundle: string;
184+
bundleSource: string;
185+
bundleName: string;
186+
};
183187
}
184188

185189
export { EmulatorMockTokenOptions }
@@ -468,13 +472,27 @@ export function onSnapshot<AppModelType, DbModelType extends DocumentData>(fires
468472
bundleSource: string;
469473
}, onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
470474

475+
// @public
476+
export function onSnapshot<AppModelType, DbModelType extends DocumentData>(firestore: Firestore, json: {
477+
bundle: string;
478+
bundleName: string;
479+
bundleSource: string;
480+
}, onNext: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
481+
471482
// @public
472483
export function onSnapshot<AppModelType, DbModelType extends DocumentData>(firestore: Firestore, json: {
473484
bundle: string;
474485
bundleName: string;
475486
bundleSource: string;
476487
}, options: SnapshotListenOptions, onNext: (snapshot: QuerySnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
477488

489+
// @public
490+
export function onSnapshot<AppModelType, DbModelType extends DocumentData>(firestore: Firestore, json: {
491+
bundle: string;
492+
bundleName: string;
493+
bundleSource: string;
494+
}, options: SnapshotListenOptions, onNext: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void, onError?: (error: FirestoreError) => void, onCompletion?: () => void, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
495+
478496
// @public
479497
export function onSnapshot<AppModelType, DbModelType extends DocumentData>(firestore: Firestore, json: {
480498
bundle: string;
@@ -486,6 +504,17 @@ export function onSnapshot<AppModelType, DbModelType extends DocumentData>(fires
486504
complete?: () => void;
487505
}, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
488506

507+
// @public
508+
export function onSnapshot<AppModelType, DbModelType extends DocumentData>(firestore: Firestore, json: {
509+
bundle: string;
510+
bundleName: string;
511+
bundleSource: string;
512+
}, observer: {
513+
next: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;
514+
error?: (error: FirestoreError) => void;
515+
complete?: () => void;
516+
}, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
517+
489518
// @public
490519
export function onSnapshot<AppModelType, DbModelType extends DocumentData>(firestore: Firestore, json: {
491520
bundle: string;
@@ -497,6 +526,17 @@ export function onSnapshot<AppModelType, DbModelType extends DocumentData>(fires
497526
complete?: () => void;
498527
}, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
499528

529+
// @public
530+
export function onSnapshot<AppModelType, DbModelType extends DocumentData>(firestore: Firestore, json: {
531+
bundle: string;
532+
bundleName: string;
533+
bundleSource: string;
534+
}, options: SnapshotListenOptions, observer: {
535+
next: (snapshot: DocumentSnapshot<AppModelType, DbModelType>) => void;
536+
error?: (error: FirestoreError) => void;
537+
complete?: () => void;
538+
}, converter?: FirestoreDataConverter<DbModelType>): Unsubscribe;
539+
500540
// @public
501541
export function onSnapshotsInSync(firestore: Firestore, observer: {
502542
next?: (value: void) => void;
@@ -649,7 +689,11 @@ export class QuerySnapshot<AppModelType = DocumentData, DbModelType extends Docu
649689
readonly query: Query<AppModelType, DbModelType>;
650690
get size(): number;
651691
// (undocumented)
652-
toJSON(): object;
692+
toJSON(): {
693+
bundle: string;
694+
bundleSource: string;
695+
bundleName: string;
696+
};
653697
}
654698

655699
// @public

0 commit comments

Comments
 (0)