Skip to content

Commit 711dbeb

Browse files
committed
Merge remote-tracking branch 'origin/master' into BloomFilterTestRunsWithMemoryLruGc [skip actions]
2 parents 2a73dee + f2fb56f commit 711dbeb

File tree

61 files changed

+3225
-2305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3225
-2305
lines changed

.changeset/rude-terms-remain.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/firestore': major
3+
'firebase': major
4+
---
5+
6+
Fixed updateDoc() typing issue by adding a 2nd type parameter to FirestoreDataConverter

common/api-review/firestore-lite.api.md

Lines changed: 68 additions & 68 deletions
Large diffs are not rendered by default.

common/api-review/firestore.api.md

Lines changed: 87 additions & 87 deletions
Large diffs are not rendered by default.

docs-devsite/firestore_.aggregatequerysnapshot.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ The results of executing an aggregation query.
1515
<b>Signature:</b>
1616

1717
```typescript
18-
export declare class AggregateQuerySnapshot<T extends AggregateSpec>
18+
export declare class AggregateQuerySnapshot<AggregateSpecType extends AggregateSpec, AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>
1919
```
2020

2121
## Properties
2222

2323
| Property | Modifiers | Type | Description |
2424
| --- | --- | --- | --- |
25-
| [query](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshotquery) | | [Query](./firestore_.query.md#query_class)<!-- -->&lt;unknown&gt; | The underlying query over which the aggregations recorded in this <code>AggregateQuerySnapshot</code> were performed. |
25+
| [query](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshotquery) | | [Query](./firestore_.query.md#query_class)<!-- -->&lt;AppModelType, DbModelType&gt; | The underlying query over which the aggregations recorded in this <code>AggregateQuerySnapshot</code> were performed. |
2626
| [type](./firestore_.aggregatequerysnapshot.md#aggregatequerysnapshottype) | | (not declared) | A type string to uniquely identify instances of this class. |
2727

2828
## Methods
@@ -38,7 +38,7 @@ The underlying query over which the aggregations recorded in this `AggregateQuer
3838
<b>Signature:</b>
3939

4040
```typescript
41-
readonly query: Query<unknown>;
41+
readonly query: Query<AppModelType, DbModelType>;
4242
```
4343

4444
## AggregateQuerySnapshot.type
@@ -60,11 +60,11 @@ The keys of the returned object will be the same as those of the `AggregateSpec`
6060
<b>Signature:</b>
6161

6262
```typescript
63-
data(): AggregateSpecData<T>;
63+
data(): AggregateSpecData<AggregateSpecType>;
6464
```
6565
<b>Returns:</b>
6666

67-
[AggregateSpecData](./firestore_.md#aggregatespecdata)<!-- -->&lt;T&gt;
67+
[AggregateSpecData](./firestore_.md#aggregatespecdata)<!-- -->&lt;AggregateSpecType&gt;
6868

6969
The results of the aggregations performed over the underlying query.
7070

docs-devsite/firestore_.collectionreference.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ A `CollectionReference` object can be used for adding documents, getting documen
1515
<b>Signature:</b>
1616

1717
```typescript
18-
export declare class CollectionReference<T = DocumentData> extends Query<T>
18+
export declare class CollectionReference<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData> extends Query<AppModelType, DbModelType>
1919
```
20-
<b>Extends:</b> [Query](./firestore_.query.md#query_class)<!-- -->&lt;T&gt;
20+
<b>Extends:</b> [Query](./firestore_.query.md#query_class)<!-- -->&lt;AppModelType, DbModelType&gt;
2121
2222
## Properties
2323
2424
| Property | Modifiers | Type | Description |
2525
| --- | --- | --- | --- |
2626
| [id](./firestore_.collectionreference.md#collectionreferenceid) | | string | The collection's identifier. |
27-
| [parent](./firestore_.collectionreference.md#collectionreferenceparent) | | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<!-- -->&lt;[DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->&gt; \| null | A reference to the containing <code>DocumentReference</code> if this is a subcollection. If this isn't a subcollection, the reference is null. |
27+
| [parent](./firestore_.collectionreference.md#collectionreferenceparent) | | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<!-- -->&lt;[DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->, [DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->&gt; \| null | A reference to the containing <code>DocumentReference</code> if this is a subcollection. If this isn't a subcollection, the reference is null. |
2828
| [path](./firestore_.collectionreference.md#collectionreferencepath) | | string | A string representing the path of the referenced collection (relative to the root of the database). |
2929
| [type](./firestore_.collectionreference.md#collectionreferencetype) | | (not declared) | The type of this Firestore reference. |
3030
3131
## Methods
3232
3333
| Method | Modifiers | Description |
3434
| --- | --- | --- |
35-
| [withConverter(converter)](./firestore_.collectionreference.md#collectionreferencewithconverter) | | Applies a custom data converter to this <code>CollectionReference</code>, allowing you to use your own custom model objects with Firestore. When you call [addDoc()](./firestore_.md#adddoc) with the returned <code>CollectionReference</code> instance, the provided converter will convert between Firestore data and your custom type <code>U</code>. |
35+
| [withConverter(converter)](./firestore_.collectionreference.md#collectionreferencewithconverter) | | Applies a custom data converter to this <code>CollectionReference</code>, allowing you to use your own custom model objects with Firestore. When you call [addDoc()](./firestore_.md#adddoc) with the returned <code>CollectionReference</code> instance, the provided converter will convert between Firestore data of type <code>NewDbModelType</code> and your custom type <code>NewAppModelType</code>. |
3636
| [withConverter(converter)](./firestore_.collectionreference.md#collectionreferencewithconverter) | | Removes the current converter. |
3737
3838
## CollectionReference.id
@@ -52,7 +52,7 @@ A reference to the containing `DocumentReference` if this is a subcollection. If
5252
<b>Signature:</b>
5353
5454
```typescript
55-
get parent(): DocumentReference<DocumentData> | null;
55+
get parent(): DocumentReference<DocumentData, DocumentData> | null;
5656
```
5757
5858
## CollectionReference.path
@@ -77,25 +77,25 @@ readonly type = "collection";
7777
7878
## CollectionReference.withConverter()
7979
80-
Applies a custom data converter to this `CollectionReference`<!-- -->, allowing you to use your own custom model objects with Firestore. When you call [addDoc()](./firestore_.md#adddoc) with the returned `CollectionReference` instance, the provided converter will convert between Firestore data and your custom type `U`<!-- -->.
80+
Applies a custom data converter to this `CollectionReference`<!-- -->, allowing you to use your own custom model objects with Firestore. When you call [addDoc()](./firestore_.md#adddoc) with the returned `CollectionReference` instance, the provided converter will convert between Firestore data of type `NewDbModelType` and your custom type `NewAppModelType`<!-- -->.
8181
8282
<b>Signature:</b>
8383
8484
```typescript
85-
withConverter<U>(converter: FirestoreDataConverter<U>): CollectionReference<U>;
85+
withConverter<NewAppModelType, NewDbModelType extends DocumentData>(converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>): CollectionReference<NewAppModelType, NewDbModelType>;
8686
```
8787
8888
### Parameters
8989
9090
| Parameter | Type | Description |
9191
| --- | --- | --- |
92-
| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<!-- -->&lt;U&gt; | Converts objects to and from Firestore. |
92+
| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<!-- -->&lt;NewAppModelType, NewDbModelType&gt; | Converts objects to and from Firestore. |
9393
9494
<b>Returns:</b>
9595
96-
[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<!-- -->&lt;U&gt;
96+
[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<!-- -->&lt;NewAppModelType, NewDbModelType&gt;
9797
98-
A `CollectionReference<U>` that uses the provided converter.
98+
A `CollectionReference` that uses the provided converter.
9999
100100
## CollectionReference.withConverter()
101101
@@ -104,7 +104,7 @@ Removes the current converter.
104104
<b>Signature:</b>
105105
106106
```typescript
107-
withConverter(converter: null): CollectionReference<DocumentData>;
107+
withConverter(converter: null): CollectionReference<DocumentData, DocumentData>;
108108
```
109109
110110
### Parameters
@@ -115,7 +115,7 @@ withConverter(converter: null): CollectionReference<DocumentData>;
115115
116116
<b>Returns:</b>
117117
118-
[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<!-- -->&lt;[DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->&gt;
118+
[CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<!-- -->&lt;[DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->, [DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->&gt;
119119
120-
A `CollectionReference<DocumentData>` that does not use a converter.
120+
A `CollectionReference<DocumentData, DocumentData>` that does not use a converter.
121121

docs-devsite/firestore_.documentchange.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ A `DocumentChange` represents a change to the documents matching a query. It con
1515
<b>Signature:</b>
1616

1717
```typescript
18-
export declare interface DocumentChange<T = DocumentData>
18+
export declare interface DocumentChange<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>
1919
```
2020

2121
## Properties
2222

2323
| Property | Type | Description |
2424
| --- | --- | --- |
25-
| [doc](./firestore_.documentchange.md#documentchangedoc) | [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md#querydocumentsnapshot_class)<!-- -->&lt;T&gt; | The document affected by this change. |
25+
| [doc](./firestore_.documentchange.md#documentchangedoc) | [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md#querydocumentsnapshot_class)<!-- -->&lt;AppModelType, DbModelType&gt; | The document affected by this change. |
2626
| [newIndex](./firestore_.documentchange.md#documentchangenewindex) | number | The index of the changed document in the result set immediately after this <code>DocumentChange</code> (i.e. supposing that all prior <code>DocumentChange</code> objects and the current <code>DocumentChange</code> object have been applied). Is -1 for 'removed' events. |
2727
| [oldIndex](./firestore_.documentchange.md#documentchangeoldindex) | number | The index of the changed document in the result set immediately prior to this <code>DocumentChange</code> (i.e. supposing that all prior <code>DocumentChange</code> objects have been applied). Is <code>-1</code> for 'added' events. |
2828
| [type](./firestore_.documentchange.md#documentchangetype) | [DocumentChangeType](./firestore_.md#documentchangetype) | The type of change ('added', 'modified', or 'removed'). |
@@ -34,7 +34,7 @@ The document affected by this change.
3434
<b>Signature:</b>
3535

3636
```typescript
37-
readonly doc: QueryDocumentSnapshot<T>;
37+
readonly doc: QueryDocumentSnapshot<AppModelType, DbModelType>;
3838
```
3939

4040
## DocumentChange.newIndex

docs-devsite/firestore_.documentreference.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ A `DocumentReference` refers to a document location in a Firestore database and
1515
<b>Signature:</b>
1616

1717
```typescript
18-
export declare class DocumentReference<T = DocumentData>
18+
export declare class DocumentReference<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>
1919
```
2020

2121
## Properties
2222

2323
| Property | Modifiers | Type | Description |
2424
| --- | --- | --- | --- |
25-
| [converter](./firestore_.documentreference.md#documentreferenceconverter) | | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<!-- -->&lt;T&gt; \| null | If provided, the <code>FirestoreDataConverter</code> associated with this instance. |
25+
| [converter](./firestore_.documentreference.md#documentreferenceconverter) | | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<!-- -->&lt;AppModelType, DbModelType&gt; \| null | If provided, the <code>FirestoreDataConverter</code> associated with this instance. |
2626
| [firestore](./firestore_.documentreference.md#documentreferencefirestore) | | [Firestore](./firestore_.firestore.md#firestore_class) | The [Firestore](./firestore_.firestore.md#firestore_class) instance the document is in. This is useful for performing transactions, for example. |
2727
| [id](./firestore_.documentreference.md#documentreferenceid) | | string | The document's identifier within its collection. |
28-
| [parent](./firestore_.documentreference.md#documentreferenceparent) | | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<!-- -->&lt;T&gt; | The collection this <code>DocumentReference</code> belongs to. |
28+
| [parent](./firestore_.documentreference.md#documentreferenceparent) | | [CollectionReference](./firestore_.collectionreference.md#collectionreference_class)<!-- -->&lt;AppModelType, DbModelType&gt; | The collection this <code>DocumentReference</code> belongs to. |
2929
| [path](./firestore_.documentreference.md#documentreferencepath) | | string | A string representing the path of the referenced document (relative to the root of the database). |
3030
| [type](./firestore_.documentreference.md#documentreferencetype) | | (not declared) | The type of this Firestore reference. |
3131

3232
## Methods
3333

3434
| Method | Modifiers | Description |
3535
| --- | --- | --- |
36-
| [withConverter(converter)](./firestore_.documentreference.md#documentreferencewithconverter) | | Applies a custom data converter to this <code>DocumentReference</code>, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.md#setdoc)<!-- -->, [getDoc()](./firestore_lite.md#getdoc)<!-- -->, etc. with the returned <code>DocumentReference</code> instance, the provided converter will convert between Firestore data and your custom type <code>U</code>. |
36+
| [withConverter(converter)](./firestore_.documentreference.md#documentreferencewithconverter) | | Applies a custom data converter to this <code>DocumentReference</code>, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.md#setdoc)<!-- -->, [getDoc()](./firestore_lite.md#getdoc)<!-- -->, etc. with the returned <code>DocumentReference</code> instance, the provided converter will convert between Firestore data of type <code>NewDbModelType</code> and your custom type <code>NewAppModelType</code>. |
3737
| [withConverter(converter)](./firestore_.documentreference.md#documentreferencewithconverter) | | Removes the current converter. |
3838

3939
## DocumentReference.converter
@@ -43,7 +43,7 @@ If provided, the `FirestoreDataConverter` associated with this instance.
4343
<b>Signature:</b>
4444

4545
```typescript
46-
readonly converter: FirestoreDataConverter<T> | null;
46+
readonly converter: FirestoreDataConverter<AppModelType, DbModelType> | null;
4747
```
4848

4949
## DocumentReference.firestore
@@ -73,7 +73,7 @@ The collection this `DocumentReference` belongs to.
7373
<b>Signature:</b>
7474

7575
```typescript
76-
get parent(): CollectionReference<T>;
76+
get parent(): CollectionReference<AppModelType, DbModelType>;
7777
```
7878

7979
## DocumentReference.path
@@ -98,25 +98,25 @@ readonly type = "document";
9898

9999
## DocumentReference.withConverter()
100100

101-
Applies a custom data converter to this `DocumentReference`<!-- -->, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.md#setdoc)<!-- -->, [getDoc()](./firestore_lite.md#getdoc)<!-- -->, etc. with the returned `DocumentReference` instance, the provided converter will convert between Firestore data and your custom type `U`<!-- -->.
101+
Applies a custom data converter to this `DocumentReference`<!-- -->, allowing you to use your own custom model objects with Firestore. When you call [setDoc()](./firestore_lite.md#setdoc)<!-- -->, [getDoc()](./firestore_lite.md#getdoc)<!-- -->, etc. with the returned `DocumentReference` instance, the provided converter will convert between Firestore data of type `NewDbModelType` and your custom type `NewAppModelType`<!-- -->.
102102

103103
<b>Signature:</b>
104104

105105
```typescript
106-
withConverter<U>(converter: FirestoreDataConverter<U>): DocumentReference<U>;
106+
withConverter<NewAppModelType, NewDbModelType extends DocumentData>(converter: FirestoreDataConverter<NewAppModelType, NewDbModelType>): DocumentReference<NewAppModelType, NewDbModelType>;
107107
```
108108

109109
### Parameters
110110

111111
| Parameter | Type | Description |
112112
| --- | --- | --- |
113-
| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<!-- -->&lt;U&gt; | Converts objects to and from Firestore. |
113+
| converter | [FirestoreDataConverter](./firestore_.firestoredataconverter.md#firestoredataconverter_interface)<!-- -->&lt;NewAppModelType, NewDbModelType&gt; | Converts objects to and from Firestore. |
114114

115115
<b>Returns:</b>
116116

117-
[DocumentReference](./firestore_.documentreference.md#documentreference_class)<!-- -->&lt;U&gt;
117+
[DocumentReference](./firestore_.documentreference.md#documentreference_class)<!-- -->&lt;NewAppModelType, NewDbModelType&gt;
118118

119-
A `DocumentReference<U>` that uses the provided converter.
119+
A `DocumentReference` that uses the provided converter.
120120

121121
## DocumentReference.withConverter()
122122

@@ -125,7 +125,7 @@ Removes the current converter.
125125
<b>Signature:</b>
126126

127127
```typescript
128-
withConverter(converter: null): DocumentReference<DocumentData>;
128+
withConverter(converter: null): DocumentReference<DocumentData, DocumentData>;
129129
```
130130

131131
### Parameters
@@ -136,7 +136,7 @@ withConverter(converter: null): DocumentReference<DocumentData>;
136136

137137
<b>Returns:</b>
138138

139-
[DocumentReference](./firestore_.documentreference.md#documentreference_class)<!-- -->&lt;[DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->&gt;
139+
[DocumentReference](./firestore_.documentreference.md#documentreference_class)<!-- -->&lt;[DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->, [DocumentData](./firestore_.documentdata.md#documentdata_interface)<!-- -->&gt;
140140

141-
A `DocumentReference<DocumentData>` that does not use a converter.
141+
A `DocumentReference<DocumentData, DocumentData>` that does not use a converter.
142142

docs-devsite/firestore_.documentsnapshot.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For a `DocumentSnapshot` that points to a non-existing document, any data access
1717
<b>Signature:</b>
1818

1919
```typescript
20-
export declare class DocumentSnapshot<T = DocumentData>
20+
export declare class DocumentSnapshot<AppModelType = DocumentData, DbModelType extends DocumentData = DocumentData>
2121
```
2222

2323
## Constructors
@@ -32,7 +32,7 @@ export declare class DocumentSnapshot<T = DocumentData>
3232
| --- | --- | --- | --- |
3333
| [id](./firestore_.documentsnapshot.md#documentsnapshotid) | | string | Property of the <code>DocumentSnapshot</code> that provides the document's ID. |
3434
| [metadata](./firestore_.documentsnapshot.md#documentsnapshotmetadata) | | [SnapshotMetadata](./firestore_.snapshotmetadata.md#snapshotmetadata_class) | Metadata about the <code>DocumentSnapshot</code>, including information about its source and local modifications. |
35-
| [ref](./firestore_.documentsnapshot.md#documentsnapshotref) | | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<!-- -->&lt;T&gt; | The <code>DocumentReference</code> for the document included in the <code>DocumentSnapshot</code>. |
35+
| [ref](./firestore_.documentsnapshot.md#documentsnapshotref) | | [DocumentReference](./firestore_.documentreference.md#documentreference_class)<!-- -->&lt;AppModelType, DbModelType&gt; | The <code>DocumentReference</code> for the document included in the <code>DocumentSnapshot</code>. |
3636

3737
## Methods
3838

@@ -79,7 +79,7 @@ The `DocumentReference` for the document included in the `DocumentSnapshot`<!--
7979
<b>Signature:</b>
8080

8181
```typescript
82-
get ref(): DocumentReference<T>;
82+
get ref(): DocumentReference<AppModelType, DbModelType>;
8383
```
8484

8585
## DocumentSnapshot.data()
@@ -91,7 +91,7 @@ By default, `serverTimestamp()` values that have not yet been set to their final
9191
<b>Signature:</b>
9292

9393
```typescript
94-
data(options?: SnapshotOptions): T | undefined;
94+
data(options?: SnapshotOptions): AppModelType | undefined;
9595
```
9696

9797
### Parameters
@@ -102,7 +102,7 @@ data(options?: SnapshotOptions): T | undefined;
102102

103103
<b>Returns:</b>
104104

105-
T \| undefined
105+
AppModelType \| undefined
106106

107107
An `Object` containing all fields in the document or `undefined` if the document doesn't exist.
108108

@@ -113,11 +113,11 @@ Returns whether or not the data exists. True if the document exists.
113113
<b>Signature:</b>
114114

115115
```typescript
116-
exists(): this is QueryDocumentSnapshot<T>;
116+
exists(): this is QueryDocumentSnapshot<AppModelType, DbModelType>;
117117
```
118118
<b>Returns:</b>
119119

120-
this is [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md#querydocumentsnapshot_class)<!-- -->&lt;T&gt;
120+
this is [QueryDocumentSnapshot](./firestore_.querydocumentsnapshot.md#querydocumentsnapshot_class)<!-- -->&lt;AppModelType, DbModelType&gt;
121121

122122
## DocumentSnapshot.get()
123123

0 commit comments

Comments
 (0)