@firebase/firestore 3.4.3 → 3.4.4-canary.0482aa5b7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/firestore/src/api/database.d.ts +14 -9
- package/dist/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/firestore/src/api/index_configuration.d.ts +117 -0
- package/dist/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/firestore/src/api.d.ts +2 -1
- package/dist/firestore/src/core/database_info.d.ts +1 -0
- package/dist/firestore/src/core/firestore_client.d.ts +2 -0
- package/dist/firestore/src/core/target.d.ts +34 -5
- package/dist/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/firestore/src/model/document.d.ts +7 -0
- package/dist/firestore/src/model/document_key.d.ts +1 -0
- package/dist/firestore/src/model/field_index.d.ts +156 -0
- package/dist/firestore/src/model/values.d.ts +7 -0
- package/dist/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
- package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/firestore/test/util/helpers.d.ts +8 -2
- package/dist/index.d.ts +16 -11
- package/dist/index.esm2017.js +2979 -2671
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +3036 -2815
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +644 -235
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +644 -236
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +2761 -2449
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +303 -25
- package/dist/lite/firestore/src/api/database.d.ts +14 -9
- package/dist/lite/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/firestore/src/api/index_configuration.d.ts +117 -0
- package/dist/lite/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/firestore/src/api.d.ts +2 -1
- package/dist/lite/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -0
- package/dist/lite/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/firestore/src/model/document_key.d.ts +1 -0
- package/dist/lite/firestore/src/model/field_index.d.ts +156 -0
- package/dist/lite/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/lite/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/index.browser.esm2017.js +352 -338
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +334 -326
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.node.cjs.js +53 -34
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +53 -34
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +318 -304
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +11 -2
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +98 -97
- package/dist/lite/packages/firestore/src/api/database.d.ts +14 -9
- package/dist/lite/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/lite/packages/firestore/src/api/index_configuration.d.ts +117 -0
- package/dist/lite/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/lite/packages/firestore/src/api.d.ts +2 -1
- package/dist/lite/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -0
- package/dist/lite/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/lite/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/lite/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/lite/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/lite/packages/firestore/src/model/document_key.d.ts +1 -0
- package/dist/lite/packages/firestore/src/model/field_index.d.ts +156 -0
- package/dist/lite/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/lite/packages/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/lite/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/lite/private.d.ts +9 -2
- package/dist/packages/firestore/dist/index.esm2017.d.ts +214 -191
- package/dist/packages/firestore/src/api/database.d.ts +14 -9
- package/dist/packages/firestore/src/api/{query.d.ts → filter.d.ts} +0 -0
- package/dist/packages/firestore/src/api/index_configuration.d.ts +117 -0
- package/dist/packages/firestore/src/api/snapshot.d.ts +1 -2
- package/dist/packages/firestore/src/api.d.ts +2 -1
- package/dist/packages/firestore/src/core/database_info.d.ts +1 -0
- package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -0
- package/dist/packages/firestore/src/core/target.d.ts +34 -5
- package/dist/packages/firestore/src/lite-api/query.d.ts +2 -2
- package/dist/packages/firestore/src/local/index_manager.d.ts +52 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +121 -7
- package/dist/packages/firestore/src/local/local_serializer.d.ts +1 -1
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +11 -0
- package/dist/packages/firestore/src/local/remote_document_change_buffer.d.ts +3 -12
- package/dist/packages/firestore/src/model/document.d.ts +7 -0
- package/dist/packages/firestore/src/model/document_key.d.ts +1 -0
- package/dist/packages/firestore/src/model/field_index.d.ts +156 -0
- package/dist/packages/firestore/src/model/values.d.ts +7 -0
- package/dist/packages/firestore/test/integration/api/index_configuration.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +1 -1
- package/dist/packages/firestore/test/unit/model/field_index.test.d.ts +17 -0
- package/dist/packages/firestore/test/unit/model/target.test.d.ts +17 -0
- package/dist/packages/firestore/test/util/helpers.d.ts +8 -2
- package/dist/private.d.ts +205 -25
- package/package.json +10 -10
|
@@ -30,6 +30,11 @@ export interface Document {
|
|
|
30
30
|
* document was guaranteed to not exist.
|
|
31
31
|
*/
|
|
32
32
|
readonly version: SnapshotVersion;
|
|
33
|
+
/**
|
|
34
|
+
* The timestamp at which this document was read from the remote server. Uses
|
|
35
|
+
* `SnapshotVersion.min()` for documents created by the user.
|
|
36
|
+
*/
|
|
37
|
+
readonly readTime: SnapshotVersion;
|
|
33
38
|
/** The underlying data of this document or an empty value if no data exists. */
|
|
34
39
|
readonly data: ObjectValue;
|
|
35
40
|
/** Returns whether local mutations were applied via the mutation queue. */
|
|
@@ -79,6 +84,7 @@ export declare class MutableDocument implements Document {
|
|
|
79
84
|
readonly key: DocumentKey;
|
|
80
85
|
private documentType;
|
|
81
86
|
version: SnapshotVersion;
|
|
87
|
+
readTime: SnapshotVersion;
|
|
82
88
|
data: ObjectValue;
|
|
83
89
|
private documentState;
|
|
84
90
|
private constructor();
|
|
@@ -118,6 +124,7 @@ export declare class MutableDocument implements Document {
|
|
|
118
124
|
convertToUnknownDocument(version: SnapshotVersion): MutableDocument;
|
|
119
125
|
setHasCommittedMutations(): MutableDocument;
|
|
120
126
|
setHasLocalMutations(): MutableDocument;
|
|
127
|
+
setReadTime(readTime: SnapshotVersion): MutableDocument;
|
|
121
128
|
get hasLocalMutations(): boolean;
|
|
122
129
|
get hasCommittedMutations(): boolean;
|
|
123
130
|
get hasPendingWrites(): boolean;
|
|
@@ -23,6 +23,7 @@ export declare class DocumentKey {
|
|
|
23
23
|
constructor(path: ResourcePath);
|
|
24
24
|
static fromPath(path: string): DocumentKey;
|
|
25
25
|
static fromName(name: string): DocumentKey;
|
|
26
|
+
static empty(): DocumentKey;
|
|
26
27
|
/** Returns true if the document is in the specified collectionId. */
|
|
27
28
|
hasCollectionId(collectionId: string): boolean;
|
|
28
29
|
isEqual(other: DocumentKey | null): boolean;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { SnapshotVersion } from '../core/snapshot_version';
|
|
18
|
+
import { Document } from './document';
|
|
19
|
+
import { DocumentKey } from './document_key';
|
|
20
|
+
import { FieldPath } from './path';
|
|
21
|
+
/**
|
|
22
|
+
* The initial sequence number for each index. Gets updated during index
|
|
23
|
+
* backfill.
|
|
24
|
+
*/
|
|
25
|
+
export declare const INITIAL_SEQUENCE_NUMBER = 0;
|
|
26
|
+
/**
|
|
27
|
+
* An index definition for field indexes in Firestore.
|
|
28
|
+
*
|
|
29
|
+
* Every index is associated with a collection. The definition contains a list
|
|
30
|
+
* of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or
|
|
31
|
+
* `CONTAINS` for ArrayContains/ArrayContainsAny queries).
|
|
32
|
+
*
|
|
33
|
+
* Unlike the backend, the SDK does not differentiate between collection or
|
|
34
|
+
* collection group-scoped indices. Every index can be used for both single
|
|
35
|
+
* collection and collection group queries.
|
|
36
|
+
*/
|
|
37
|
+
export declare class FieldIndex {
|
|
38
|
+
/**
|
|
39
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
40
|
+
* has not yet been persisted).
|
|
41
|
+
*/
|
|
42
|
+
readonly indexId: number;
|
|
43
|
+
/** The collection ID this index applies to. */
|
|
44
|
+
readonly collectionGroup: string;
|
|
45
|
+
/** The field segments for this index. */
|
|
46
|
+
readonly segments: IndexSegment[];
|
|
47
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
48
|
+
readonly indexState: IndexState;
|
|
49
|
+
/** An ID for an index that has not yet been added to persistence. */
|
|
50
|
+
static UNKNOWN_ID: number;
|
|
51
|
+
constructor(
|
|
52
|
+
/**
|
|
53
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
54
|
+
* has not yet been persisted).
|
|
55
|
+
*/
|
|
56
|
+
indexId: number,
|
|
57
|
+
/** The collection ID this index applies to. */
|
|
58
|
+
collectionGroup: string,
|
|
59
|
+
/** The field segments for this index. */
|
|
60
|
+
segments: IndexSegment[],
|
|
61
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
62
|
+
indexState: IndexState);
|
|
63
|
+
}
|
|
64
|
+
/** Returns the ArrayContains/ArrayContainsAny segment for this index. */
|
|
65
|
+
export declare function fieldIndexGetArraySegment(fieldIndex: FieldIndex): IndexSegment | undefined;
|
|
66
|
+
/** Returns all directional (ascending/descending) segments for this index. */
|
|
67
|
+
export declare function fieldIndexGetDirectionalSegments(fieldIndex: FieldIndex): IndexSegment[];
|
|
68
|
+
/**
|
|
69
|
+
* Compares indexes by collection group and segments. Ignores update time and
|
|
70
|
+
* index ID.
|
|
71
|
+
*/
|
|
72
|
+
export declare function fieldIndexSemanticComparator(left: FieldIndex, right: FieldIndex): number;
|
|
73
|
+
/** The type of the index, e.g. for which type of query it can be used. */
|
|
74
|
+
export declare const enum IndexKind {
|
|
75
|
+
/**
|
|
76
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
77
|
+
*/
|
|
78
|
+
ASCENDING = 0,
|
|
79
|
+
/**
|
|
80
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
81
|
+
*/
|
|
82
|
+
DESCENDING = 1,
|
|
83
|
+
/** Contains index. Can be used for ArrayContains and ArrayContainsAny. */
|
|
84
|
+
CONTAINS = 2
|
|
85
|
+
}
|
|
86
|
+
/** An index component consisting of field path and index type. */
|
|
87
|
+
export declare class IndexSegment {
|
|
88
|
+
/** The field path of the component. */
|
|
89
|
+
readonly fieldPath: FieldPath;
|
|
90
|
+
/** The fields sorting order. */
|
|
91
|
+
readonly kind: IndexKind;
|
|
92
|
+
constructor(
|
|
93
|
+
/** The field path of the component. */
|
|
94
|
+
fieldPath: FieldPath,
|
|
95
|
+
/** The fields sorting order. */
|
|
96
|
+
kind: IndexKind);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Stores the "high water mark" that indicates how updated the Index is for the
|
|
100
|
+
* current user.
|
|
101
|
+
*/
|
|
102
|
+
export declare class IndexState {
|
|
103
|
+
/**
|
|
104
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
105
|
+
*/
|
|
106
|
+
readonly sequenceNumber: number;
|
|
107
|
+
/** The the latest indexed read time, document and batch id. */
|
|
108
|
+
readonly offset: IndexOffset;
|
|
109
|
+
constructor(
|
|
110
|
+
/**
|
|
111
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
112
|
+
*/
|
|
113
|
+
sequenceNumber: number,
|
|
114
|
+
/** The the latest indexed read time, document and batch id. */
|
|
115
|
+
offset: IndexOffset);
|
|
116
|
+
/** The state of an index that has not yet been backfilled. */
|
|
117
|
+
static empty(): IndexState;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Creates an offset that matches all documents with a read time higher than
|
|
121
|
+
* `readTime`.
|
|
122
|
+
*/
|
|
123
|
+
export declare function newIndexOffsetSuccessorFromReadTime(readTime: SnapshotVersion, largestBatchId: number): IndexOffset;
|
|
124
|
+
/** Creates a new offset based on the provided document. */
|
|
125
|
+
export declare function newIndexOffsetFromDocument(document: Document): IndexOffset;
|
|
126
|
+
/**
|
|
127
|
+
* Stores the latest read time, document and batch ID that were processed for an
|
|
128
|
+
* index.
|
|
129
|
+
*/
|
|
130
|
+
export declare class IndexOffset {
|
|
131
|
+
/**
|
|
132
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
133
|
+
* field index.
|
|
134
|
+
*/
|
|
135
|
+
readonly readTime: SnapshotVersion;
|
|
136
|
+
/**
|
|
137
|
+
* The key of the last document that was indexed for this query. Use
|
|
138
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
139
|
+
*/
|
|
140
|
+
readonly documentKey: DocumentKey;
|
|
141
|
+
readonly largestBatchId: number;
|
|
142
|
+
constructor(
|
|
143
|
+
/**
|
|
144
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
145
|
+
* field index.
|
|
146
|
+
*/
|
|
147
|
+
readTime: SnapshotVersion,
|
|
148
|
+
/**
|
|
149
|
+
* The key of the last document that was indexed for this query. Use
|
|
150
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
151
|
+
*/
|
|
152
|
+
documentKey: DocumentKey, largestBatchId: number);
|
|
153
|
+
/** The state of an index that has not yet been backfilled. */
|
|
154
|
+
static min(): IndexOffset;
|
|
155
|
+
}
|
|
156
|
+
export declare function indexOffsetComparator(left: IndexOffset, right: IndexOffset): number;
|
|
@@ -19,6 +19,7 @@ import { ArrayValue, MapValue, Value } from '../protos/firestore_proto_api';
|
|
|
19
19
|
import { DocumentKey } from './document_key';
|
|
20
20
|
import { TypeOrder } from './type_order';
|
|
21
21
|
export declare const MAX_VALUE: Value;
|
|
22
|
+
export declare const MIN_VALUE: Value;
|
|
22
23
|
/** Extracts the backend's type order for the provided value. */
|
|
23
24
|
export declare function typeOrder(value: Value): TypeOrder;
|
|
24
25
|
/** Tests `left` and `right` for equality based on the backend semantics. */
|
|
@@ -76,3 +77,9 @@ export declare function isMapValue(value?: Value | null): value is {
|
|
|
76
77
|
export declare function deepClone(source: Value): Value;
|
|
77
78
|
/** Returns true if the Value represents the canonical {@link #MAX_VALUE} . */
|
|
78
79
|
export declare function isMaxValue(value: Value): boolean;
|
|
80
|
+
/** Returns the lowest value for the given value type (inclusive). */
|
|
81
|
+
export declare function valuesGetLowerBound(value: Value): Value;
|
|
82
|
+
/** Returns the largest value for the given value type (exclusive). */
|
|
83
|
+
export declare function valuesGetUpperBound(value: Value): Value;
|
|
84
|
+
export declare function valuesMax(left: Value | undefined, right: Value | undefined): Value | undefined;
|
|
85
|
+
export declare function valuesMin(left: Value | undefined, right: Value | undefined): Value | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -33,7 +33,7 @@ export declare class TestRemoteDocumentCache {
|
|
|
33
33
|
* Reads all of the documents first so we can safely add them and keep the size calculation in
|
|
34
34
|
* sync.
|
|
35
35
|
*/
|
|
36
|
-
addEntries(documents: MutableDocument[]
|
|
36
|
+
addEntries(documents: MutableDocument[]): Promise<void>;
|
|
37
37
|
/**
|
|
38
38
|
* Adds a single document using the document's version as its read time.
|
|
39
39
|
* Reads the document first to track the document size internally.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2022 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { Bytes, DocumentReference
|
|
17
|
+
import { Bytes, DocumentReference } from '../../src';
|
|
18
18
|
import { BundledDocuments } from '../../src/core/bundle';
|
|
19
19
|
import { DatabaseId } from '../../src/core/database_info';
|
|
20
20
|
import { Query } from '../../src/core/query';
|
|
@@ -30,6 +30,7 @@ import { Document, MutableDocument } from '../../src/model/document';
|
|
|
30
30
|
import { DocumentComparator } from '../../src/model/document_comparator';
|
|
31
31
|
import { DocumentKey } from '../../src/model/document_key';
|
|
32
32
|
import { DocumentSet } from '../../src/model/document_set';
|
|
33
|
+
import { FieldIndex, IndexKind, IndexOffset } from '../../src/model/field_index';
|
|
33
34
|
import { FieldMask } from '../../src/model/field_mask';
|
|
34
35
|
import { DeleteMutation, MutationResult, PatchMutation, Precondition, SetMutation } from '../../src/model/mutation';
|
|
35
36
|
import { JsonObject, ObjectValue } from '../../src/model/object_value';
|
|
@@ -58,6 +59,11 @@ export declare function key(path: string): DocumentKey;
|
|
|
58
59
|
export declare function keys(...documents: Array<Document | string>): DocumentKeySet;
|
|
59
60
|
export declare function path(path: string, offset?: number): ResourcePath;
|
|
60
61
|
export declare function field(path: string): FieldPath;
|
|
62
|
+
export declare function fieldIndex(collectionGroup: string, options?: {
|
|
63
|
+
id?: number;
|
|
64
|
+
fields?: Array<[field: string, kind: IndexKind]>;
|
|
65
|
+
offset?: IndexOffset;
|
|
66
|
+
}): FieldIndex;
|
|
61
67
|
export declare function mask(...paths: string[]): FieldMask;
|
|
62
68
|
export declare function blob(...bytes: number[]): Bytes;
|
|
63
69
|
export declare function filter(path: string, op: string, value: unknown): FieldFilter;
|
|
@@ -65,7 +71,7 @@ export declare function setMutation(keyStr: string, json: JsonObject<unknown>):
|
|
|
65
71
|
export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
|
|
66
72
|
export declare function deleteMutation(keyStr: string): DeleteMutation;
|
|
67
73
|
export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult;
|
|
68
|
-
export declare function bound(values:
|
|
74
|
+
export declare function bound(values: unknown[], inclusive: boolean): Bound;
|
|
69
75
|
export declare function query(resourcePath: string, ...constraints: Array<OrderBy | Filter>): Query;
|
|
70
76
|
export declare function targetData(targetId: TargetId, queryPurpose: TargetPurpose, path: string): TargetData;
|
|
71
77
|
export declare function noChangeEvent(targetId: number, snapshotVersion: number, resumeToken?: ByteString): RemoteEvent;
|
package/dist/private.d.ts
CHANGED
|
@@ -197,8 +197,8 @@ declare type BatchId = number;
|
|
|
197
197
|
*/
|
|
198
198
|
declare class Bound {
|
|
199
199
|
readonly position: Value[];
|
|
200
|
-
readonly
|
|
201
|
-
constructor(position: Value[],
|
|
200
|
+
readonly inclusive: boolean;
|
|
201
|
+
constructor(position: Value[], inclusive: boolean);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
/**
|
|
@@ -757,6 +757,11 @@ declare interface Document_2 {
|
|
|
757
757
|
* document was guaranteed to not exist.
|
|
758
758
|
*/
|
|
759
759
|
readonly version: SnapshotVersion;
|
|
760
|
+
/**
|
|
761
|
+
* The timestamp at which this document was read from the remote server. Uses
|
|
762
|
+
* `SnapshotVersion.min()` for documents created by the user.
|
|
763
|
+
*/
|
|
764
|
+
readonly readTime: SnapshotVersion;
|
|
760
765
|
/** The underlying data of this document or an empty value if no data exists. */
|
|
761
766
|
readonly data: ObjectValue;
|
|
762
767
|
/** Returns whether local mutations were applied via the mutation queue. */
|
|
@@ -962,8 +967,7 @@ export declare class DocumentSnapshot<T = DocumentData> extends DocumentSnapshot
|
|
|
962
967
|
/** @hideconstructor protected */
|
|
963
968
|
constructor(_firestore: Firestore, userDataWriter: AbstractUserDataWriter, key: _DocumentKey, document: Document_2 | null, metadata: SnapshotMetadata, converter: UntypedFirestoreDataConverter<T> | null);
|
|
964
969
|
/**
|
|
965
|
-
*
|
|
966
|
-
* exists. True if the document exists.
|
|
970
|
+
* Returns whether or not the data exists. True if the document exists.
|
|
967
971
|
*/
|
|
968
972
|
exists(): this is QueryDocumentSnapshot<T>;
|
|
969
973
|
/**
|
|
@@ -1187,6 +1191,45 @@ declare interface EventManager {
|
|
|
1187
1191
|
|
|
1188
1192
|
declare type FieldFilterOp = 'OPERATOR_UNSPECIFIED' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'EQUAL' | 'NOT_EQUAL' | 'ARRAY_CONTAINS' | 'IN' | 'ARRAY_CONTAINS_ANY' | 'NOT_IN';
|
|
1189
1193
|
|
|
1194
|
+
/**
|
|
1195
|
+
* An index definition for field indexes in Firestore.
|
|
1196
|
+
*
|
|
1197
|
+
* Every index is associated with a collection. The definition contains a list
|
|
1198
|
+
* of fields and their index kind (which can be `ASCENDING`, `DESCENDING` or
|
|
1199
|
+
* `CONTAINS` for ArrayContains/ArrayContainsAny queries).
|
|
1200
|
+
*
|
|
1201
|
+
* Unlike the backend, the SDK does not differentiate between collection or
|
|
1202
|
+
* collection group-scoped indices. Every index can be used for both single
|
|
1203
|
+
* collection and collection group queries.
|
|
1204
|
+
*/
|
|
1205
|
+
declare class FieldIndex {
|
|
1206
|
+
/**
|
|
1207
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
1208
|
+
* has not yet been persisted).
|
|
1209
|
+
*/
|
|
1210
|
+
readonly indexId: number;
|
|
1211
|
+
/** The collection ID this index applies to. */
|
|
1212
|
+
readonly collectionGroup: string;
|
|
1213
|
+
/** The field segments for this index. */
|
|
1214
|
+
readonly segments: IndexSegment[];
|
|
1215
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
1216
|
+
readonly indexState: IndexState_2;
|
|
1217
|
+
/** An ID for an index that has not yet been added to persistence. */
|
|
1218
|
+
static UNKNOWN_ID: number;
|
|
1219
|
+
constructor(
|
|
1220
|
+
/**
|
|
1221
|
+
* The index ID. Returns -1 if the index ID is not available (e.g. the index
|
|
1222
|
+
* has not yet been persisted).
|
|
1223
|
+
*/
|
|
1224
|
+
indexId: number,
|
|
1225
|
+
/** The collection ID this index applies to. */
|
|
1226
|
+
collectionGroup: string,
|
|
1227
|
+
/** The field segments for this index. */
|
|
1228
|
+
segments: IndexSegment[],
|
|
1229
|
+
/** Shows how up-to-date the index is for the current user. */
|
|
1230
|
+
indexState: IndexState_2);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1190
1233
|
/**
|
|
1191
1234
|
* Provides a set of fields that can be used to partially patch a document.
|
|
1192
1235
|
* FieldMask is used in conjunction with ObjectValue.
|
|
@@ -1352,6 +1395,7 @@ declare class FirestoreClient {
|
|
|
1352
1395
|
private user;
|
|
1353
1396
|
private readonly clientId;
|
|
1354
1397
|
private authCredentialListener;
|
|
1398
|
+
private appCheckCredentialListener;
|
|
1355
1399
|
offlineComponents?: OfflineComponentProvider;
|
|
1356
1400
|
onlineComponents?: OnlineComponentProvider;
|
|
1357
1401
|
constructor(authCredentials: CredentialsProvider<User>, appCheckCredentials: CredentialsProvider<string>,
|
|
@@ -1366,6 +1410,7 @@ declare class FirestoreClient {
|
|
|
1366
1410
|
asyncQueue: AsyncQueue, databaseInfo: DatabaseInfo);
|
|
1367
1411
|
getConfiguration(): Promise<ComponentConfiguration>;
|
|
1368
1412
|
setCredentialChangeListener(listener: (user: User) => Promise<void>): void;
|
|
1413
|
+
setAppCheckTokenChangeListener(listener: (appCheckToken: string, user: User) => Promise<void>): void;
|
|
1369
1414
|
/**
|
|
1370
1415
|
* Checks that the client has not been terminated. Ensures that other methods on
|
|
1371
1416
|
* this class cannot be called after the client is terminated.
|
|
@@ -2139,8 +2184,28 @@ export declare function getFirestore(app?: FirebaseApp): Firestore;
|
|
|
2139
2184
|
*/
|
|
2140
2185
|
export declare function increment(n: number): FieldValue;
|
|
2141
2186
|
|
|
2187
|
+
/* Excluded from this release type: Index */
|
|
2188
|
+
|
|
2189
|
+
/* Excluded from this release type: IndexConfiguration */
|
|
2190
|
+
|
|
2191
|
+
/* Excluded from this release type: IndexField */
|
|
2192
|
+
|
|
2142
2193
|
declare type IndexFieldMode = 'MODE_UNSPECIFIED' | 'ASCENDING' | 'DESCENDING';
|
|
2143
2194
|
|
|
2195
|
+
/** The type of the index, e.g. for which type of query it can be used. */
|
|
2196
|
+
declare const enum IndexKind {
|
|
2197
|
+
/**
|
|
2198
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
2199
|
+
*/
|
|
2200
|
+
ASCENDING = 0,
|
|
2201
|
+
/**
|
|
2202
|
+
* Ordered index. Can be used for <, <=, ==, >=, >, !=, IN and NOT IN queries.
|
|
2203
|
+
*/
|
|
2204
|
+
DESCENDING = 1,
|
|
2205
|
+
/** Contains index. Can be used for ArrayContains and ArrayContainsAny. */
|
|
2206
|
+
CONTAINS = 2
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2144
2209
|
/**
|
|
2145
2210
|
* Represents a set of indexes that are used to execute queries efficiently.
|
|
2146
2211
|
*
|
|
@@ -2164,10 +2229,125 @@ declare interface IndexManager {
|
|
|
2164
2229
|
* path for a root-level collection).
|
|
2165
2230
|
*/
|
|
2166
2231
|
getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<_ResourcePath[]>;
|
|
2232
|
+
/**
|
|
2233
|
+
* Adds a field path index.
|
|
2234
|
+
*
|
|
2235
|
+
* Values for this index are persisted via the index backfill, which runs
|
|
2236
|
+
* asynchronously in the background. Once the first values are written,
|
|
2237
|
+
* an index can be used to serve partial results for any matching queries.
|
|
2238
|
+
* Any unindexed portion of the database will continue to be served via
|
|
2239
|
+
* collection scons.
|
|
2240
|
+
*/
|
|
2241
|
+
addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
2242
|
+
/** Removes the given field index and deletes all index values. */
|
|
2243
|
+
deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
|
|
2244
|
+
/**
|
|
2245
|
+
* Returns a list of field indexes that correspond to the specified collection
|
|
2246
|
+
* group.
|
|
2247
|
+
*
|
|
2248
|
+
* @param collectionGroup The collection group to get matching field indexes
|
|
2249
|
+
* for.
|
|
2250
|
+
* @return A collection of field indexes for the specified collection group.
|
|
2251
|
+
*/
|
|
2252
|
+
getFieldIndexes(transaction: PersistenceTransaction, collectionGroup: string): PersistencePromise<FieldIndex[]>;
|
|
2253
|
+
/** Returns all configured field indexes. */
|
|
2254
|
+
getFieldIndexes(transaction: PersistenceTransaction): PersistencePromise<FieldIndex[]>;
|
|
2255
|
+
/**
|
|
2256
|
+
* Returns an index that can be used to serve the provided target. Returns
|
|
2257
|
+
* `null` if no index is configured.
|
|
2258
|
+
*/
|
|
2259
|
+
getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
|
|
2260
|
+
/**
|
|
2261
|
+
* Returns the documents that match the given target based on the provided
|
|
2262
|
+
* index.
|
|
2263
|
+
*/
|
|
2264
|
+
getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
|
|
2265
|
+
/**
|
|
2266
|
+
* Returns the next collection group to update. Returns `null` if no group
|
|
2267
|
+
* exists.
|
|
2268
|
+
*/
|
|
2269
|
+
getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
|
|
2270
|
+
/**
|
|
2271
|
+
* Sets the collection group's latest read time.
|
|
2272
|
+
*
|
|
2273
|
+
* This method updates the index offset for all field indices for the
|
|
2274
|
+
* collection group and increments their sequence number. Subsequent calls to
|
|
2275
|
+
* `getNextCollectionGroupToUpdate()` will return a different collection group
|
|
2276
|
+
* (unless only one collection group is configured).
|
|
2277
|
+
*/
|
|
2278
|
+
updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
|
|
2279
|
+
/** Updates the index entries for the provided documents. */
|
|
2280
|
+
updateIndexEntries(transaction: PersistenceTransaction, documents: DocumentMap): PersistencePromise<void>;
|
|
2281
|
+
}
|
|
2282
|
+
|
|
2283
|
+
/**
|
|
2284
|
+
* Stores the latest read time, document and batch ID that were processed for an
|
|
2285
|
+
* index.
|
|
2286
|
+
*/
|
|
2287
|
+
declare class IndexOffset {
|
|
2288
|
+
/**
|
|
2289
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
2290
|
+
* field index.
|
|
2291
|
+
*/
|
|
2292
|
+
readonly readTime: SnapshotVersion;
|
|
2293
|
+
/**
|
|
2294
|
+
* The key of the last document that was indexed for this query. Use
|
|
2295
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
2296
|
+
*/
|
|
2297
|
+
readonly documentKey: _DocumentKey;
|
|
2298
|
+
readonly largestBatchId: number;
|
|
2299
|
+
constructor(
|
|
2300
|
+
/**
|
|
2301
|
+
* The latest read time version that has been indexed by Firestore for this
|
|
2302
|
+
* field index.
|
|
2303
|
+
*/
|
|
2304
|
+
readTime: SnapshotVersion,
|
|
2305
|
+
/**
|
|
2306
|
+
* The key of the last document that was indexed for this query. Use
|
|
2307
|
+
* `DocumentKey.empty()` if no document has been indexed.
|
|
2308
|
+
*/
|
|
2309
|
+
documentKey: _DocumentKey, largestBatchId: number);
|
|
2310
|
+
/** The state of an index that has not yet been backfilled. */
|
|
2311
|
+
static min(): IndexOffset;
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
/** An index component consisting of field path and index type. */
|
|
2315
|
+
declare class IndexSegment {
|
|
2316
|
+
/** The field path of the component. */
|
|
2317
|
+
readonly fieldPath: _FieldPath;
|
|
2318
|
+
/** The fields sorting order. */
|
|
2319
|
+
readonly kind: IndexKind;
|
|
2320
|
+
constructor(
|
|
2321
|
+
/** The field path of the component. */
|
|
2322
|
+
fieldPath: _FieldPath,
|
|
2323
|
+
/** The fields sorting order. */
|
|
2324
|
+
kind: IndexKind);
|
|
2167
2325
|
}
|
|
2168
2326
|
|
|
2169
2327
|
declare type IndexState = 'STATE_UNSPECIFIED' | 'CREATING' | 'READY' | 'ERROR';
|
|
2170
2328
|
|
|
2329
|
+
/**
|
|
2330
|
+
* Stores the "high water mark" that indicates how updated the Index is for the
|
|
2331
|
+
* current user.
|
|
2332
|
+
*/
|
|
2333
|
+
declare class IndexState_2 {
|
|
2334
|
+
/**
|
|
2335
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
2336
|
+
*/
|
|
2337
|
+
readonly sequenceNumber: number;
|
|
2338
|
+
/** The the latest indexed read time, document and batch id. */
|
|
2339
|
+
readonly offset: IndexOffset;
|
|
2340
|
+
constructor(
|
|
2341
|
+
/**
|
|
2342
|
+
* Indicates when the index was last updated (relative to other indexes).
|
|
2343
|
+
*/
|
|
2344
|
+
sequenceNumber: number,
|
|
2345
|
+
/** The the latest indexed read time, document and batch id. */
|
|
2346
|
+
offset: IndexOffset);
|
|
2347
|
+
/** The state of an index that has not yet been backfilled. */
|
|
2348
|
+
static empty(): IndexState_2;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2171
2351
|
/**
|
|
2172
2352
|
* Initializes a new instance of {@link Firestore} with the provided settings.
|
|
2173
2353
|
* Can only be called before any other function, including
|
|
@@ -2267,13 +2447,13 @@ declare class LLRBNode<K, V> {
|
|
|
2267
2447
|
/**
|
|
2268
2448
|
* Loads a Firestore bundle into the local cache.
|
|
2269
2449
|
*
|
|
2270
|
-
* @param firestore - The {@link Firestore} instance to load bundles for
|
|
2271
|
-
* @param bundleData - An object representing the bundle to be loaded. Valid
|
|
2272
|
-
*
|
|
2450
|
+
* @param firestore - The {@link Firestore} instance to load bundles for.
|
|
2451
|
+
* @param bundleData - An object representing the bundle to be loaded. Valid
|
|
2452
|
+
* objects are `ArrayBuffer`, `ReadableStream<Uint8Array>` or `string`.
|
|
2273
2453
|
*
|
|
2274
|
-
* @returns
|
|
2275
|
-
*
|
|
2276
|
-
*
|
|
2454
|
+
* @returns A `LoadBundleTask` object, which notifies callers with progress
|
|
2455
|
+
* updates, and completion or error events. It can be used as a
|
|
2456
|
+
* `Promise<LoadBundleTaskProgress>`.
|
|
2277
2457
|
*/
|
|
2278
2458
|
export declare function loadBundle(firestore: Firestore, bundleData: ReadableStream<Uint8Array> | ArrayBuffer | string): LoadBundleTask;
|
|
2279
2459
|
|
|
@@ -2417,6 +2597,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
2417
2597
|
readonly key: _DocumentKey;
|
|
2418
2598
|
private documentType;
|
|
2419
2599
|
version: SnapshotVersion;
|
|
2600
|
+
readTime: SnapshotVersion;
|
|
2420
2601
|
data: ObjectValue;
|
|
2421
2602
|
private documentState;
|
|
2422
2603
|
private constructor();
|
|
@@ -2456,6 +2637,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
2456
2637
|
convertToUnknownDocument(version: SnapshotVersion): MutableDocument;
|
|
2457
2638
|
setHasCommittedMutations(): MutableDocument;
|
|
2458
2639
|
setHasLocalMutations(): MutableDocument;
|
|
2640
|
+
setReadTime(readTime: SnapshotVersion): MutableDocument;
|
|
2459
2641
|
get hasLocalMutations(): boolean;
|
|
2460
2642
|
get hasCommittedMutations(): boolean;
|
|
2461
2643
|
get hasPendingWrites(): boolean;
|
|
@@ -2748,11 +2930,16 @@ declare interface NamedQuery {
|
|
|
2748
2930
|
}
|
|
2749
2931
|
|
|
2750
2932
|
/**
|
|
2751
|
-
* Reads a Firestore {@link Query} from local cache, identified by the given
|
|
2933
|
+
* Reads a Firestore {@link Query} from local cache, identified by the given
|
|
2934
|
+
* name.
|
|
2752
2935
|
*
|
|
2753
2936
|
* The named queries are packaged into bundles on the server side (along
|
|
2754
|
-
* with resulting documents), and loaded to local cache using `loadBundle`. Once
|
|
2755
|
-
* cache, use this method to extract a {@link Query} by name.
|
|
2937
|
+
* with resulting documents), and loaded to local cache using `loadBundle`. Once
|
|
2938
|
+
* in local cache, use this method to extract a {@link Query} by name.
|
|
2939
|
+
*
|
|
2940
|
+
* @param firestore - The {@link Firestore} instance to read the query from.
|
|
2941
|
+
* @param name - The name of the query.
|
|
2942
|
+
* @returns A `Promise` that is resolved with the Query or `null`.
|
|
2756
2943
|
*/
|
|
2757
2944
|
export declare function namedQuery(firestore: Firestore, name: string): Promise<Query | null>;
|
|
2758
2945
|
|
|
@@ -3767,14 +3954,6 @@ declare interface RemoteDocumentCache {
|
|
|
3767
3954
|
getSize(transaction: PersistenceTransaction): PersistencePromise<number>;
|
|
3768
3955
|
}
|
|
3769
3956
|
|
|
3770
|
-
/**
|
|
3771
|
-
* Represents a document change to be applied to remote document cache.
|
|
3772
|
-
*/
|
|
3773
|
-
declare interface RemoteDocumentChange {
|
|
3774
|
-
readonly document: MutableDocument;
|
|
3775
|
-
readonly readTime: SnapshotVersion | null;
|
|
3776
|
-
}
|
|
3777
|
-
|
|
3778
3957
|
/**
|
|
3779
3958
|
* An in-memory buffer of entries to be written to a RemoteDocumentCache.
|
|
3780
3959
|
* It can be used to batch up a set of changes to be written to the cache, but
|
|
@@ -3790,26 +3969,25 @@ declare interface RemoteDocumentChange {
|
|
|
3790
3969
|
* porting this class as part of that implementation work.
|
|
3791
3970
|
*/
|
|
3792
3971
|
declare abstract class RemoteDocumentChangeBuffer {
|
|
3793
|
-
protected changes: ObjectMap<_DocumentKey,
|
|
3972
|
+
protected changes: ObjectMap<_DocumentKey, MutableDocument>;
|
|
3794
3973
|
private changesApplied;
|
|
3795
3974
|
protected abstract getFromCache(transaction: PersistenceTransaction, documentKey: _DocumentKey): PersistencePromise<MutableDocument>;
|
|
3796
3975
|
protected abstract getAllFromCache(transaction: PersistenceTransaction, documentKeys: DocumentKeySet): PersistencePromise<MutableDocumentMap>;
|
|
3797
3976
|
protected abstract applyChanges(transaction: PersistenceTransaction): PersistencePromise<void>;
|
|
3798
|
-
protected getReadTime(key: _DocumentKey): SnapshotVersion;
|
|
3799
3977
|
/**
|
|
3800
3978
|
* Buffers a `RemoteDocumentCache.addEntry()` call.
|
|
3801
3979
|
*
|
|
3802
3980
|
* You can only modify documents that have already been retrieved via
|
|
3803
3981
|
* `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).
|
|
3804
3982
|
*/
|
|
3805
|
-
addEntry(document: MutableDocument
|
|
3983
|
+
addEntry(document: MutableDocument): void;
|
|
3806
3984
|
/**
|
|
3807
3985
|
* Buffers a `RemoteDocumentCache.removeEntry()` call.
|
|
3808
3986
|
*
|
|
3809
3987
|
* You can only remove documents that have already been retrieved via
|
|
3810
3988
|
* `getEntry()/getEntries()` (enforced via IndexedDbs `apply()`).
|
|
3811
3989
|
*/
|
|
3812
|
-
removeEntry(key: _DocumentKey, readTime
|
|
3990
|
+
removeEntry(key: _DocumentKey, readTime: SnapshotVersion): void;
|
|
3813
3991
|
/**
|
|
3814
3992
|
* Looks up an entry in the cache. The buffered changes will first be checked,
|
|
3815
3993
|
* and if no buffered change applies, this will forward to
|
|
@@ -4031,6 +4209,8 @@ export declare function setDoc<T>(reference: DocumentReference<T>, data: WithFie
|
|
|
4031
4209
|
*/
|
|
4032
4210
|
export declare function setDoc<T>(reference: DocumentReference<T>, data: PartialWithFieldValue<T>, options: SetOptions): Promise<void>;
|
|
4033
4211
|
|
|
4212
|
+
/* Excluded from this release type: _setIndexConfiguration */
|
|
4213
|
+
|
|
4034
4214
|
/**
|
|
4035
4215
|
* Sets the verbosity of Cloud Firestore logs (debug, error, or silent).
|
|
4036
4216
|
*
|