@firebase/firestore 3.0.2-canary.46d26ff96 → 3.0.2-canary.4d2a54fb0

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 (43) hide show
  1. package/dist/firestore/lite/index.d.ts +1 -1
  2. package/dist/firestore/src/api.d.ts +1 -1
  3. package/dist/firestore/src/lite-api/reference.d.ts +1 -1
  4. package/dist/firestore/src/lite-api/types.d.ts +12 -1
  5. package/dist/index.d.ts +13 -2
  6. package/dist/index.esm2017.js +2 -2
  7. package/dist/index.esm2017.js.map +1 -1
  8. package/dist/index.esm5.js +2 -2
  9. package/dist/index.esm5.js.map +1 -1
  10. package/dist/index.node.cjs.esm2017.js +2 -2
  11. package/dist/index.node.cjs.esm2017.js.map +1 -1
  12. package/dist/index.node.cjs.js +2 -2
  13. package/dist/index.node.cjs.js.map +1 -1
  14. package/dist/index.rn.js +708 -708
  15. package/dist/index.rn.js.map +1 -1
  16. package/dist/internal.d.ts +14 -2
  17. package/dist/lite/firestore/lite/index.d.ts +1 -1
  18. package/dist/lite/firestore/src/api.d.ts +1 -1
  19. package/dist/lite/firestore/src/lite-api/reference.d.ts +1 -1
  20. package/dist/lite/firestore/src/lite-api/types.d.ts +12 -1
  21. package/dist/lite/index.browser.esm2017.js +2 -2
  22. package/dist/lite/index.browser.esm2017.js.map +1 -1
  23. package/dist/lite/index.browser.esm5.js +2 -2
  24. package/dist/lite/index.browser.esm5.js.map +1 -1
  25. package/dist/lite/index.d.ts +13 -2
  26. package/dist/lite/index.node.cjs.js +2 -2
  27. package/dist/lite/index.node.cjs.js.map +1 -1
  28. package/dist/lite/index.node.esm2017.js +2 -2
  29. package/dist/lite/index.node.esm2017.js.map +1 -1
  30. package/dist/lite/index.rn.esm2017.js +69 -69
  31. package/dist/lite/index.rn.esm2017.js.map +1 -1
  32. package/dist/lite/internal.d.ts +14 -2
  33. package/dist/lite/packages/firestore/lite/index.d.ts +1 -1
  34. package/dist/lite/packages/firestore/src/api.d.ts +1 -1
  35. package/dist/lite/packages/firestore/src/lite-api/reference.d.ts +1 -1
  36. package/dist/lite/packages/firestore/src/lite-api/types.d.ts +12 -1
  37. package/dist/lite/private.d.ts +14 -2
  38. package/dist/packages/firestore/lite/index.d.ts +1 -1
  39. package/dist/packages/firestore/src/api.d.ts +1 -1
  40. package/dist/packages/firestore/src/lite-api/reference.d.ts +1 -1
  41. package/dist/packages/firestore/src/lite-api/types.d.ts +12 -1
  42. package/dist/private.d.ts +14 -2
  43. package/package.json +9 -9
@@ -281,6 +281,18 @@ declare class ByteString {
281
281
  isEqual(other: ByteString): boolean;
282
282
  }
283
283
 
284
+ /**
285
+ * Helper for calculating the nested fields for a given type T1. This is needed
286
+ * to distribute union types such as `undefined | {...}` (happens for optional
287
+ * props) or `{a: A} | {b: B}`.
288
+ *
289
+ * In this use case, `V` is used to distribute the union types of `T[K]` on
290
+ * `Record`, since `T[K]` is evaluated as an expression and not distributed.
291
+ *
292
+ * See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types
293
+ */
294
+ export declare type ChildUpdateFields<K extends string, V> = V extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<V>> : never;
295
+
284
296
  /**
285
297
  * Gets a `CollectionReference` instance that refers to the collection at
286
298
  * the specified absolute path.
@@ -1672,7 +1684,7 @@ declare const enum MutationType {
1672
1684
  * all possible keys that are all marked as optional
1673
1685
  */
1674
1686
  export declare type NestedUpdateFields<T extends Record<string, unknown>> = UnionToIntersection<{
1675
- [K in keyof T & string]: T[K] extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<T[K]>> : never;
1687
+ [K in keyof T & string]: ChildUpdateFields<K, T[K]>;
1676
1688
  }[keyof T & string]>;
1677
1689
 
1678
1690
  /**
@@ -2560,7 +2572,7 @@ declare interface UntypedFirestoreDataConverter<T> {
2560
2572
  * reference nested fields within the document. FieldValues can be passed in
2561
2573
  * as property values.
2562
2574
  */
2563
- export declare type UpdateData<T> = T extends Primitive ? T : T extends Map<infer K, infer V> ? Map<UpdateData<K>, UpdateData<V>> : T extends {} ? {
2575
+ export declare type UpdateData<T> = T extends Primitive ? T : T extends {} ? {
2564
2576
  [K in keyof T]?: UpdateData<T[K]> | FieldValue;
2565
2577
  } & NestedUpdateFields<T> : Partial<T>;
2566
2578
 
@@ -11,7 +11,7 @@ export { Firestore as Firestore, EmulatorMockTokenOptions, initializeFirestore,
11
11
  export { DocumentData, UpdateData, WithFieldValue, PartialWithFieldValue, SetOptions, DocumentReference, Query, CollectionReference, collection, collectionGroup, doc, refEqual, queryEqual } from '../src/lite-api/reference';
12
12
  export { endAt, endBefore, startAt, startAfter, limit, limitToLast, orderBy, OrderByDirection, where, WhereFilterOp, query, QueryConstraint, QueryConstraintType } from '../src/lite-api/query';
13
13
  export { addDoc, deleteDoc, updateDoc, setDoc, getDoc, getDocs } from '../src/lite-api/reference_impl';
14
- export { Primitive, NestedUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
14
+ export { Primitive, NestedUpdateFields, ChildUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
15
15
  export { FieldPath, documentId } from '../src/lite-api/field_path';
16
16
  export { FieldValue } from '../src/lite-api/field_value';
17
17
  export { increment, arrayRemove, arrayUnion, serverTimestamp, deleteField } from '../src/lite-api/field_value_impl';
@@ -34,7 +34,7 @@ export { Timestamp } from './api/timestamp';
34
34
  export { CACHE_SIZE_UNLIMITED } from './api/database';
35
35
  export { FirestoreErrorCode, FirestoreError } from './util/error';
36
36
  export { AbstractUserDataWriter } from './lite-api/user_data_writer';
37
- export { Primitive, NestedUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
37
+ export { Primitive, NestedUpdateFields, ChildUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
38
38
  /**
39
39
  * Internal exports
40
40
  */
@@ -50,7 +50,7 @@ export declare type WithFieldValue<T> = T extends Primitive ? T : T extends {} ?
50
50
  * reference nested fields within the document. FieldValues can be passed in
51
51
  * as property values.
52
52
  */
53
- export declare type UpdateData<T> = T extends Primitive ? T : T extends Map<infer K, infer V> ? Map<UpdateData<K>, UpdateData<V>> : T extends {} ? {
53
+ export declare type UpdateData<T> = T extends Primitive ? T : T extends {} ? {
54
54
  [K in keyof T]?: UpdateData<T[K]> | FieldValue;
55
55
  } & NestedUpdateFields<T> : Partial<T>;
56
56
  /**
@@ -28,8 +28,19 @@ export declare type Primitive = string | number | boolean | undefined | null;
28
28
  * all possible keys that are all marked as optional
29
29
  */
30
30
  export declare type NestedUpdateFields<T extends Record<string, unknown>> = UnionToIntersection<{
31
- [K in keyof T & string]: T[K] extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<T[K]>> : never;
31
+ [K in keyof T & string]: ChildUpdateFields<K, T[K]>;
32
32
  }[keyof T & string]>;
33
+ /**
34
+ * Helper for calculating the nested fields for a given type T1. This is needed
35
+ * to distribute union types such as `undefined | {...}` (happens for optional
36
+ * props) or `{a: A} | {b: B}`.
37
+ *
38
+ * In this use case, `V` is used to distribute the union types of `T[K]` on
39
+ * `Record`, since `T[K]` is evaluated as an expression and not distributed.
40
+ *
41
+ * See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types
42
+ */
43
+ export declare type ChildUpdateFields<K extends string, V> = V extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<V>> : never;
33
44
  /**
34
45
  * Returns a new map where every key is prefixed with the outer key appended
35
46
  * to a dot.
@@ -228,6 +228,18 @@ export declare class Bytes {
228
228
 
229
229
  /* Excluded from this release type: ByteString */
230
230
 
231
+ /**
232
+ * Helper for calculating the nested fields for a given type T1. This is needed
233
+ * to distribute union types such as `undefined | {...}` (happens for optional
234
+ * props) or `{a: A} | {b: B}`.
235
+ *
236
+ * In this use case, `V` is used to distribute the union types of `T[K]` on
237
+ * `Record`, since `T[K]` is evaluated as an expression and not distributed.
238
+ *
239
+ * See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types
240
+ */
241
+ export declare type ChildUpdateFields<K extends string, V> = V extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<V>> : never;
242
+
231
243
  /**
232
244
  * Gets a `CollectionReference` instance that refers to the collection at
233
245
  * the specified absolute path.
@@ -1557,7 +1569,7 @@ declare const enum MutationType {
1557
1569
  * all possible keys that are all marked as optional
1558
1570
  */
1559
1571
  export declare type NestedUpdateFields<T extends Record<string, unknown>> = UnionToIntersection<{
1560
- [K in keyof T & string]: T[K] extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<T[K]>> : never;
1572
+ [K in keyof T & string]: ChildUpdateFields<K, T[K]>;
1561
1573
  }[keyof T & string]>;
1562
1574
 
1563
1575
  /**
@@ -2428,7 +2440,7 @@ declare interface UntypedFirestoreDataConverter<T> {
2428
2440
  * reference nested fields within the document. FieldValues can be passed in
2429
2441
  * as property values.
2430
2442
  */
2431
- export declare type UpdateData<T> = T extends Primitive ? T : T extends Map<infer K, infer V> ? Map<UpdateData<K>, UpdateData<V>> : T extends {} ? {
2443
+ export declare type UpdateData<T> = T extends Primitive ? T : T extends {} ? {
2432
2444
  [K in keyof T]?: UpdateData<T[K]> | FieldValue;
2433
2445
  } & NestedUpdateFields<T> : Partial<T>;
2434
2446
 
@@ -11,7 +11,7 @@ export { Firestore as Firestore, EmulatorMockTokenOptions, initializeFirestore,
11
11
  export { DocumentData, UpdateData, WithFieldValue, PartialWithFieldValue, SetOptions, DocumentReference, Query, CollectionReference, collection, collectionGroup, doc, refEqual, queryEqual } from '../src/lite-api/reference';
12
12
  export { endAt, endBefore, startAt, startAfter, limit, limitToLast, orderBy, OrderByDirection, where, WhereFilterOp, query, QueryConstraint, QueryConstraintType } from '../src/lite-api/query';
13
13
  export { addDoc, deleteDoc, updateDoc, setDoc, getDoc, getDocs } from '../src/lite-api/reference_impl';
14
- export { Primitive, NestedUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
14
+ export { Primitive, NestedUpdateFields, ChildUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
15
15
  export { FieldPath, documentId } from '../src/lite-api/field_path';
16
16
  export { FieldValue } from '../src/lite-api/field_value';
17
17
  export { increment, arrayRemove, arrayUnion, serverTimestamp, deleteField } from '../src/lite-api/field_value_impl';
@@ -34,7 +34,7 @@ export { Timestamp } from './api/timestamp';
34
34
  export { CACHE_SIZE_UNLIMITED } from './api/database';
35
35
  export { FirestoreErrorCode, FirestoreError } from './util/error';
36
36
  export { AbstractUserDataWriter } from './lite-api/user_data_writer';
37
- export { Primitive, NestedUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
37
+ export { Primitive, NestedUpdateFields, ChildUpdateFields, AddPrefixToKeys, UnionToIntersection } from '../src/lite-api/types';
38
38
  /**
39
39
  * Internal exports
40
40
  */
@@ -50,7 +50,7 @@ export declare type WithFieldValue<T> = T extends Primitive ? T : T extends {} ?
50
50
  * reference nested fields within the document. FieldValues can be passed in
51
51
  * as property values.
52
52
  */
53
- export declare type UpdateData<T> = T extends Primitive ? T : T extends Map<infer K, infer V> ? Map<UpdateData<K>, UpdateData<V>> : T extends {} ? {
53
+ export declare type UpdateData<T> = T extends Primitive ? T : T extends {} ? {
54
54
  [K in keyof T]?: UpdateData<T[K]> | FieldValue;
55
55
  } & NestedUpdateFields<T> : Partial<T>;
56
56
  /**
@@ -28,8 +28,19 @@ export declare type Primitive = string | number | boolean | undefined | null;
28
28
  * all possible keys that are all marked as optional
29
29
  */
30
30
  export declare type NestedUpdateFields<T extends Record<string, unknown>> = UnionToIntersection<{
31
- [K in keyof T & string]: T[K] extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<T[K]>> : never;
31
+ [K in keyof T & string]: ChildUpdateFields<K, T[K]>;
32
32
  }[keyof T & string]>;
33
+ /**
34
+ * Helper for calculating the nested fields for a given type T1. This is needed
35
+ * to distribute union types such as `undefined | {...}` (happens for optional
36
+ * props) or `{a: A} | {b: B}`.
37
+ *
38
+ * In this use case, `V` is used to distribute the union types of `T[K]` on
39
+ * `Record`, since `T[K]` is evaluated as an expression and not distributed.
40
+ *
41
+ * See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types
42
+ */
43
+ export declare type ChildUpdateFields<K extends string, V> = V extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<V>> : never;
33
44
  /**
34
45
  * Returns a new map where every key is prefixed with the outer key appended
35
46
  * to a dot.
package/dist/private.d.ts CHANGED
@@ -332,6 +332,18 @@ declare const enum ChangeType {
332
332
  Metadata = 3
333
333
  }
334
334
 
335
+ /**
336
+ * Helper for calculating the nested fields for a given type T1. This is needed
337
+ * to distribute union types such as `undefined | {...}` (happens for optional
338
+ * props) or `{a: A} | {b: B}`.
339
+ *
340
+ * In this use case, `V` is used to distribute the union types of `T[K]` on
341
+ * `Record`, since `T[K]` is evaluated as an expression and not distributed.
342
+ *
343
+ * See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types
344
+ */
345
+ export declare type ChildUpdateFields<K extends string, V> = V extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<V>> : never;
346
+
335
347
  /**
336
348
  * Clears the persistent storage. This includes pending writes and cached
337
349
  * documents.
@@ -2768,7 +2780,7 @@ declare interface NamedQuery_2 {
2768
2780
  * all possible keys that are all marked as optional
2769
2781
  */
2770
2782
  export declare type NestedUpdateFields<T extends Record<string, unknown>> = UnionToIntersection<{
2771
- [K in keyof T & string]: T[K] extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<T[K]>> : never;
2783
+ [K in keyof T & string]: ChildUpdateFields<K, T[K]>;
2772
2784
  }[keyof T & string]>;
2773
2785
 
2774
2786
  /**
@@ -5101,7 +5113,7 @@ declare interface UntypedFirestoreDataConverter<T> {
5101
5113
  * reference nested fields within the document. FieldValues can be passed in
5102
5114
  * as property values.
5103
5115
  */
5104
- export declare type UpdateData<T> = T extends Primitive ? T : T extends Map<infer K, infer V> ? Map<UpdateData<K>, UpdateData<V>> : T extends {} ? {
5116
+ export declare type UpdateData<T> = T extends Primitive ? T : T extends {} ? {
5105
5117
  [K in keyof T]?: UpdateData<T[K]> | FieldValue;
5106
5118
  } & NestedUpdateFields<T> : Partial<T>;
5107
5119
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/firestore",
3
- "version": "3.0.2-canary.46d26ff96",
3
+ "version": "3.0.2-canary.4d2a54fb0",
4
4
  "engines": {
5
5
  "node": "^8.13.0 || >=10.10.0"
6
6
  },
@@ -69,22 +69,22 @@
69
69
  "lite/package.json"
70
70
  ],
71
71
  "dependencies": {
72
- "@firebase/component": "0.5.6-canary.46d26ff96",
73
- "@firebase/logger": "0.2.6-canary.46d26ff96",
74
- "@firebase/util": "1.3.0-canary.46d26ff96",
75
- "@firebase/webchannel-wrapper": "0.5.1-canary.46d26ff96",
72
+ "@firebase/component": "0.5.6-canary.4d2a54fb0",
73
+ "@firebase/logger": "0.2.6-canary.4d2a54fb0",
74
+ "@firebase/util": "1.3.0-canary.4d2a54fb0",
75
+ "@firebase/webchannel-wrapper": "0.5.1-canary.4d2a54fb0",
76
76
  "@grpc/grpc-js": "^1.3.2",
77
77
  "@grpc/proto-loader": "^0.6.0",
78
78
  "node-fetch": "2.6.2",
79
79
  "tslib": "^2.1.0"
80
80
  },
81
81
  "peerDependencies": {
82
- "@firebase/app": "0.7.0-canary.46d26ff96"
82
+ "@firebase/app": "0.7.0-canary.4d2a54fb0"
83
83
  },
84
84
  "devDependencies": {
85
- "@firebase/app": "0.7.0-canary.46d26ff96",
86
- "@firebase/app-compat": "0.1.1-canary.46d26ff96",
87
- "@firebase/auth": "0.17.2-canary.46d26ff96",
85
+ "@firebase/app": "0.7.0-canary.4d2a54fb0",
86
+ "@firebase/app-compat": "0.1.1-canary.4d2a54fb0",
87
+ "@firebase/auth": "0.17.2-canary.4d2a54fb0",
88
88
  "@rollup/plugin-alias": "3.1.5",
89
89
  "@rollup/plugin-json": "4.1.0",
90
90
  "@types/eslint": "7.28.0",