Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Chen committed Jan 19, 2021
1 parent 2f63105 commit 71c14c3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
13 changes: 10 additions & 3 deletions packages/firebase/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8313,6 +8313,13 @@ declare namespace firebase.firestore {
*/
namedQuery(name: string): Promise<Query<DocumentData> | null>;

/**
* Returns a JSON-serializable representation of this object.
*
* @return A JSON-serializable representation of this object.
*/
toJSON(): Object;

/**
* @hidden
*/
Expand Down Expand Up @@ -9172,9 +9179,9 @@ declare namespace firebase.firestore {
* `exists` property will always be true and `data()` will never return
* 'undefined'.
*/
export class QueryDocumentSnapshot<T = DocumentData> extends DocumentSnapshot<
T
> {
export class QueryDocumentSnapshot<
T = DocumentData
> extends DocumentSnapshot<T> {
private constructor();

/**
Expand Down
8 changes: 5 additions & 3 deletions packages/firestore-types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export class FirebaseFirestore {

namedQuery(name: string): Promise<Query<DocumentData> | null>;

toJSON(): object;

INTERNAL: { delete: () => Promise<void> };
}

Expand Down Expand Up @@ -315,9 +317,9 @@ export class DocumentSnapshot<T = DocumentData> {
isEqual(other: DocumentSnapshot<T>): boolean;
}

export class QueryDocumentSnapshot<T = DocumentData> extends DocumentSnapshot<
T
> {
export class QueryDocumentSnapshot<
T = DocumentData
> extends DocumentSnapshot<T> {
private constructor();

data(options?: SnapshotOptions): T;
Expand Down
1 change: 1 addition & 0 deletions packages/firestore/src/lite/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class FirebaseFirestore implements FirestoreService {

toJSON(): object {
return {
app: this.app.name,
databaseId: this._databaseId,
settings: this._settings
};
Expand Down
3 changes: 0 additions & 3 deletions packages/firestore/test/unit/api/database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ describe('DocumentSnapshot', () => {

it('JSON.stringify() does not throw', () => {
JSON.stringify(documentSnapshot('foo/bar', { a: 1 }, true));
JSON.stringify(documentSnapshot('foo/bar', { a: 1 }, false));
JSON.stringify(documentSnapshot('foo/bar', null, true));
JSON.stringify(documentSnapshot('foo/bar', null, false));
});
});

Expand Down

0 comments on commit 71c14c3

Please sign in to comment.