@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @firebase/firestore
2
2
 
3
+ ## 3.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`2d672cead`](https://github.com/firebase/firebase-js-sdk/commit/2d672cead167187cb714cd89b638c0884ba58f03)]:
8
+ - @firebase/util@1.5.0
9
+ - @firebase/component@0.5.11
10
+
3
11
  ## 3.4.5
4
12
 
5
13
  ### Patch Changes
@@ -34,10 +34,10 @@ export interface BundledDocument {
34
34
  * An array of `BundledDocument`.
35
35
  */
36
36
  export declare type BundledDocuments = BundledDocument[];
37
- export declare class BundleLoadResult {
37
+ export interface BundleLoadResult {
38
38
  readonly progress: LoadBundleTaskProgress;
39
+ readonly changedCollectionGroups: Set<string>;
39
40
  readonly changedDocs: DocumentMap;
40
- constructor(progress: LoadBundleTaskProgress, changedDocs: DocumentMap);
41
41
  }
42
42
  /**
43
43
  * Represents a Firestore bundle saved by the SDK in its local storage.
@@ -51,6 +51,8 @@ export declare class BundleLoader {
51
51
  private queries;
52
52
  /** Batched documents to be saved into storage */
53
53
  private documents;
54
+ /** The collection groups affected by this bundle. */
55
+ private collectionGroups;
54
56
  constructor(bundleMetadata: ProtoBundleMetadata, localStore: LocalStore, serializer: JsonProtoSerializer);
55
57
  /**
56
58
  * Adds an element from the bundle to the loader.
@@ -121,6 +121,13 @@ export declare function canonifyQuery(query: Query): string;
121
121
  export declare function stringifyQuery(query: Query): string;
122
122
  /** Returns whether `doc` matches the constraints of `query`. */
123
123
  export declare function queryMatches(query: Query, doc: Document): boolean;
124
+ /**
125
+ * Returns the collection group that this query targets.
126
+ *
127
+ * PORTING NOTE: This is only used in the Web SDK to facilitate multi-tab
128
+ * synchronization for query results.
129
+ */
130
+ export declare function queryCollectionGroup(query: Query): string;
124
131
  /**
125
132
  * Returns a new comparator function that can be used to compare two documents
126
133
  * based on the Query's ordering constraint.
@@ -23,6 +23,7 @@ export declare class SnapshotVersion {
23
23
  private timestamp;
24
24
  static fromTimestamp(value: Timestamp): SnapshotVersion;
25
25
  static min(): SnapshotVersion;
26
+ static max(): SnapshotVersion;
26
27
  private constructor();
27
28
  compareTo(other: SnapshotVersion): number;
28
29
  isEqual(other: SnapshotVersion): boolean;
@@ -227,7 +227,7 @@ export declare function syncEngineGetRemoteKeysForTarget(syncEngine: SyncEngine,
227
227
  * Retrieves newly changed documents from remote document cache and raises
228
228
  * snapshots if needed.
229
229
  */
230
- export declare function syncEngineSynchronizeWithChangedDocuments(syncEngine: SyncEngine): Promise<void>;
230
+ export declare function syncEngineSynchronizeWithChangedDocuments(syncEngine: SyncEngine, collectionGroup: string): Promise<void>;
231
231
  /** Applies a mutation state to an existing batch. */
232
232
  export declare function syncEngineApplyBatchState(syncEngine: SyncEngine, batchId: BatchId, batchState: MutationBatchState, error?: FirestoreError): Promise<void>;
233
233
  /** Applies a query target change from a different tab. */
@@ -22,5 +22,11 @@ export declare class IndexEntry {
22
22
  readonly arrayValue: Uint8Array;
23
23
  readonly directionalValue: Uint8Array;
24
24
  constructor(indexId: number, documentKey: DocumentKey, arrayValue: Uint8Array, directionalValue: Uint8Array);
25
+ /**
26
+ * Returns an IndexEntry entry that sorts immediately after the current
27
+ * directional value.
28
+ */
29
+ successor(): IndexEntry;
25
30
  }
26
31
  export declare function indexEntryComparator(left: IndexEntry, right: IndexEntry): number;
32
+ export declare function compareByteArrays(left: Uint8Array, right: Uint8Array): number;
@@ -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 { PersistencePromise } from './persistence_promise';
@@ -41,7 +40,7 @@ export interface DocumentOverlayCache {
41
40
  * Saves the given document mutation map to persistence as overlays.
42
41
  * All overlays will have their largest batch id set to `largestBatchId`.
43
42
  */
44
- saveOverlays(transaction: PersistenceTransaction, largestBatchId: number, overlays: Map<DocumentKey, Mutation>): PersistencePromise<void>;
43
+ saveOverlays(transaction: PersistenceTransaction, largestBatchId: number, overlays: MutationMap): PersistencePromise<void>;
45
44
  /** Removes overlays for the given document keys and batch ID. */
46
45
  removeOverlaysForBatchId(transaction: PersistenceTransaction, documentKeys: DocumentKeySet, batchId: number): PersistencePromise<void>;
47
46
  /**
@@ -53,7 +52,7 @@ export interface DocumentOverlayCache {
53
52
  * Only overlays that contain a change past `sinceBatchId` are returned.
54
53
  * @returns Mapping of each document key in the collection to its overlay.
55
54
  */
56
- getOverlaysForCollection(transaction: PersistenceTransaction, collection: ResourcePath, sinceBatchId: number): PersistencePromise<Map<DocumentKey, Overlay>>;
55
+ getOverlaysForCollection(transaction: PersistenceTransaction, collection: ResourcePath, sinceBatchId: number): PersistencePromise<OverlayMap>;
57
56
  /**
58
57
  * Returns `count` overlays with a batch ID higher than `sinceBatchId` for the
59
58
  * provided collection group, processed by ascending batch ID. The method
@@ -68,5 +67,5 @@ export interface DocumentOverlayCache {
68
67
  * batch contains more entries.
69
68
  * @return Mapping of each document key in the collection group to its overlay.
70
69
  */
71
- getOverlaysForCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, sinceBatchId: number, count: number): PersistencePromise<Map<DocumentKey, Overlay>>;
70
+ getOverlaysForCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, sinceBatchId: number, count: number): PersistencePromise<OverlayMap>;
72
71
  }
@@ -73,9 +73,9 @@ export interface IndexManager {
73
73
  getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
74
74
  /**
75
75
  * Returns the documents that match the given target based on the provided
76
- * index.
76
+ * index or `null` if the target does not have a matching index.
77
77
  */
78
- getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
78
+ getDocumentsMatchingTarget(transaction: PersistenceTransaction, target: Target): PersistencePromise<DocumentKeySet | null>;
79
79
  /**
80
80
  * Returns the next collection group to update. Returns `null` if no group
81
81
  * exists.
@@ -15,9 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { User } from '../auth/user';
18
- import { DocumentKeySet } from '../model/collections';
18
+ import { DocumentKeySet, MutationMap, OverlayMap } from '../model/collections';
19
19
  import { DocumentKey } from '../model/document_key';
20
- import { Mutation } from '../model/mutation';
21
20
  import { Overlay } from '../model/overlay';
22
21
  import { ResourcePath } from '../model/path';
23
22
  import { DocumentOverlayCache } from './document_overlay_cache';
@@ -37,9 +36,9 @@ export declare class IndexedDbDocumentOverlayCache implements DocumentOverlayCac
37
36
  constructor(serializer: LocalSerializer, userId: string);
38
37
  static forUser(serializer: LocalSerializer, user: User): IndexedDbDocumentOverlayCache;
39
38
  getOverlay(transaction: PersistenceTransaction, key: DocumentKey): PersistencePromise<Overlay | null>;
40
- saveOverlays(transaction: PersistenceTransaction, largestBatchId: number, overlays: Map<DocumentKey, Mutation>): PersistencePromise<void>;
39
+ saveOverlays(transaction: PersistenceTransaction, largestBatchId: number, overlays: MutationMap): PersistencePromise<void>;
41
40
  removeOverlaysForBatchId(transaction: PersistenceTransaction, documentKeys: DocumentKeySet, batchId: number): PersistencePromise<void>;
42
- getOverlaysForCollection(transaction: PersistenceTransaction, collection: ResourcePath, sinceBatchId: number): PersistencePromise<Map<DocumentKey, Overlay>>;
43
- getOverlaysForCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, sinceBatchId: number, count: number): PersistencePromise<Map<DocumentKey, Overlay>>;
41
+ getOverlaysForCollection(transaction: PersistenceTransaction, collection: ResourcePath, sinceBatchId: number): PersistencePromise<OverlayMap>;
42
+ getOverlaysForCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, sinceBatchId: number, count: number): PersistencePromise<OverlayMap>;
44
43
  private saveOverlay;
45
44
  }
@@ -39,6 +39,11 @@ export declare class IndexedDbIndexManager implements IndexManager {
39
39
  */
40
40
  private collectionParentsCache;
41
41
  private uid;
42
+ /**
43
+ * Maps from a target to its equivalent list of sub-targets. Each sub-target
44
+ * contains only one term from the target's disjunctive normal form (DNF).
45
+ */
46
+ private targetToDnfSubTargets;
42
47
  constructor(user: User);
43
48
  /**
44
49
  * Adds a new entry to the collection parent index.
@@ -51,7 +56,22 @@ export declare class IndexedDbIndexManager implements IndexManager {
51
56
  getCollectionParents(transaction: PersistenceTransaction, collectionId: string): PersistencePromise<ResourcePath[]>;
52
57
  addFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
53
58
  deleteFieldIndex(transaction: PersistenceTransaction, index: FieldIndex): PersistencePromise<void>;
54
- getDocumentsMatchingTarget(transaction: PersistenceTransaction, fieldIndex: FieldIndex, target: Target): PersistencePromise<DocumentKeySet>;
59
+ getDocumentsMatchingTarget(transaction: PersistenceTransaction, target: Target): PersistencePromise<DocumentKeySet | null>;
60
+ private getSubTargets;
61
+ /**
62
+ * Constructs a key range query on `DbIndexEntryStore` that unions all
63
+ * bounds.
64
+ */
65
+ private generateIndexRanges;
66
+ /** Generates the lower bound for `arrayValue` and `directionalValue`. */
67
+ private generateLowerBound;
68
+ /** Generates the upper bound for `arrayValue` and `directionalValue`. */
69
+ private generateUpperBound;
70
+ /**
71
+ * Generates an empty bound that scopes the index scan to the current index
72
+ * and user.
73
+ */
74
+ private generateEmptyBound;
55
75
  getFieldIndex(transaction: PersistenceTransaction, target: Target): PersistencePromise<FieldIndex | null>;
56
76
  /**
57
77
  * Returns the byte encoded form of the directional values in the field index.
@@ -61,6 +81,27 @@ export declare class IndexedDbIndexManager implements IndexManager {
61
81
  private encodeDirectionalElements;
62
82
  /** Encodes a single value to the ascending index format. */
63
83
  private encodeSingleElement;
84
+ /**
85
+ * Encodes the given field values according to the specification in `target`.
86
+ * For IN queries, a list of possible values is returned.
87
+ */
88
+ private encodeValues;
89
+ /**
90
+ * Encodes the given bounds according to the specification in `target`. For IN
91
+ * queries, a list of possible values is returned.
92
+ */
93
+ private encodeBound;
94
+ /** Returns the byte representation for the provided encoders. */
95
+ private getEncodedBytes;
96
+ /**
97
+ * Creates a separate encoder for each element of an array.
98
+ *
99
+ * The method appends each value to all existing encoders (e.g. filter("a",
100
+ * "==", "a1").filter("b", "in", ["b1", "b2"]) becomes ["a1,b1", "a1,b2"]). A
101
+ * list of new encoders is returned.
102
+ */
103
+ private expandIndexValues;
104
+ private isInFilter;
64
105
  getFieldIndexes(transaction: PersistenceTransaction, collectionGroup?: string): PersistencePromise<FieldIndex[]>;
65
106
  getNextCollectionGroupToUpdate(transaction: PersistenceTransaction): PersistencePromise<string | null>;
66
107
  updateCollectionGroup(transaction: PersistenceTransaction, collectionGroup: string, offset: IndexOffset): PersistencePromise<void>;
@@ -77,4 +118,10 @@ export declare class IndexedDbIndexManager implements IndexManager {
77
118
  */
78
119
  private updateEntries;
79
120
  private getNextSequenceNumber;
121
+ /**
122
+ * Returns a new set of IDB ranges that splits the existing range and excludes
123
+ * any values that match the `notInValue` from these ranges. As an example,
124
+ * '[foo > 2 && foo != 3]` becomes `[foo > 2 && < 3, foo > 3]`.
125
+ */
126
+ private createRange;
80
127
  }
@@ -16,6 +16,7 @@
16
16
  */
17
17
  import { DocumentKey } from '../model/document_key';
18
18
  import { DbRemoteDocument } from './indexeddb_schema';
19
+ import { DbRemoteDocument as DbRemoteDocumentLegacy } from './indexeddb_schema_legacy';
19
20
  import { PersistencePromise } from './persistence_promise';
20
21
  import { SimpleDbTransaction } from './simple_db';
21
22
  /**
@@ -31,4 +32,4 @@ export declare function removeMutationBatch(txn: SimpleDbTransaction, userId: st
31
32
  /**
32
33
  * Returns an approximate size for the given document.
33
34
  */
34
- export declare function dbDocumentSize(doc: DbRemoteDocument | null): number;
35
+ export declare function dbDocumentSize(doc: DbRemoteDocument | DbRemoteDocumentLegacy | null): number;
@@ -14,12 +14,8 @@
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
- import { MutableDocumentMap } from '../model/collections';
19
17
  import { MutableDocument } from '../model/document';
20
18
  import { LocalSerializer } from './local_serializer';
21
- import { PersistencePromise } from './persistence_promise';
22
- import { PersistenceTransaction } from './persistence_transaction';
23
19
  import { RemoteDocumentCache } from './remote_document_cache';
24
20
  export interface DocumentSizeEntry {
25
21
  document: MutableDocument;
@@ -29,16 +25,3 @@ export interface IndexedDbRemoteDocumentCache extends RemoteDocumentCache {
29
25
  }
30
26
  /** Creates a new IndexedDbRemoteDocumentCache. */
31
27
  export declare function newIndexedDbRemoteDocumentCache(serializer: LocalSerializer): IndexedDbRemoteDocumentCache;
32
- /**
33
- * Returns the set of documents that have changed since the specified read
34
- * time.
35
- */
36
- export declare function remoteDocumentCacheGetNewDocumentChanges(remoteDocumentCache: IndexedDbRemoteDocumentCache, transaction: PersistenceTransaction, sinceReadTime: SnapshotVersion): PersistencePromise<{
37
- changedDocs: MutableDocumentMap;
38
- readTime: SnapshotVersion;
39
- }>;
40
- /**
41
- * Returns the read time of the most recently read document in the cache, or
42
- * SnapshotVersion.min() if not available.
43
- */
44
- export declare function remoteDocumentCacheGetLastReadTime(transaction: PersistenceTransaction): PersistencePromise<SnapshotVersion>;