@firebase/firestore 3.4.5 → 3.4.6-canary.3198d58dc

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.
Files changed (167) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/firestore/src/core/bundle.d.ts +2 -2
  3. package/dist/firestore/src/core/bundle_impl.d.ts +2 -0
  4. package/dist/firestore/src/core/query.d.ts +7 -0
  5. package/dist/firestore/src/core/snapshot_version.d.ts +1 -0
  6. package/dist/firestore/src/core/sync_engine_impl.d.ts +1 -1
  7. package/dist/firestore/src/index/index_entry.d.ts +6 -0
  8. package/dist/firestore/src/local/document_overlay_cache.d.ts +4 -5
  9. package/dist/firestore/src/local/index_manager.d.ts +2 -2
  10. package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  11. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
  12. package/dist/firestore/src/local/indexeddb_mutation_batch_impl.d.ts +2 -1
  13. package/dist/firestore/src/local/indexeddb_remote_document_cache.d.ts +0 -17
  14. package/dist/firestore/src/local/indexeddb_schema.d.ts +47 -563
  15. package/dist/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  16. package/dist/firestore/src/local/indexeddb_schema_legacy.d.ts +29 -0
  17. package/dist/firestore/src/local/indexeddb_sentinels.d.ts +243 -0
  18. package/dist/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
  19. package/dist/firestore/src/local/local_documents_view.d.ts +3 -4
  20. package/dist/firestore/src/local/local_serializer.d.ts +3 -1
  21. package/dist/firestore/src/local/local_store_impl.d.ts +1 -7
  22. package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  23. package/dist/firestore/src/local/memory_index_manager.d.ts +1 -1
  24. package/dist/firestore/src/local/remote_document_cache.d.ts +13 -4
  25. package/dist/firestore/src/local/shared_client_state.d.ts +6 -3
  26. package/dist/firestore/src/local/shared_client_state_schema.d.ts +1 -1
  27. package/dist/firestore/src/local/shared_client_state_syncer.d.ts +1 -1
  28. package/dist/firestore/src/local/simple_db.d.ts +11 -0
  29. package/dist/firestore/src/model/collections.d.ts +7 -0
  30. package/dist/firestore/src/model/field_index.d.ts +10 -1
  31. package/dist/firestore/src/model/type_order.d.ts +2 -1
  32. package/dist/firestore/src/platform/node/base64.d.ts +1 -0
  33. package/dist/firestore/src/util/obj_map.d.ts +3 -0
  34. package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  35. package/dist/firestore/test/unit/local/test_index_manager.d.ts +1 -1
  36. package/dist/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -1
  37. package/dist/index.esm2017.js +4533 -4502
  38. package/dist/index.esm2017.js.map +1 -1
  39. package/dist/index.esm5.js +4455 -4308
  40. package/dist/index.esm5.js.map +1 -1
  41. package/dist/index.node.cjs.js +1606 -1180
  42. package/dist/index.node.cjs.js.map +1 -1
  43. package/dist/index.node.mjs +1606 -1180
  44. package/dist/index.node.mjs.map +1 -1
  45. package/dist/index.rn.js +4425 -4394
  46. package/dist/index.rn.js.map +1 -1
  47. package/dist/internal.d.ts +31 -10
  48. package/dist/lite/firestore/src/core/bundle.d.ts +2 -2
  49. package/dist/lite/firestore/src/core/bundle_impl.d.ts +2 -0
  50. package/dist/lite/firestore/src/core/query.d.ts +7 -0
  51. package/dist/lite/firestore/src/core/snapshot_version.d.ts +1 -0
  52. package/dist/lite/firestore/src/core/sync_engine_impl.d.ts +1 -1
  53. package/dist/lite/firestore/src/index/index_entry.d.ts +6 -0
  54. package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +4 -5
  55. package/dist/lite/firestore/src/local/index_manager.d.ts +2 -2
  56. package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  57. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
  58. package/dist/lite/firestore/src/local/indexeddb_mutation_batch_impl.d.ts +2 -1
  59. package/dist/lite/firestore/src/local/indexeddb_remote_document_cache.d.ts +0 -17
  60. package/dist/lite/firestore/src/local/indexeddb_schema.d.ts +47 -563
  61. package/dist/lite/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  62. package/dist/lite/firestore/src/local/indexeddb_schema_legacy.d.ts +29 -0
  63. package/dist/lite/firestore/src/local/indexeddb_sentinels.d.ts +243 -0
  64. package/dist/lite/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
  65. package/dist/lite/firestore/src/local/local_documents_view.d.ts +3 -4
  66. package/dist/lite/firestore/src/local/local_serializer.d.ts +3 -1
  67. package/dist/lite/firestore/src/local/local_store_impl.d.ts +1 -7
  68. package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  69. package/dist/lite/firestore/src/local/memory_index_manager.d.ts +1 -1
  70. package/dist/lite/firestore/src/local/remote_document_cache.d.ts +13 -4
  71. package/dist/lite/firestore/src/local/shared_client_state.d.ts +6 -3
  72. package/dist/lite/firestore/src/local/shared_client_state_schema.d.ts +1 -1
  73. package/dist/lite/firestore/src/local/shared_client_state_syncer.d.ts +1 -1
  74. package/dist/lite/firestore/src/local/simple_db.d.ts +11 -0
  75. package/dist/lite/firestore/src/model/collections.d.ts +7 -0
  76. package/dist/lite/firestore/src/model/field_index.d.ts +10 -1
  77. package/dist/lite/firestore/src/model/type_order.d.ts +2 -1
  78. package/dist/lite/firestore/src/platform/node/base64.d.ts +1 -0
  79. package/dist/lite/firestore/src/util/obj_map.d.ts +3 -0
  80. package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  81. package/dist/lite/firestore/test/unit/local/test_index_manager.d.ts +1 -1
  82. package/dist/lite/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -1
  83. package/dist/lite/index.browser.esm2017.js +37 -24
  84. package/dist/lite/index.browser.esm2017.js.map +1 -1
  85. package/dist/lite/index.browser.esm5.js +104 -113
  86. package/dist/lite/index.browser.esm5.js.map +1 -1
  87. package/dist/lite/index.node.cjs.js +24 -9
  88. package/dist/lite/index.node.cjs.js.map +1 -1
  89. package/dist/lite/index.node.mjs +24 -9
  90. package/dist/lite/index.node.mjs.map +1 -1
  91. package/dist/lite/index.rn.esm2017.js +37 -24
  92. package/dist/lite/index.rn.esm2017.js.map +1 -1
  93. package/dist/lite/internal.d.ts +1 -0
  94. package/dist/lite/packages/firestore/src/core/bundle.d.ts +2 -2
  95. package/dist/lite/packages/firestore/src/core/bundle_impl.d.ts +2 -0
  96. package/dist/lite/packages/firestore/src/core/query.d.ts +7 -0
  97. package/dist/lite/packages/firestore/src/core/snapshot_version.d.ts +1 -0
  98. package/dist/lite/packages/firestore/src/core/sync_engine_impl.d.ts +1 -1
  99. package/dist/lite/packages/firestore/src/index/index_entry.d.ts +6 -0
  100. package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
  101. package/dist/lite/packages/firestore/src/local/index_manager.d.ts +2 -2
  102. package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  103. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
  104. package/dist/lite/packages/firestore/src/local/indexeddb_mutation_batch_impl.d.ts +2 -1
  105. package/dist/lite/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +0 -17
  106. package/dist/lite/packages/firestore/src/local/indexeddb_schema.d.ts +47 -563
  107. package/dist/lite/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  108. package/dist/lite/packages/firestore/src/local/indexeddb_schema_legacy.d.ts +29 -0
  109. package/dist/lite/packages/firestore/src/local/indexeddb_sentinels.d.ts +243 -0
  110. package/dist/lite/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
  111. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +3 -4
  112. package/dist/lite/packages/firestore/src/local/local_serializer.d.ts +3 -1
  113. package/dist/lite/packages/firestore/src/local/local_store_impl.d.ts +1 -7
  114. package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  115. package/dist/lite/packages/firestore/src/local/memory_index_manager.d.ts +1 -1
  116. package/dist/lite/packages/firestore/src/local/remote_document_cache.d.ts +13 -4
  117. package/dist/lite/packages/firestore/src/local/shared_client_state.d.ts +6 -3
  118. package/dist/lite/packages/firestore/src/local/shared_client_state_schema.d.ts +1 -1
  119. package/dist/lite/packages/firestore/src/local/shared_client_state_syncer.d.ts +1 -1
  120. package/dist/lite/packages/firestore/src/local/simple_db.d.ts +11 -0
  121. package/dist/lite/packages/firestore/src/model/collections.d.ts +7 -0
  122. package/dist/lite/packages/firestore/src/model/field_index.d.ts +10 -1
  123. package/dist/lite/packages/firestore/src/model/type_order.d.ts +2 -1
  124. package/dist/lite/packages/firestore/src/platform/node/base64.d.ts +1 -0
  125. package/dist/lite/packages/firestore/src/util/obj_map.d.ts +3 -0
  126. package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  127. package/dist/lite/packages/firestore/test/unit/local/test_index_manager.d.ts +1 -1
  128. package/dist/lite/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -1
  129. package/dist/lite/private.d.ts +1 -0
  130. package/dist/packages/firestore/dist/index.esm2017.d.ts +197 -197
  131. package/dist/packages/firestore/src/core/bundle.d.ts +2 -2
  132. package/dist/packages/firestore/src/core/bundle_impl.d.ts +2 -0
  133. package/dist/packages/firestore/src/core/query.d.ts +7 -0
  134. package/dist/packages/firestore/src/core/snapshot_version.d.ts +1 -0
  135. package/dist/packages/firestore/src/core/sync_engine_impl.d.ts +1 -1
  136. package/dist/packages/firestore/src/index/index_entry.d.ts +6 -0
  137. package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
  138. package/dist/packages/firestore/src/local/index_manager.d.ts +2 -2
  139. package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  140. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +48 -1
  141. package/dist/packages/firestore/src/local/indexeddb_mutation_batch_impl.d.ts +2 -1
  142. package/dist/packages/firestore/src/local/indexeddb_remote_document_cache.d.ts +0 -17
  143. package/dist/packages/firestore/src/local/indexeddb_schema.d.ts +47 -563
  144. package/dist/packages/firestore/src/local/indexeddb_schema_converter.d.ts +1 -0
  145. package/dist/packages/firestore/src/local/indexeddb_schema_legacy.d.ts +29 -0
  146. package/dist/packages/firestore/src/local/indexeddb_sentinels.d.ts +243 -0
  147. package/dist/packages/firestore/src/local/indexeddb_target_cache.d.ts +2 -1
  148. package/dist/packages/firestore/src/local/local_documents_view.d.ts +3 -4
  149. package/dist/packages/firestore/src/local/local_serializer.d.ts +3 -1
  150. package/dist/packages/firestore/src/local/local_store_impl.d.ts +1 -7
  151. package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  152. package/dist/packages/firestore/src/local/memory_index_manager.d.ts +1 -1
  153. package/dist/packages/firestore/src/local/remote_document_cache.d.ts +13 -4
  154. package/dist/packages/firestore/src/local/shared_client_state.d.ts +6 -3
  155. package/dist/packages/firestore/src/local/shared_client_state_schema.d.ts +1 -1
  156. package/dist/packages/firestore/src/local/shared_client_state_syncer.d.ts +1 -1
  157. package/dist/packages/firestore/src/local/simple_db.d.ts +11 -0
  158. package/dist/packages/firestore/src/model/collections.d.ts +7 -0
  159. package/dist/packages/firestore/src/model/field_index.d.ts +10 -1
  160. package/dist/packages/firestore/src/model/type_order.d.ts +2 -1
  161. package/dist/packages/firestore/src/platform/node/base64.d.ts +1 -0
  162. package/dist/packages/firestore/src/util/obj_map.d.ts +3 -0
  163. package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  164. package/dist/packages/firestore/test/unit/local/test_index_manager.d.ts +1 -1
  165. package/dist/packages/firestore/test/unit/local/test_remote_document_cache.d.ts +3 -1
  166. package/dist/private.d.ts +31 -10
  167. package/package.json +9 -9
@@ -38,4 +38,5 @@ export declare class SchemaConverter implements SimpleDbSchemaConverter {
38
38
  private ensureSequenceNumbers;
39
39
  private createCollectionParentIndex;
40
40
  private rewriteCanonicalIds;
41
+ private rewriteRemoteDocumentCache;
41
42
  }
@@ -0,0 +1,29 @@
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
+ import { Document as ProtoDocument } from '../protos/firestore_proto_api';
18
+ import { DbNoDocument, DbUnknownDocument } from './indexeddb_schema';
19
+ import { DbTimestampKey } from './indexeddb_sentinels';
20
+ export interface DbRemoteDocument {
21
+ unknownDocument?: DbUnknownDocument;
22
+ noDocument?: DbNoDocument;
23
+ document?: ProtoDocument;
24
+ hasCommittedMutations?: boolean;
25
+ readTime?: DbTimestampKey;
26
+ parentPath?: string[];
27
+ }
28
+ export declare type DbRemoteDocumentKey = string[];
29
+ export declare const DbRemoteDocumentStore = "remoteDocuments";
@@ -0,0 +1,243 @@
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
+ import { BatchId, TargetId } from '../core/types';
18
+ import { ResourcePath } from '../model/path';
19
+ import { EncodedResourcePath } from './encoded_resource_path';
20
+ import { DbDocumentMutation } from './indexeddb_schema';
21
+ /** A timestamp type that can be used in IndexedDb keys. */
22
+ export declare type DbTimestampKey = [/* seconds */ number, /* nanos */ number];
23
+ export declare type DbPrimaryClientKey = typeof DbPrimaryClientKey;
24
+ /**
25
+ * Name of the IndexedDb object store.
26
+ *
27
+ * Note that the name 'owner' is chosen to ensure backwards compatibility with
28
+ * older clients that only supported single locked access to the persistence
29
+ * layer.
30
+ */
31
+ export declare const DbPrimaryClientStore = "owner";
32
+ /**
33
+ * The key string used for the single object that exists in the
34
+ * DbPrimaryClient store.
35
+ */
36
+ export declare const DbPrimaryClientKey = "owner";
37
+ /** Object keys in the 'mutationQueues' store are userId strings. */
38
+ export declare type DbMutationQueueKey = string;
39
+ /** Name of the IndexedDb object store. */
40
+ export declare const DbMutationQueueStore = "mutationQueues";
41
+ /** Keys are automatically assigned via the userId property. */
42
+ export declare const DbMutationQueueKeyPath = "userId";
43
+ /** The 'mutations' store is keyed by batch ID. */
44
+ export declare type DbMutationBatchKey = BatchId;
45
+ /** Name of the IndexedDb object store. */
46
+ export declare const DbMutationBatchStore = "mutations";
47
+ /** Keys are automatically assigned via the userId, batchId properties. */
48
+ export declare const DbMutationBatchKeyPath = "batchId";
49
+ /** The index name for lookup of mutations by user. */
50
+ export declare const DbMutationBatchUserMutationsIndex = "userMutationsIndex";
51
+ /** The user mutations index is keyed by [userId, batchId] pairs. */
52
+ export declare const DbMutationBatchUserMutationsKeyPath: string[];
53
+ /**
54
+ * The key for a db document mutation, which is made up of a userID, path, and
55
+ * batchId. Note that the path must be serialized into a form that indexedDB can
56
+ * sort.
57
+ */
58
+ export declare type DbDocumentMutationKey = [string, EncodedResourcePath, BatchId];
59
+ /**
60
+ * Creates a [userId] key for use in the DbDocumentMutations index to iterate
61
+ * over all of a user's document mutations.
62
+ */
63
+ export declare function newDbDocumentMutationPrefixForUser(userId: string): [string];
64
+ /**
65
+ * Creates a [userId, encodedPath] key for use in the DbDocumentMutations
66
+ * index to iterate over all at document mutations for a given path or lower.
67
+ */
68
+ export declare function newDbDocumentMutationPrefixForPath(userId: string, path: ResourcePath): [string, EncodedResourcePath];
69
+ /**
70
+ * Creates a full index key of [userId, encodedPath, batchId] for inserting
71
+ * and deleting into the DbDocumentMutations index.
72
+ */
73
+ export declare function newDbDocumentMutationKey(userId: string, path: ResourcePath, batchId: BatchId): DbDocumentMutationKey;
74
+ /**
75
+ * Because we store all the useful information for this store in the key,
76
+ * there is no useful information to store as the value. The raw (unencoded)
77
+ * path cannot be stored because IndexedDb doesn't store prototype
78
+ * information.
79
+ */
80
+ export declare const DbDocumentMutationPlaceholder: DbDocumentMutation;
81
+ export declare const DbDocumentMutationStore = "documentMutations";
82
+ export declare const DbRemoteDocumentStore = "remoteDocumentsV14";
83
+ /**
84
+ * A key in the 'remoteDocumentsV14' object store is an array containing the
85
+ * collection path, the collection group, the read time and the document id.
86
+ */
87
+ export declare type DbRemoteDocumentKey = [
88
+ /** path to collection */ string[],
89
+ /** collection group */ string,
90
+ /** read time */ DbTimestampKey,
91
+ /** document ID */ string
92
+ ];
93
+ /**
94
+ * The primary key of the remote documents store, which allows for efficient
95
+ * access by collection path and read time.
96
+ */
97
+ export declare const DbRemoteDocumentKeyPath: string[];
98
+ /** An index that provides access to documents by key. */
99
+ export declare const DbRemoteDocumentDocumentKeyIndex = "documentKeyIndex";
100
+ export declare const DbRemoteDocumentDocumentKeyIndexPath: string[];
101
+ /**
102
+ * An index that provides access to documents by collection group and read
103
+ * time.
104
+ *
105
+ * This index is used by the index backfiller.
106
+ */
107
+ export declare const DbRemoteDocumentCollectionGroupIndex = "collectionGroupIndex";
108
+ export declare const DbRemoteDocumentCollectionGroupIndexPath: string[];
109
+ export declare const DbRemoteDocumentGlobalStore = "remoteDocumentGlobal";
110
+ export declare const DbRemoteDocumentGlobalKey = "remoteDocumentGlobalKey";
111
+ export declare type DbRemoteDocumentGlobalKey = typeof DbRemoteDocumentGlobalKey;
112
+ /**
113
+ * A key in the 'targets' object store is a targetId of the query.
114
+ */
115
+ export declare type DbTargetKey = TargetId;
116
+ export declare const DbTargetStore = "targets";
117
+ /** Keys are automatically assigned via the targetId property. */
118
+ export declare const DbTargetKeyPath = "targetId";
119
+ /** The name of the queryTargets index. */
120
+ export declare const DbTargetQueryTargetsIndexName = "queryTargetsIndex";
121
+ /**
122
+ * The index of all canonicalIds to the targets that they match. This is not
123
+ * a unique mapping because canonicalId does not promise a unique name for all
124
+ * possible queries, so we append the targetId to make the mapping unique.
125
+ */
126
+ export declare const DbTargetQueryTargetsKeyPath: string[];
127
+ /**
128
+ * The key for a DbTargetDocument, containing a targetId and an encoded resource
129
+ * path.
130
+ */
131
+ export declare type DbTargetDocumentKey = [TargetId, EncodedResourcePath];
132
+ /** Name of the IndexedDb object store. */
133
+ export declare const DbTargetDocumentStore = "targetDocuments";
134
+ /** Keys are automatically assigned via the targetId, path properties. */
135
+ export declare const DbTargetDocumentKeyPath: string[];
136
+ /** The index name for the reverse index. */
137
+ export declare const DbTargetDocumentDocumentTargetsIndex = "documentTargetsIndex";
138
+ /** We also need to create the reverse index for these properties. */
139
+ export declare const DbTargetDocumentDocumentTargetsKeyPath: string[];
140
+ /**
141
+ * The type to represent the single allowed key for the DbTargetGlobal store.
142
+ */
143
+ export declare type DbTargetGlobalKey = typeof DbTargetGlobalKey;
144
+ /**
145
+ * The key string used for the single object that exists in the
146
+ * DbTargetGlobal store.
147
+ */
148
+ export declare const DbTargetGlobalKey = "targetGlobalKey";
149
+ export declare const DbTargetGlobalStore = "targetGlobal";
150
+ /**
151
+ * The key for a DbCollectionParent entry, containing the collection ID
152
+ * and the parent path that contains it. Note that the parent path will be an
153
+ * empty path in the case of root-level collections.
154
+ */
155
+ export declare type DbCollectionParentKey = [string, EncodedResourcePath];
156
+ /** Name of the IndexedDb object store. */
157
+ export declare const DbCollectionParentStore = "collectionParents";
158
+ /** Keys are automatically assigned via the collectionId, parent properties. */
159
+ export declare const DbCollectionParentKeyPath: string[];
160
+ /** Name of the IndexedDb object store. */
161
+ export declare const DbClientMetadataStore = "clientMetadata";
162
+ /** Keys are automatically assigned via the clientId properties. */
163
+ export declare const DbClientMetadataKeyPath = "clientId";
164
+ /** Object keys in the 'clientMetadata' store are clientId strings. */
165
+ export declare type DbClientMetadataKey = string;
166
+ export declare type DbBundlesKey = string;
167
+ /** Name of the IndexedDb object store. */
168
+ export declare const DbBundleStore = "bundles";
169
+ export declare const DbBundleKeyPath = "bundleId";
170
+ export declare type DbNamedQueriesKey = string;
171
+ /** Name of the IndexedDb object store. */
172
+ export declare const DbNamedQueryStore = "namedQueries";
173
+ export declare const DbNamedQueryKeyPath = "name";
174
+ /** The key for each index consisting of just the index id. */
175
+ export declare type DbIndexConfigurationKey = number;
176
+ /** Name of the IndexedDb object store. */
177
+ export declare const DbIndexConfigurationStore = "indexConfiguration";
178
+ export declare const DbIndexConfigurationKeyPath = "indexId";
179
+ /**
180
+ * An index that provides access to the index configurations by collection
181
+ * group.
182
+ *
183
+ * PORTING NOTE: iOS and Android maintain this index in-memory, but this is
184
+ * not possible here as the Web client supports concurrent access to
185
+ * persistence via multi-tab.
186
+ */
187
+ export declare const DbIndexConfigurationCollectionGroupIndex = "collectionGroupIndex";
188
+ export declare const DbIndexConfigurationCollectionGroupIndexPath = "collectionGroup";
189
+ /** The key for each index state consisting of the index id and its user id. */
190
+ export declare type DbIndexStateKey = [number, string];
191
+ /** Name of the IndexedDb object store. */
192
+ export declare const DbIndexStateStore = "indexState";
193
+ export declare const DbIndexStateKeyPath: string[];
194
+ /**
195
+ * An index that provides access to documents in a collection sorted by last
196
+ * update time. Used by the backfiller.
197
+ *
198
+ * PORTING NOTE: iOS and Android maintain this index in-memory, but this is
199
+ * not possible here as the Web client supports concurrent access to
200
+ * persistence via multi-tab.
201
+ */
202
+ export declare const DbIndexStateSequenceNumberIndex = "sequenceNumberIndex";
203
+ export declare const DbIndexStateSequenceNumberIndexPath: string[];
204
+ /**
205
+ * The key for each index entry consists of the index id and its user id,
206
+ * the encoded array and directional value for the indexed fields as well as
207
+ * the encoded document path for the indexed document.
208
+ */
209
+ export declare type DbIndexEntryKey = [number, string, Uint8Array, Uint8Array, string];
210
+ /** Name of the IndexedDb object store. */
211
+ export declare const DbIndexEntryStore = "indexEntries";
212
+ export declare const DbIndexEntryKeyPath: string[];
213
+ export declare const DbIndexEntryDocumentKeyIndex = "documentKeyIndex";
214
+ export declare const DbIndexEntryDocumentKeyIndexPath: string[];
215
+ export declare type DbDocumentOverlayKey = [
216
+ string,
217
+ string,
218
+ string
219
+ ];
220
+ /** Name of the IndexedDb object store. */
221
+ export declare const DbDocumentOverlayStore = "documentOverlays";
222
+ export declare const DbDocumentOverlayKeyPath: string[];
223
+ export declare const DbDocumentOverlayCollectionPathOverlayIndex = "collectionPathOverlayIndex";
224
+ export declare const DbDocumentOverlayCollectionPathOverlayIndexPath: string[];
225
+ export declare const DbDocumentOverlayCollectionGroupOverlayIndex = "collectionGroupOverlayIndex";
226
+ export declare const DbDocumentOverlayCollectionGroupOverlayIndexPath: string[];
227
+ export declare const V1_STORES: string[];
228
+ export declare const V3_STORES: string[];
229
+ export declare const V4_STORES: string[];
230
+ export declare const V6_STORES: string[];
231
+ export declare const V8_STORES: string[];
232
+ export declare const V11_STORES: string[];
233
+ export declare const V12_STORES: string[];
234
+ export declare const V13_STORES: string[];
235
+ export declare const V14_STORES: string[];
236
+ /**
237
+ * The list of all default IndexedDB stores used throughout the SDK. This is
238
+ * used when creating transactions so that access across all stores is done
239
+ * atomically.
240
+ */
241
+ export declare const ALL_STORES: string[];
242
+ /** Returns the object stores for the provided schema. */
243
+ export declare function getObjectStores(schemaVersion: number): string[];
@@ -20,7 +20,8 @@ import { ListenSequenceNumber, TargetId } from '../core/types';
20
20
  import { DocumentKeySet } from '../model/collections';
21
21
  import { DocumentKey } from '../model/document_key';
22
22
  import { IndexedDbLruDelegate } from './indexeddb_lru_delegate';
23
- import { DbTargetDocument, DbTargetDocumentKey } from './indexeddb_schema';
23
+ import { DbTargetDocument } from './indexeddb_schema';
24
+ import { DbTargetDocumentKey } from './indexeddb_sentinels';
24
25
  import { LocalSerializer } from './local_serializer';
25
26
  import { ActiveTargets } from './lru_garbage_collector';
26
27
  import { PersistencePromise } from './persistence_promise';
@@ -15,10 +15,10 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { Query } from '../core/query';
18
- import { SnapshotVersion } from '../core/snapshot_version';
19
18
  import { DocumentKeySet, DocumentMap, MutableDocumentMap } from '../model/collections';
20
19
  import { Document } from '../model/document';
21
20
  import { DocumentKey } from '../model/document_key';
21
+ import { IndexOffset } from '../model/field_index';
22
22
  import { IndexManager } from './index_manager';
23
23
  import { MutationQueue } from './mutation_queue';
24
24
  import { PersistencePromise } from './persistence_promise';
@@ -62,10 +62,9 @@ export declare class LocalDocumentsView {
62
62
  *
63
63
  * @param transaction - The persistence transaction.
64
64
  * @param query - The query to match documents against.
65
- * @param sinceReadTime - If not set to SnapshotVersion.min(), return only
66
- * documents that have been read since this snapshot version (exclusive).
65
+ * @param offset - Read time and key to start scanning by (exclusive).
67
66
  */
68
- getDocumentsMatchingQuery(transaction: PersistenceTransaction, query: Query, sinceReadTime: SnapshotVersion): PersistencePromise<DocumentMap>;
67
+ getDocumentsMatchingQuery(transaction: PersistenceTransaction, query: Query, offset: IndexOffset): PersistencePromise<DocumentMap>;
69
68
  private getDocumentsMatchingDocumentQuery;
70
69
  private getDocumentsMatchingCollectionGroupQuery;
71
70
  private getDocumentsMatchingCollectionQuery;
@@ -25,7 +25,8 @@ import { MutationBatch } from '../model/mutation_batch';
25
25
  import { Overlay } from '../model/overlay';
26
26
  import { BundledQuery as ProtoBundledQuery, BundleMetadata as ProtoBundleMetadata, NamedQuery as ProtoNamedQuery } from '../protos/firestore_bundle_proto';
27
27
  import { JsonProtoSerializer } from '../remote/serializer';
28
- import { DbBundle, DbDocumentOverlay, DbDocumentOverlayKey, DbIndexConfiguration, DbIndexState, DbMutationBatch, DbNamedQuery, DbRemoteDocument, DbTarget, DbTimestampKey } from './indexeddb_schema';
28
+ import { DbBundle, DbDocumentOverlay, DbIndexConfiguration, DbIndexState, DbMutationBatch, DbNamedQuery, DbRemoteDocument, DbTarget, DbTimestamp } from './indexeddb_schema';
29
+ import { DbDocumentOverlayKey, DbTimestampKey } from './indexeddb_sentinels';
29
30
  import { TargetData } from './target_data';
30
31
  /** Serializer for values stored in the LocalStore. */
31
32
  export declare class LocalSerializer {
@@ -38,6 +39,7 @@ export declare function fromDbRemoteDocument(localSerializer: LocalSerializer, r
38
39
  export declare function toDbRemoteDocument(localSerializer: LocalSerializer, document: MutableDocument): DbRemoteDocument;
39
40
  export declare function toDbTimestampKey(snapshotVersion: SnapshotVersion): DbTimestampKey;
40
41
  export declare function fromDbTimestampKey(dbTimestampKey: DbTimestampKey): SnapshotVersion;
42
+ export declare function toDbTimestamp(snapshotVersion: SnapshotVersion): DbTimestamp;
41
43
  /** Encodes a batch of mutations into a DbMutationBatch for local storage. */
42
44
  export declare function toDbMutationBatch(localSerializer: LocalSerializer, userId: string, batch: MutationBatch): DbMutationBatch;
43
45
  /** Decodes a DbMutationBatch into a MutationBatch */
@@ -165,13 +165,7 @@ export declare function localStoreGetCachedTarget(localStore: LocalStore, target
165
165
  * initialization. Further invocations will return document that have changed
166
166
  * since the prior call.
167
167
  */
168
- export declare function localStoreGetNewDocumentChanges(localStore: LocalStore): Promise<DocumentMap>;
169
- /**
170
- * Reads the newest document change from persistence and moves the internal
171
- * synchronization marker forward so that calls to `getNewDocumentChanges()`
172
- * only return changes that happened after client initialization.
173
- */
174
- export declare function localStoreSynchronizeLastDocumentChangeReadTime(localStore: LocalStore): Promise<void>;
168
+ export declare function localStoreGetNewDocumentChanges(localStore: LocalStore, collectionGroup: string): Promise<DocumentMap>;
175
169
  /**
176
170
  * Applies the documents from a bundle to the "ground-state" (remote)
177
171
  * documents.
@@ -14,9 +14,8 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { DocumentKeySet } from '../model/collections';
17
+ import { DocumentKeySet, MutationMap, OverlayMap } from '../model/collections';
18
18
  import { DocumentKey } from '../model/document_key';
19
- import { Mutation } from '../model/mutation';
20
19
  import { Overlay } from '../model/overlay';
21
20
  import { ResourcePath } from '../model/path';
22
21
  import { DocumentOverlayCache } from './document_overlay_cache';
@@ -29,9 +28,9 @@ export declare class MemoryDocumentOverlayCache implements DocumentOverlayCache
29
28
  private overlays;
30
29
  private overlayByBatchId;
31
30
  getOverlay(transaction: PersistenceTransaction, key: DocumentKey): PersistencePromise<Overlay | null>;
32
- saveOverlays(transaction: PersistenceTransaction, largestBatchId: number, overlays: Map<DocumentKey, Mutation>): PersistencePromise<void>;
31
+ saveOverlays(transaction: PersistenceTransaction, largestBatchId: number, overlays: MutationMap): PersistencePromise<void>;
33
32
  removeOverlaysForBatchId(transaction: PersistenceTransaction, documentKeys: DocumentKeySet, batchId: number): PersistencePromise<void>;
34
- getOverlaysForCollection(transaction: PersistenceTransaction, collection: ResourcePath, sinceBatchId: number): PersistencePromise<Map<DocumentKey, Overlay>>;
35
- getOverlaysForCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, sinceBatchId: number, count: number): PersistencePromise<Map<DocumentKey, Overlay>>;
33
+ getOverlaysForCollection(transaction: PersistenceTransaction, collection: ResourcePath, sinceBatchId: number): PersistencePromise<OverlayMap>;
34
+ getOverlaysForCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, sinceBatchId: number, count: number): PersistencePromise<OverlayMap>;
36
35
  private saveOverlay;
37
36
  }
@@ -30,7 +30,7 @@ export declare class MemoryIndexManager implements IndexManager {
30
30
  getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<ResourcePath[]>;
31
31
  addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
32
32
  deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
33
- getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
33
+ getDocumentsMatchingTarget(transaction: PersistenceTransaction, target: Target): PersistencePromise<DocumentKeySet | null>;
34
34
  getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
35
35
  getFieldIndexes(transaction: PersistenceTransaction, collectionGroup?: string): PersistencePromise<FieldIndex[]>;
36
36
  getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
@@ -14,10 +14,10 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { SnapshotVersion } from '../core/snapshot_version';
18
17
  import { DocumentKeySet, MutableDocumentMap } from '../model/collections';
19
18
  import { MutableDocument } from '../model/document';
20
19
  import { DocumentKey } from '../model/document_key';
20
+ import { IndexOffset } from '../model/field_index';
21
21
  import { ResourcePath } from '../model/path';
22
22
  import { IndexManager } from './index_manager';
23
23
  import { PersistencePromise } from './persistence_promise';
@@ -53,11 +53,20 @@ export interface RemoteDocumentCache {
53
53
  * Returns the documents from the provided collection.
54
54
  *
55
55
  * @param collection - The collection to read.
56
- * @param sinceReadTime - If not set to SnapshotVersion.min(), return only
57
- * documents that have been read since this snapshot version (exclusive).
56
+ * @param offset - The offset to start the scan at (exclusive).
58
57
  * @returns The set of matching documents.
59
58
  */
60
- getAll(transaction: PersistenceTransaction, collection: ResourcePath, sinceReadTime: SnapshotVersion): PersistencePromise<MutableDocumentMap>;
59
+ getAllFromCollection(transaction: PersistenceTransaction, collection: ResourcePath, offset: IndexOffset): PersistencePromise<MutableDocumentMap>;
60
+ /**
61
+ * Looks up the next `limit` documents for a collection group based on the
62
+ * provided offset. The ordering is based on the document's read time and key.
63
+ *
64
+ * @param collectionGroup - The collection group to scan.
65
+ * @param offset - The offset to start the scan at (exclusive).
66
+ * @param limit - The maximum number of results to return.
67
+ * @returns The set of matching documents.
68
+ */
69
+ getAllFromCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset, limit: number): PersistencePromise<MutableDocumentMap>;
61
70
  /**
62
71
  * Provides access to add or update the contents of the cache. The buffer
63
72
  * handles proper size accounting for the change.
@@ -113,8 +113,10 @@ export interface SharedClientState {
113
113
  /**
114
114
  * Notifies other clients when remote documents have changed due to loading
115
115
  * a bundle.
116
+ *
117
+ * @param collectionGroups The collection groups affected by this bundle.
116
118
  */
117
- notifyBundleLoaded(): void;
119
+ notifyBundleLoaded(collectionGroups: Set<string>): void;
118
120
  }
119
121
  /**
120
122
  * Holds the state of a mutation batch, including its user ID, batch ID and
@@ -237,7 +239,7 @@ export declare class WebStorageSharedClientState implements SharedClientState {
237
239
  updateQueryState(targetId: TargetId, state: QueryTargetState, error?: FirestoreError): void;
238
240
  handleUserChange(user: User, removedBatchIds: BatchId[], addedBatchIds: BatchId[]): void;
239
241
  setOnlineState(onlineState: OnlineState): void;
240
- notifyBundleLoaded(): void;
242
+ notifyBundleLoaded(collectionGroups: Set<string>): void;
241
243
  shutdown(): void;
242
244
  private getItem;
243
245
  private setItem;
@@ -275,6 +277,7 @@ export declare class WebStorageSharedClientState implements SharedClientState {
275
277
  * could not be parsed.
276
278
  */
277
279
  private fromWebStorageOnlineState;
280
+ private fromWebStoreBundleLoadedState;
278
281
  private handleMutationBatchEvent;
279
282
  private handleQueryTargetEvent;
280
283
  private handleClientStateEvent;
@@ -305,5 +308,5 @@ export declare class MemorySharedClientState implements SharedClientState {
305
308
  setOnlineState(onlineState: OnlineState): void;
306
309
  shutdown(): void;
307
310
  writeSequenceNumber(sequenceNumber: ListenSequenceNumber): void;
308
- notifyBundleLoaded(): void;
311
+ notifyBundleLoaded(collectionGroups: Set<string>): void;
309
312
  }
@@ -64,7 +64,7 @@ export interface QueryTargetStateSchema {
64
64
  export declare const ONLINE_STATE_KEY_PREFIX = "firestore_online_state";
65
65
  /** Assembles the key for the online state of the primary tab. */
66
66
  export declare function createWebStorageOnlineStateKey(persistenceKey: string): string;
67
- export declare const BUNDLE_LOADED_KEY_PREFIX = "firestore_bundle_loaded";
67
+ export declare const BUNDLE_LOADED_KEY_PREFIX = "firestore_bundle_loaded_v2";
68
68
  export declare function createBundleLoadedKey(persistenceKey: string): string;
69
69
  /**
70
70
  * The JSON representation of the system's online state, as written by the
@@ -36,5 +36,5 @@ export interface SharedClientStateSyncer {
36
36
  * Retrieves newly changed documents from remote document cache and raises
37
37
  * snapshots if needed.
38
38
  */
39
- synchronizeWithChangedDocuments(): Promise<void>;
39
+ synchronizeWithChangedDocuments(collectionGroup: string): Promise<void>;
40
40
  }
@@ -182,9 +182,20 @@ export declare class SimpleDbStore<KeyType extends IDBValidKey, ValueType extend
182
182
  * Returns the number of rows in the store.
183
183
  */
184
184
  count(): PersistencePromise<number>;
185
+ /** Loads all elements from the object store. */
185
186
  loadAll(): PersistencePromise<ValueType[]>;
187
+ /** Loads all elements for the index range from the object store. */
186
188
  loadAll(range: IDBKeyRange): PersistencePromise<ValueType[]>;
189
+ /**
190
+ * Loads all elements from the object store that fall into the provided in the
191
+ * index range for the given index.
192
+ */
187
193
  loadAll(index: string, range: IDBKeyRange): PersistencePromise<ValueType[]>;
194
+ /**
195
+ * Loads the first `count` elements from the provided index range. Loads all
196
+ * elements if no limit is provided.
197
+ */
198
+ loadFirst(range: IDBKeyRange, count: number | null): PersistencePromise<ValueType[]>;
188
199
  deleteAll(): PersistencePromise<void>;
189
200
  deleteAll(range: IDBKeyRange): PersistencePromise<void>;
190
201
  deleteAll(index: string, range: IDBKeyRange): PersistencePromise<void>;
@@ -16,10 +16,13 @@
16
16
  */
17
17
  import { SnapshotVersion } from '../core/snapshot_version';
18
18
  import { TargetId } from '../core/types';
19
+ import { ObjectMap } from '../util/obj_map';
19
20
  import { SortedMap } from '../util/sorted_map';
20
21
  import { SortedSet } from '../util/sorted_set';
21
22
  import { Document, MutableDocument } from './document';
22
23
  import { DocumentKey } from './document_key';
24
+ import { Mutation } from './mutation';
25
+ import { Overlay } from './overlay';
23
26
  /** Miscellaneous collection types / constants. */
24
27
  export declare type MutableDocumentMap = SortedMap<DocumentKey, MutableDocument>;
25
28
  export declare function mutableDocumentMap(): MutableDocumentMap;
@@ -29,6 +32,10 @@ export interface DocumentSizeEntries {
29
32
  }
30
33
  export declare type DocumentMap = SortedMap<DocumentKey, Document>;
31
34
  export declare function documentMap(): DocumentMap;
35
+ export declare type OverlayMap = ObjectMap<DocumentKey, Overlay>;
36
+ export declare function newOverlayMap(): OverlayMap;
37
+ export declare type MutationMap = ObjectMap<DocumentKey, Mutation>;
38
+ export declare function newMutationMap(): MutationMap;
32
39
  export declare type DocumentVersionMap = SortedMap<DocumentKey, SnapshotVersion>;
33
40
  export declare function documentVersionMap(): DocumentVersionMap;
34
41
  export declare type DocumentKeySet = SortedSet<DocumentKey>;
@@ -18,6 +18,11 @@ import { SnapshotVersion } from '../core/snapshot_version';
18
18
  import { Document } from './document';
19
19
  import { DocumentKey } from './document_key';
20
20
  import { FieldPath } from './path';
21
+ /**
22
+ * The initial mutation batch id for each index. Gets updated during index
23
+ * backfill.
24
+ */
25
+ export declare const INITIAL_LARGEST_BATCH_ID = -1;
21
26
  /**
22
27
  * The initial sequence number for each index. Gets updated during index
23
28
  * backfill.
@@ -70,6 +75,8 @@ export declare function fieldIndexGetDirectionalSegments(fieldIndex: FieldIndex)
70
75
  * index ID.
71
76
  */
72
77
  export declare function fieldIndexSemanticComparator(left: FieldIndex, right: FieldIndex): number;
78
+ /** Returns a debug representation of the field index */
79
+ export declare function fieldIndexToString(fieldIndex: FieldIndex): string;
73
80
  /** The type of the index, e.g. for which type of query it can be used. */
74
81
  export declare const enum IndexKind {
75
82
  /**
@@ -150,7 +157,9 @@ export declare class IndexOffset {
150
157
  * `DocumentKey.empty()` if no document has been indexed.
151
158
  */
152
159
  documentKey: DocumentKey, largestBatchId: number);
153
- /** The state of an index that has not yet been backfilled. */
160
+ /** Returns an offset that sorts before all regular offsets. */
154
161
  static min(): IndexOffset;
162
+ /** Returns an offset that sorts after all regular offsets. */
163
+ static max(): IndexOffset;
155
164
  }
156
165
  export declare function indexOffsetComparator(left: IndexOffset, right: IndexOffset): number;
@@ -32,5 +32,6 @@ export declare const enum TypeOrder {
32
32
  RefValue = 7,
33
33
  GeoPointValue = 8,
34
34
  ArrayValue = 9,
35
- ObjectValue = 10
35
+ ObjectValue = 10,
36
+ MaxValue = 9007199254740991
36
37
  }
@@ -14,6 +14,7 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ /** Converts a Base64 encoded string to a binary string. */
17
18
  export declare function decodeBase64(encoded: string): string;
18
19
  /** Converts a binary string to a Base64 encoded string. */
19
20
  export declare function encodeBase64(raw: string): string;
@@ -30,6 +30,8 @@ export declare class ObjectMap<KeyType, ValueType> {
30
30
  * constant time lookups in practice.
31
31
  */
32
32
  private inner;
33
+ /** The number of entries stored in the map */
34
+ private innerSize;
33
35
  constructor(mapKeyFn: (key: KeyType) => string, equalsFn: (l: KeyType, r: KeyType) => boolean);
34
36
  /** Get a value for this key, or undefined if it does not exist. */
35
37
  get(key: KeyType): ValueType | undefined;
@@ -42,4 +44,5 @@ export declare class ObjectMap<KeyType, ValueType> {
42
44
  delete(key: KeyType): boolean;
43
45
  forEach(fn: (key: KeyType, val: ValueType) => void): void;
44
46
  isEmpty(): boolean;
47
+ size(): number;
45
48
  }
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { DocumentOverlayCache } from '../../../src/local/document_overlay_cache';
18
18
  import { Persistence } from '../../../src/local/persistence';
19
- import { DocumentKeySet } from '../../../src/model/collections';
19
+ import { DocumentKeySet, MutationMap, OverlayMap } from '../../../src/model/collections';
20
20
  import { DocumentKey } from '../../../src/model/document_key';
21
21
  import { Mutation } from '../../../src/model/mutation';
22
22
  import { Overlay } from '../../../src/model/overlay';
@@ -29,10 +29,10 @@ export declare class TestDocumentOverlayCache {
29
29
  private persistence;
30
30
  private cache;
31
31
  constructor(persistence: Persistence, cache: DocumentOverlayCache);
32
- saveOverlays(largestBatch: number, data: Map<DocumentKey, Mutation>): Promise<void>;
32
+ saveOverlays(largestBatch: number, data: MutationMap): Promise<void>;
33
33
  getOverlay(key: DocumentKey): Promise<Overlay | null>;
34
34
  getOverlayMutation(docKey: string): Promise<Mutation | null>;
35
- getOverlaysForCollection(path: ResourcePath, sinceBatchId: number): Promise<Map<DocumentKey, Overlay>>;
36
- getOverlaysForCollectionGroup(collectionGroup: string, sinceBatchId: number, count: number): Promise<Map<DocumentKey, Overlay>>;
35
+ getOverlaysForCollection(path: ResourcePath, sinceBatchId: number): Promise<OverlayMap>;
36
+ getOverlaysForCollectionGroup(collectionGroup: string, sinceBatchId: number, count: number): Promise<OverlayMap>;
37
37
  removeOverlaysForBatchId(documentKeys: DocumentKeySet, batchId: number): Promise<void>;
38
38
  }
@@ -34,7 +34,7 @@ export declare class TestIndexManager {
34
34
  deleteFieldIndex(index: FieldIndex): Promise<void>;
35
35
  getFieldIndexes(collectionGroup?: string): Promise<FieldIndex[]>;
36
36
  getFieldIndex(target: Target): Promise<FieldIndex | null>;
37
- getDocumentsMatchingTarget(fieldIndex: FieldIndex, target: Target): Promise<DocumentKeySet>;
37
+ getDocumentsMatchingTarget(target: Target): Promise<DocumentKeySet | null>;
38
38
  getNextCollectionGroupToUpdate(): Promise<string | null>;
39
39
  updateCollectionGroup(collectionGroup: string, offset: IndexOffset): Promise<void>;
40
40
  updateIndexEntries(documents: DocumentMap): Promise<void>;
@@ -21,6 +21,7 @@ import { RemoteDocumentChangeBuffer } from '../../../src/local/remote_document_c
21
21
  import { DocumentKeySet, MutableDocumentMap } from '../../../src/model/collections';
22
22
  import { MutableDocument } from '../../../src/model/document';
23
23
  import { DocumentKey } from '../../../src/model/document_key';
24
+ import { IndexOffset } from '../../../src/model/field_index';
24
25
  import { ResourcePath } from '../../../src/model/path';
25
26
  /**
26
27
  * A wrapper around a RemoteDocumentCache that automatically creates a
@@ -44,7 +45,8 @@ export declare class TestRemoteDocumentCache {
44
45
  removeEntry(documentKey: DocumentKey, version?: SnapshotVersion): Promise<void>;
45
46
  getEntry(documentKey: DocumentKey): Promise<MutableDocument>;
46
47
  getEntries(documentKeys: DocumentKeySet): Promise<MutableDocumentMap>;
47
- getAll(collection: ResourcePath, sinceReadTime: SnapshotVersion): Promise<MutableDocumentMap>;
48
+ getAllFromCollection(collection: ResourcePath, offset: IndexOffset): Promise<MutableDocumentMap>;
49
+ getAllFromCollectionGroup(collectionGroup: string, offset: IndexOffset, limit: number): Promise<MutableDocumentMap>;
48
50
  getNewDocumentChanges(sinceReadTime: SnapshotVersion): Promise<{
49
51
  changedDocs: MutableDocumentMap;
50
52
  readTime: SnapshotVersion;