@firebase/firestore 3.4.8 → 3.4.9-canary.0197076b8
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/lite/index.d.ts +1 -0
- package/dist/firestore/src/api/transaction.d.ts +4 -1
- package/dist/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/firestore/src/api.d.ts +1 -0
- package/dist/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/firestore/src/core/query.d.ts +2 -4
- package/dist/firestore/src/core/target.d.ts +6 -4
- package/dist/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/firestore/src/lite-api/transaction.d.ts +4 -1
- package/dist/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/firestore/src/local/index_manager.d.ts +24 -3
- package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
- package/dist/firestore/src/local/indexeddb_schema.d.ts +4 -2
- package/dist/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/firestore/src/local/local_documents_view.d.ts +47 -8
- package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/src/local/memory_index_manager.d.ts +3 -2
- package/dist/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/firestore/src/local/query_engine.d.ts +44 -5
- package/dist/firestore/src/model/collections.d.ts +3 -1
- package/dist/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/firestore/src/model/mutation.d.ts +19 -1
- package/dist/firestore/src/model/mutation_batch.d.ts +9 -4
- package/dist/firestore/src/model/values.d.ts +14 -2
- package/dist/firestore/src/tsdoc-metadata.json +11 -11
- package/dist/firestore/src/util/misc.d.ts +3 -0
- package/dist/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
- package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/firestore/test/unit/local/test_index_manager.d.ts +2 -2
- package/dist/firestore/test/util/helpers.d.ts +12 -0
- package/dist/index.d.ts +28 -3
- package/dist/index.esm2017.js +9384 -9023
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.esm5.js +7406 -7016
- package/dist/index.esm5.js.map +1 -1
- package/dist/index.node.cjs.js +5607 -5089
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.mjs +5607 -5089
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.rn.js +7162 -6801
- package/dist/index.rn.js.map +1 -1
- package/dist/internal.d.ts +6007 -5918
- package/dist/lite/firestore/lite/index.d.ts +1 -0
- package/dist/lite/firestore/src/api/transaction.d.ts +4 -1
- package/dist/lite/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/firestore/src/api.d.ts +1 -0
- package/dist/lite/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/firestore/src/core/query.d.ts +2 -4
- package/dist/lite/firestore/src/core/target.d.ts +6 -4
- package/dist/lite/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/firestore/src/lite-api/transaction.d.ts +4 -1
- package/dist/lite/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/lite/firestore/src/local/index_manager.d.ts +24 -3
- package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
- package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +4 -2
- package/dist/lite/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/lite/firestore/src/local/local_documents_view.d.ts +47 -8
- package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/src/local/memory_index_manager.d.ts +3 -2
- package/dist/lite/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/lite/firestore/src/local/query_engine.d.ts +44 -5
- package/dist/lite/firestore/src/model/collections.d.ts +3 -1
- package/dist/lite/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/lite/firestore/src/model/mutation.d.ts +19 -1
- package/dist/lite/firestore/src/model/mutation_batch.d.ts +9 -4
- package/dist/lite/firestore/src/model/values.d.ts +14 -2
- package/dist/lite/firestore/src/util/misc.d.ts +3 -0
- package/dist/lite/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
- package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +2 -2
- package/dist/lite/firestore/test/util/helpers.d.ts +12 -0
- package/dist/lite/index.browser.esm2017.js +1209 -698
- package/dist/lite/index.browser.esm2017.js.map +1 -1
- package/dist/lite/index.browser.esm5.js +1213 -813
- package/dist/lite/index.browser.esm5.js.map +1 -1
- package/dist/lite/index.d.ts +26 -1
- package/dist/lite/index.node.cjs.js +709 -15
- package/dist/lite/index.node.cjs.js.map +1 -1
- package/dist/lite/index.node.mjs +709 -15
- package/dist/lite/index.node.mjs.map +1 -1
- package/dist/lite/index.rn.esm2017.js +1828 -1317
- package/dist/lite/index.rn.esm2017.js.map +1 -1
- package/dist/lite/internal.d.ts +2912 -2874
- package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +103 -101
- package/dist/lite/packages/firestore/lite/index.d.ts +1 -0
- package/dist/lite/packages/firestore/src/api/transaction.d.ts +4 -1
- package/dist/lite/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/lite/packages/firestore/src/api.d.ts +1 -0
- package/dist/lite/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/lite/packages/firestore/src/core/query.d.ts +2 -4
- package/dist/lite/packages/firestore/src/core/target.d.ts +6 -4
- package/dist/lite/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/lite/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/lite/packages/firestore/src/lite-api/transaction.d.ts +4 -1
- package/dist/lite/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/lite/packages/firestore/src/local/index_manager.d.ts +24 -3
- package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
- package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +4 -2
- package/dist/lite/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +47 -8
- package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +3 -2
- package/dist/lite/packages/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/lite/packages/firestore/src/local/query_engine.d.ts +44 -5
- package/dist/lite/packages/firestore/src/model/collections.d.ts +3 -1
- package/dist/lite/packages/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/lite/packages/firestore/src/model/mutation.d.ts +19 -1
- package/dist/lite/packages/firestore/src/model/mutation_batch.d.ts +9 -4
- package/dist/lite/packages/firestore/src/model/values.d.ts +14 -2
- package/dist/lite/packages/firestore/src/util/misc.d.ts +3 -0
- package/dist/lite/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
- package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
- package/dist/lite/packages/firestore/test/util/helpers.d.ts +12 -0
- package/dist/lite/private.d.ts +2772 -2734
- package/dist/packages/firestore/dist/index.esm2017.d.ts +197 -194
- package/dist/packages/firestore/lite/index.d.ts +1 -0
- package/dist/packages/firestore/src/api/transaction.d.ts +4 -1
- package/dist/packages/firestore/src/api/transaction_options.d.ts +17 -0
- package/dist/packages/firestore/src/api.d.ts +1 -0
- package/dist/packages/firestore/src/core/firestore_client.d.ts +2 -1
- package/dist/packages/firestore/src/core/query.d.ts +2 -4
- package/dist/packages/firestore/src/core/target.d.ts +6 -4
- package/dist/packages/firestore/src/core/transaction_options.d.ts +25 -0
- package/dist/packages/firestore/src/core/transaction_runner.d.ts +3 -2
- package/dist/packages/firestore/src/lite-api/transaction.d.ts +4 -1
- package/dist/packages/firestore/src/lite-api/transaction_options.d.ts +23 -0
- package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +5 -0
- package/dist/packages/firestore/src/local/index_manager.d.ts +24 -3
- package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +4 -7
- package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +4 -2
- package/dist/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
- package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +1 -0
- package/dist/packages/firestore/src/local/local_documents_view.d.ts +47 -8
- package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/src/local/memory_index_manager.d.ts +3 -2
- package/dist/packages/firestore/src/local/overlayed_document.d.ts +36 -0
- package/dist/packages/firestore/src/local/query_engine.d.ts +44 -5
- package/dist/packages/firestore/src/model/collections.d.ts +3 -1
- package/dist/packages/firestore/src/model/field_mask.d.ts +6 -0
- package/dist/packages/firestore/src/model/mutation.d.ts +19 -1
- package/dist/packages/firestore/src/model/mutation_batch.d.ts +9 -4
- package/dist/packages/firestore/src/model/values.d.ts +14 -2
- package/dist/packages/firestore/src/util/misc.d.ts +3 -0
- package/dist/packages/firestore/test/unit/local/counting_query_engine.d.ts +2 -1
- package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +1 -0
- package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +2 -2
- package/dist/packages/firestore/test/util/helpers.d.ts +12 -0
- package/dist/private.d.ts +5715 -5626
- package/package.json +20 -18
|
@@ -28,6 +28,12 @@ import { FieldPath } from './path';
|
|
|
28
28
|
export declare class FieldMask {
|
|
29
29
|
readonly fields: FieldPath[];
|
|
30
30
|
constructor(fields: FieldPath[]);
|
|
31
|
+
static empty(): FieldMask;
|
|
32
|
+
/**
|
|
33
|
+
* Returns a new FieldMask object that is the result of adding all the given
|
|
34
|
+
* fields paths to this field mask.
|
|
35
|
+
*/
|
|
36
|
+
unionWith(extraFields: FieldPath[]): FieldMask;
|
|
31
37
|
/**
|
|
32
38
|
* Verifies that `fieldPath` is included by at least one field in this field
|
|
33
39
|
* mask.
|
|
@@ -149,7 +149,19 @@ export declare abstract class Mutation {
|
|
|
149
149
|
abstract readonly key: DocumentKey;
|
|
150
150
|
abstract readonly precondition: Precondition;
|
|
151
151
|
abstract readonly fieldTransforms: FieldTransform[];
|
|
152
|
+
/**
|
|
153
|
+
* Returns a `FieldMask` representing the fields that will be changed by
|
|
154
|
+
* applying this mutation. Returns `null` if the mutation will overwrite the
|
|
155
|
+
* entire document.
|
|
156
|
+
*/
|
|
157
|
+
abstract getFieldMask(): FieldMask | null;
|
|
152
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* A utility method to calculate a `Mutation` representing the overlay from the
|
|
161
|
+
* final state of the document, and a `FieldMask` representing the fields that
|
|
162
|
+
* are mutated by the local mutations.
|
|
163
|
+
*/
|
|
164
|
+
export declare function calculateOverlayMutation(doc: MutableDocument, mask: FieldMask | null): Mutation | null;
|
|
153
165
|
/**
|
|
154
166
|
* Applies this mutation to the given document for the purposes of computing a
|
|
155
167
|
* new remote document. If the input document doesn't match the expected state
|
|
@@ -172,10 +184,12 @@ export declare function mutationApplyToRemoteDocument(mutation: Mutation, docume
|
|
|
172
184
|
* @param document - The document to mutate. The input document can be an
|
|
173
185
|
* invalid document if the client has no knowledge of the pre-mutation state
|
|
174
186
|
* of the document.
|
|
187
|
+
* @param previousMask - The fields that have been updated before applying this mutation.
|
|
175
188
|
* @param localWriteTime - A timestamp indicating the local write time of the
|
|
176
189
|
* batch this mutation is a part of.
|
|
190
|
+
* @returns A `FieldMask` representing the fields that are changed by applying this mutation.
|
|
177
191
|
*/
|
|
178
|
-
export declare function mutationApplyToLocalView(mutation: Mutation, document: MutableDocument, localWriteTime: Timestamp):
|
|
192
|
+
export declare function mutationApplyToLocalView(mutation: Mutation, document: MutableDocument, previousMask: FieldMask | null, localWriteTime: Timestamp): FieldMask | null;
|
|
179
193
|
/**
|
|
180
194
|
* If this mutation is not idempotent, returns the base value to persist with
|
|
181
195
|
* this mutation. If a base value is returned, the mutation is always applied
|
|
@@ -205,6 +219,7 @@ export declare class SetMutation extends Mutation {
|
|
|
205
219
|
readonly fieldTransforms: FieldTransform[];
|
|
206
220
|
constructor(key: DocumentKey, value: ObjectValue, precondition: Precondition, fieldTransforms?: FieldTransform[]);
|
|
207
221
|
readonly type: MutationType;
|
|
222
|
+
getFieldMask(): FieldMask | null;
|
|
208
223
|
}
|
|
209
224
|
/**
|
|
210
225
|
* A mutation that modifies fields of the document at the given key with the
|
|
@@ -227,6 +242,7 @@ export declare class PatchMutation extends Mutation {
|
|
|
227
242
|
readonly fieldTransforms: FieldTransform[];
|
|
228
243
|
constructor(key: DocumentKey, data: ObjectValue, fieldMask: FieldMask, precondition: Precondition, fieldTransforms?: FieldTransform[]);
|
|
229
244
|
readonly type: MutationType;
|
|
245
|
+
getFieldMask(): FieldMask | null;
|
|
230
246
|
}
|
|
231
247
|
/** A mutation that deletes the document at the given key. */
|
|
232
248
|
export declare class DeleteMutation extends Mutation {
|
|
@@ -235,6 +251,7 @@ export declare class DeleteMutation extends Mutation {
|
|
|
235
251
|
constructor(key: DocumentKey, precondition: Precondition);
|
|
236
252
|
readonly type: MutationType;
|
|
237
253
|
readonly fieldTransforms: FieldTransform[];
|
|
254
|
+
getFieldMask(): FieldMask | null;
|
|
238
255
|
}
|
|
239
256
|
/**
|
|
240
257
|
* A mutation that verifies the existence of the document at the given key with
|
|
@@ -249,4 +266,5 @@ export declare class VerifyMutation extends Mutation {
|
|
|
249
266
|
constructor(key: DocumentKey, precondition: Precondition);
|
|
250
267
|
readonly type: MutationType;
|
|
251
268
|
readonly fieldTransforms: FieldTransform[];
|
|
269
|
+
getFieldMask(): FieldMask | null;
|
|
252
270
|
}
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
import { SnapshotVersion } from '../core/snapshot_version';
|
|
18
18
|
import { BatchId } from '../core/types';
|
|
19
19
|
import { Timestamp } from '../lite-api/timestamp';
|
|
20
|
-
import {
|
|
20
|
+
import { OverlayedDocument } from '../local/overlayed_document';
|
|
21
|
+
import { DocumentKeySet, MutationMap, DocumentVersionMap, DocumentKeyMap } from './collections';
|
|
21
22
|
import { MutableDocument } from './document';
|
|
23
|
+
import { FieldMask } from './field_mask';
|
|
22
24
|
import { Mutation, MutationResult } from './mutation';
|
|
23
25
|
/**
|
|
24
26
|
* A batch of mutations that will be sent as one unit to the backend.
|
|
@@ -54,13 +56,16 @@ export declare class MutationBatch {
|
|
|
54
56
|
* batch.
|
|
55
57
|
*
|
|
56
58
|
* @param document - The document to apply mutations to.
|
|
59
|
+
* @param mutatedFields - Fields that have been updated before applying this mutation batch.
|
|
60
|
+
* @returns A `FieldMask` representing all the fields that are mutated.
|
|
57
61
|
*/
|
|
58
|
-
applyToLocalView(document: MutableDocument):
|
|
62
|
+
applyToLocalView(document: MutableDocument, mutatedFields: FieldMask | null): FieldMask | null;
|
|
59
63
|
/**
|
|
60
64
|
* Computes the local view for all provided documents given the mutations in
|
|
61
|
-
* this batch.
|
|
65
|
+
* this batch. Returns a `DocumentKey` to `Mutation` map which can be used to
|
|
66
|
+
* replace all the mutation applications.
|
|
62
67
|
*/
|
|
63
|
-
applyToLocalDocumentSet(documentMap:
|
|
68
|
+
applyToLocalDocumentSet(documentMap: DocumentKeyMap<OverlayedDocument>, documentsWithoutRemoteVersion: DocumentKeySet): MutationMap;
|
|
64
69
|
keys(): DocumentKeySet;
|
|
65
70
|
isEqual(other: MutationBatch): boolean;
|
|
66
71
|
}
|
|
@@ -81,5 +81,17 @@ export declare function isMaxValue(value: Value): boolean;
|
|
|
81
81
|
export declare function valuesGetLowerBound(value: Value): Value;
|
|
82
82
|
/** Returns the largest value for the given value type (exclusive). */
|
|
83
83
|
export declare function valuesGetUpperBound(value: Value): Value;
|
|
84
|
-
export declare function
|
|
85
|
-
|
|
84
|
+
export declare function lowerBoundCompare(left: {
|
|
85
|
+
value: Value;
|
|
86
|
+
inclusive: boolean;
|
|
87
|
+
}, right: {
|
|
88
|
+
value: Value;
|
|
89
|
+
inclusive: boolean;
|
|
90
|
+
}): number;
|
|
91
|
+
export declare function upperBoundCompare(left: {
|
|
92
|
+
value: Value;
|
|
93
|
+
inclusive: boolean;
|
|
94
|
+
}, right: {
|
|
95
|
+
value: Value;
|
|
96
|
+
inclusive: boolean;
|
|
97
|
+
}): number;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "0.1.2"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "0.1.2"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -25,6 +25,9 @@ export declare function primitiveComparator<T>(left: T, right: T): number;
|
|
|
25
25
|
export interface Equatable<T> {
|
|
26
26
|
isEqual(other: T): boolean;
|
|
27
27
|
}
|
|
28
|
+
export interface Iterable<V> {
|
|
29
|
+
forEach: (cb: (v: V) => void) => void;
|
|
30
|
+
}
|
|
28
31
|
/** Helper to compare arrays using isEqual(). */
|
|
29
32
|
export declare function arrayEquals<T>(left: T[], right: T[], comparator: (l: T, r: T) => boolean): boolean;
|
|
30
33
|
/**
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { Query } from '../../../src/core/query';
|
|
18
18
|
import { SnapshotVersion } from '../../../src/core/snapshot_version';
|
|
19
|
+
import { IndexManager } from '../../../src/local/index_manager';
|
|
19
20
|
import { LocalDocumentsView } from '../../../src/local/local_documents_view';
|
|
20
21
|
import { PersistencePromise } from '../../../src/local/persistence_promise';
|
|
21
22
|
import { PersistenceTransaction } from '../../../src/local/persistence_transaction';
|
|
@@ -51,7 +52,7 @@ export declare class CountingQueryEngine extends QueryEngine {
|
|
|
51
52
|
documentsReadByKey: number;
|
|
52
53
|
resetCounts(): void;
|
|
53
54
|
getDocumentsMatchingQuery(transaction: PersistenceTransaction, query: Query, lastLimboFreeSnapshotVersion: SnapshotVersion, remoteKeys: DocumentKeySet): PersistencePromise<DocumentMap>;
|
|
54
|
-
|
|
55
|
+
initialize(localDocuments: LocalDocumentsView, indexManager: IndexManager): void;
|
|
55
56
|
private wrapRemoteDocumentCache;
|
|
56
57
|
private wrapMutationQueue;
|
|
57
58
|
}
|
|
@@ -31,6 +31,7 @@ export declare class TestDocumentOverlayCache {
|
|
|
31
31
|
constructor(persistence: Persistence, cache: DocumentOverlayCache);
|
|
32
32
|
saveOverlays(largestBatch: number, data: MutationMap): Promise<void>;
|
|
33
33
|
getOverlay(key: DocumentKey): Promise<Overlay | null>;
|
|
34
|
+
getOverlays(keys: DocumentKeySet): Promise<OverlayMap>;
|
|
34
35
|
getOverlayMutation(docKey: string): Promise<Mutation | null>;
|
|
35
36
|
getOverlaysForCollection(path: ResourcePath, sinceBatchId: number): Promise<OverlayMap>;
|
|
36
37
|
getOverlaysForCollectionGroup(collectionGroup: string, sinceBatchId: number, count: number): Promise<OverlayMap>;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { Target } from '../../../src/core/target';
|
|
18
|
-
import { IndexManager } from '../../../src/local/index_manager';
|
|
18
|
+
import { IndexManager, IndexType } from '../../../src/local/index_manager';
|
|
19
19
|
import { Persistence } from '../../../src/local/persistence';
|
|
20
20
|
import { DocumentMap } from '../../../src/model/collections';
|
|
21
21
|
import { DocumentKey } from '../../../src/model/document_key';
|
|
@@ -34,7 +34,7 @@ export declare class TestIndexManager {
|
|
|
34
34
|
addFieldIndex(index: FieldIndex): Promise<void>;
|
|
35
35
|
deleteFieldIndex(index: FieldIndex): Promise<void>;
|
|
36
36
|
getFieldIndexes(collectionGroup?: string): Promise<FieldIndex[]>;
|
|
37
|
-
|
|
37
|
+
getIndexType(target: Target): Promise<IndexType>;
|
|
38
38
|
getDocumentsMatchingTarget(target: Target): Promise<DocumentKey[] | null>;
|
|
39
39
|
getNextCollectionGroupToUpdate(): Promise<string | null>;
|
|
40
40
|
updateCollectionGroup(collectionGroup: string, offset: IndexOffset): Promise<void>;
|
|
@@ -69,6 +69,7 @@ export declare function blob(...bytes: number[]): Bytes;
|
|
|
69
69
|
export declare function filter(path: string, op: string, value: unknown): FieldFilter;
|
|
70
70
|
export declare function setMutation(keyStr: string, json: JsonObject<unknown>): SetMutation;
|
|
71
71
|
export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
|
|
72
|
+
export declare function mergeMutation(keyStr: string, json: JsonObject<unknown>, updateMask: FieldPath[]): PatchMutation;
|
|
72
73
|
export declare function deleteMutation(keyStr: string): DeleteMutation;
|
|
73
74
|
export declare function mutationResult(testVersion: TestSnapshotVersion): MutationResult;
|
|
74
75
|
export declare function bound(values: unknown[], inclusive: boolean): Bound;
|
|
@@ -177,3 +178,14 @@ export declare function expectSetToEqual<T>(set: SortedSet<T>, arr: T[]): void;
|
|
|
177
178
|
export declare function expectEqualitySets<T>(elems: T[][], equalityFn: (v1: T, v2: T) => boolean, stringifyFn?: (v: T) => string): void;
|
|
178
179
|
export declare function validateFirestoreError(expectedCode: Code, actualError: Error): void;
|
|
179
180
|
export declare function forEachNumber<V>(obj: Dict<V>, fn: (key: number, val: V) => void): void;
|
|
181
|
+
/**
|
|
182
|
+
* Returns all possible permutations of the given array.
|
|
183
|
+
* For `[a, b]`, this method returns `[[a, b], [b, a]]`.
|
|
184
|
+
*/
|
|
185
|
+
export declare function computePermutations<T>(input: T[]): T[][];
|
|
186
|
+
/**
|
|
187
|
+
* Returns all possible combinations of the given array, including an empty
|
|
188
|
+
* array. For `[a, b, c]` this method returns
|
|
189
|
+
* `[[], [a], [a, b], [a, c], [b, c], [a, b, c]`.
|
|
190
|
+
*/
|
|
191
|
+
export declare function computeCombinations<T>(input: T[]): T[][];
|
package/dist/index.d.ts
CHANGED
|
@@ -1436,12 +1436,14 @@ export declare function refEqual<T>(left: DocumentReference<T> | CollectionRefer
|
|
|
1436
1436
|
* transaction against.
|
|
1437
1437
|
* @param updateFunction - The function to execute within the transaction
|
|
1438
1438
|
* context.
|
|
1439
|
+
* @param options - An options object to configure maximum number of attempts to
|
|
1440
|
+
* commit.
|
|
1439
1441
|
* @returns If the transaction completed successfully or was explicitly aborted
|
|
1440
1442
|
* (the `updateFunction` returned a failed promise), the promise returned by the
|
|
1441
1443
|
* `updateFunction `is returned here. Otherwise, if the transaction failed, a
|
|
1442
1444
|
* rejected promise with the corresponding failure error is returned.
|
|
1443
1445
|
*/
|
|
1444
|
-
export declare function runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T
|
|
1446
|
+
export declare function runTransaction<T>(firestore: Firestore, updateFunction: (transaction: Transaction) => Promise<T>, options?: TransactionOptions): Promise<T>;
|
|
1445
1447
|
/**
|
|
1446
1448
|
* Returns a sentinel used with {@link @firebase/firestore/lite#(setDoc:1)} or {@link @firebase/firestore/lite#(updateDoc:1)} to
|
|
1447
1449
|
* include a server-generated timestamp in the written data.
|
|
@@ -1810,8 +1812,8 @@ export declare class Transaction {
|
|
|
1810
1812
|
* not exist.
|
|
1811
1813
|
*
|
|
1812
1814
|
* @param documentRef - A reference to the document to be updated.
|
|
1813
|
-
* @param data - An object containing the fields and values with which to
|
|
1814
|
-
update the document. Fields can contain dots to reference nested fields
|
|
1815
|
+
* @param data - An object containing the fields and values with which to
|
|
1816
|
+
update the document. Fields can contain dots to reference nested fields
|
|
1815
1817
|
within the document.
|
|
1816
1818
|
* @throws Error - If the provided input is not valid Firestore data.
|
|
1817
1819
|
* @returns This `Transaction` instance. Used for chaining method calls.
|
|
@@ -1841,6 +1843,29 @@ within the document.
|
|
|
1841
1843
|
*/
|
|
1842
1844
|
delete(documentRef: DocumentReference<unknown>): this;
|
|
1843
1845
|
}
|
|
1846
|
+
/**
|
|
1847
|
+
* @license
|
|
1848
|
+
* Copyright 2022 Google LLC
|
|
1849
|
+
*
|
|
1850
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1851
|
+
* you may not use this file except in compliance with the License.
|
|
1852
|
+
* You may obtain a copy of the License at
|
|
1853
|
+
*
|
|
1854
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1855
|
+
*
|
|
1856
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1857
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1858
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1859
|
+
* See the License for the specific language governing permissions and
|
|
1860
|
+
* limitations under the License.
|
|
1861
|
+
*/
|
|
1862
|
+
/**
|
|
1863
|
+
* Options to customize transaction behavior.
|
|
1864
|
+
*/
|
|
1865
|
+
export declare interface TransactionOptions {
|
|
1866
|
+
/** Maximum number of attempts to commit, after which transaction fails. Default is 5. */
|
|
1867
|
+
readonly maxAttempts?: number;
|
|
1868
|
+
}
|
|
1844
1869
|
/**
|
|
1845
1870
|
* Given a union type `U = T1 | T2 | ...`, returns an intersected type
|
|
1846
1871
|
* `(T1 & T2 & ...)`.
|