@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/lite/private.d.ts
CHANGED
|
@@ -177,8 +177,8 @@ declare abstract class BasePath<B extends BasePath<B>> {
|
|
|
177
177
|
*/
|
|
178
178
|
declare class Bound {
|
|
179
179
|
readonly position: Value[];
|
|
180
|
-
readonly
|
|
181
|
-
constructor(position: Value[],
|
|
180
|
+
readonly inclusive: boolean;
|
|
181
|
+
constructor(position: Value[], inclusive: boolean);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/**
|
|
@@ -545,6 +545,11 @@ declare interface Document_2 {
|
|
|
545
545
|
* document was guaranteed to not exist.
|
|
546
546
|
*/
|
|
547
547
|
readonly version: SnapshotVersion;
|
|
548
|
+
/**
|
|
549
|
+
* The timestamp at which this document was read from the remote server. Uses
|
|
550
|
+
* `SnapshotVersion.min()` for documents created by the user.
|
|
551
|
+
*/
|
|
552
|
+
readonly readTime: SnapshotVersion;
|
|
548
553
|
/** The underlying data of this document or an empty value if no data exists. */
|
|
549
554
|
readonly data: ObjectValue;
|
|
550
555
|
/** Returns whether local mutations were applied via the mutation queue. */
|
|
@@ -1507,6 +1512,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
1507
1512
|
readonly key: DocumentKey;
|
|
1508
1513
|
private documentType;
|
|
1509
1514
|
version: SnapshotVersion;
|
|
1515
|
+
readTime: SnapshotVersion;
|
|
1510
1516
|
data: ObjectValue;
|
|
1511
1517
|
private documentState;
|
|
1512
1518
|
private constructor();
|
|
@@ -1546,6 +1552,7 @@ declare class MutableDocument implements Document_2 {
|
|
|
1546
1552
|
convertToUnknownDocument(version: SnapshotVersion): MutableDocument;
|
|
1547
1553
|
setHasCommittedMutations(): MutableDocument;
|
|
1548
1554
|
setHasLocalMutations(): MutableDocument;
|
|
1555
|
+
setReadTime(readTime: SnapshotVersion): MutableDocument;
|
|
1549
1556
|
get hasLocalMutations(): boolean;
|
|
1550
1557
|
get hasCommittedMutations(): boolean;
|
|
1551
1558
|
get hasPendingWrites(): boolean;
|