@firebase/firestore 3.4.5-canary.27ed8454d → 3.4.5-canary.7405e7d59

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 (45) hide show
  1. package/dist/firestore/src/local/document_overlay_cache.d.ts +4 -5
  2. package/dist/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  3. package/dist/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  4. package/dist/firestore/src/model/collections.d.ts +7 -0
  5. package/dist/firestore/src/util/obj_map.d.ts +3 -0
  6. package/dist/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  7. package/dist/index.esm2017.js +1693 -1678
  8. package/dist/index.esm2017.js.map +1 -1
  9. package/dist/index.esm5.js +1659 -1625
  10. package/dist/index.esm5.js.map +1 -1
  11. package/dist/index.node.cjs.js +136 -117
  12. package/dist/index.node.cjs.js.map +1 -1
  13. package/dist/index.node.mjs +136 -117
  14. package/dist/index.node.mjs.map +1 -1
  15. package/dist/index.rn.js +1693 -1678
  16. package/dist/index.rn.js.map +1 -1
  17. package/dist/internal.d.ts +10 -3
  18. package/dist/lite/firestore/src/local/document_overlay_cache.d.ts +4 -5
  19. package/dist/lite/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  20. package/dist/lite/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  21. package/dist/lite/firestore/src/model/collections.d.ts +7 -0
  22. package/dist/lite/firestore/src/util/obj_map.d.ts +3 -0
  23. package/dist/lite/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  24. package/dist/lite/index.browser.esm2017.js +2 -2
  25. package/dist/lite/index.browser.esm2017.js.map +1 -1
  26. package/dist/lite/index.browser.esm5.js +2 -2
  27. package/dist/lite/index.node.cjs.js +2 -2
  28. package/dist/lite/index.node.mjs +2 -2
  29. package/dist/lite/index.node.mjs.map +1 -1
  30. package/dist/lite/index.rn.esm2017.js +2 -2
  31. package/dist/lite/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
  32. package/dist/lite/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  33. package/dist/lite/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  34. package/dist/lite/packages/firestore/src/model/collections.d.ts +7 -0
  35. package/dist/lite/packages/firestore/src/util/obj_map.d.ts +3 -0
  36. package/dist/lite/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  37. package/dist/packages/firestore/dist/index.esm2017.d.ts +122 -122
  38. package/dist/packages/firestore/src/local/document_overlay_cache.d.ts +4 -5
  39. package/dist/packages/firestore/src/local/indexeddb_document_overlay_cache.d.ts +4 -5
  40. package/dist/packages/firestore/src/local/memory_document_overlay_cache.d.ts +4 -5
  41. package/dist/packages/firestore/src/model/collections.d.ts +7 -0
  42. package/dist/packages/firestore/src/util/obj_map.d.ts +3 -0
  43. package/dist/packages/firestore/test/unit/local/test_document_overlay_cache.d.ts +4 -4
  44. package/dist/private.d.ts +10 -3
  45. package/package.json +9 -9
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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>;
@@ -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
  }