@firebase/firestore 3.7.3 → 3.8.0-canary.20e5ef7fb

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 (124) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/firestore/lite/index.d.ts +1 -1
  3. package/dist/firestore/src/api/filter.d.ts +1 -1
  4. package/dist/firestore/src/api/reference_impl.d.ts +2 -1
  5. package/dist/firestore/src/api.d.ts +1 -1
  6. package/dist/firestore/src/core/bound.d.ts +49 -0
  7. package/dist/firestore/src/core/filter.d.ts +134 -0
  8. package/dist/firestore/src/core/order_by.d.ts +35 -0
  9. package/dist/firestore/src/core/query.d.ts +5 -6
  10. package/dist/firestore/src/core/target.d.ts +4 -120
  11. package/dist/firestore/src/lite-api/query.d.ts +273 -66
  12. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
  13. package/dist/firestore/src/local/local_documents_view.d.ts +0 -2
  14. package/dist/firestore/src/model/document.d.ts +8 -1
  15. package/dist/firestore/src/protos/firestore_proto_api.d.ts +1 -1
  16. package/dist/firestore/src/remote/serializer.d.ts +10 -3
  17. package/dist/firestore/src/util/logic_utils.d.ts +52 -0
  18. package/dist/firestore/src/util/types.d.ts +1 -1
  19. package/dist/firestore/test/lite/helpers.d.ts +1 -1
  20. package/dist/firestore/test/unit/core/filter.test.d.ts +17 -0
  21. package/dist/firestore/test/unit/specs/spec_test_runner.d.ts +2 -1
  22. package/dist/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
  23. package/dist/firestore/test/util/helpers.d.ts +6 -2
  24. package/dist/firestore/test/util/test_platform.d.ts +2 -2
  25. package/dist/index.d.ts +140 -63
  26. package/dist/index.esm2017.js +4297 -3743
  27. package/dist/index.esm2017.js.map +1 -1
  28. package/dist/index.esm5.js +4982 -4410
  29. package/dist/index.esm5.js.map +1 -1
  30. package/dist/index.node.cjs.js +1659 -890
  31. package/dist/index.node.cjs.js.map +1 -1
  32. package/dist/index.node.mjs +1652 -891
  33. package/dist/index.node.mjs.map +1 -1
  34. package/dist/index.rn.js +4522 -3968
  35. package/dist/index.rn.js.map +1 -1
  36. package/dist/internal.d.ts +330 -69
  37. package/dist/lite/firestore/lite/index.d.ts +1 -1
  38. package/dist/lite/firestore/src/api/filter.d.ts +1 -1
  39. package/dist/lite/firestore/src/api/reference_impl.d.ts +2 -1
  40. package/dist/lite/firestore/src/api.d.ts +1 -1
  41. package/dist/lite/firestore/src/core/bound.d.ts +49 -0
  42. package/dist/lite/firestore/src/core/filter.d.ts +134 -0
  43. package/dist/lite/firestore/src/core/order_by.d.ts +35 -0
  44. package/dist/lite/firestore/src/core/query.d.ts +5 -6
  45. package/dist/lite/firestore/src/core/target.d.ts +4 -120
  46. package/dist/lite/firestore/src/lite-api/query.d.ts +273 -66
  47. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
  48. package/dist/lite/firestore/src/local/local_documents_view.d.ts +0 -2
  49. package/dist/lite/firestore/src/model/document.d.ts +8 -1
  50. package/dist/lite/firestore/src/protos/firestore_proto_api.d.ts +1 -1
  51. package/dist/lite/firestore/src/remote/serializer.d.ts +10 -3
  52. package/dist/lite/firestore/src/util/logic_utils.d.ts +52 -0
  53. package/dist/lite/firestore/src/util/types.d.ts +1 -1
  54. package/dist/lite/firestore/test/lite/helpers.d.ts +1 -1
  55. package/dist/lite/firestore/test/unit/core/filter.test.d.ts +17 -0
  56. package/dist/lite/firestore/test/unit/specs/spec_test_runner.d.ts +2 -1
  57. package/dist/lite/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
  58. package/dist/lite/firestore/test/util/helpers.d.ts +6 -2
  59. package/dist/lite/firestore/test/util/test_platform.d.ts +2 -2
  60. package/dist/lite/index.browser.esm2017.js +2091 -1793
  61. package/dist/lite/index.browser.esm2017.js.map +1 -1
  62. package/dist/lite/index.browser.esm5.js +2219 -1980
  63. package/dist/lite/index.browser.esm5.js.map +1 -1
  64. package/dist/lite/index.d.ts +138 -62
  65. package/dist/lite/index.node.cjs.js +2212 -1802
  66. package/dist/lite/index.node.cjs.js.map +1 -1
  67. package/dist/lite/index.node.mjs +2205 -1803
  68. package/dist/lite/index.node.mjs.map +1 -1
  69. package/dist/lite/index.rn.esm2017.js +2077 -1778
  70. package/dist/lite/index.rn.esm2017.js.map +1 -1
  71. package/dist/lite/internal.d.ts +328 -66
  72. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +322 -174
  73. package/dist/lite/packages/firestore/lite/index.d.ts +1 -1
  74. package/dist/lite/packages/firestore/rollup.config.debug.d.ts +1 -1
  75. package/dist/lite/packages/firestore/src/api/filter.d.ts +1 -1
  76. package/dist/lite/packages/firestore/src/api/reference_impl.d.ts +2 -1
  77. package/dist/lite/packages/firestore/src/api.d.ts +1 -1
  78. package/dist/lite/packages/firestore/src/core/bound.d.ts +49 -0
  79. package/dist/lite/packages/firestore/src/core/filter.d.ts +134 -0
  80. package/dist/lite/packages/firestore/src/core/order_by.d.ts +35 -0
  81. package/dist/lite/packages/firestore/src/core/query.d.ts +5 -6
  82. package/dist/lite/packages/firestore/src/core/target.d.ts +4 -120
  83. package/dist/lite/packages/firestore/src/lite-api/query.d.ts +273 -66
  84. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
  85. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +0 -2
  86. package/dist/lite/packages/firestore/src/model/document.d.ts +8 -1
  87. package/dist/lite/packages/firestore/src/protos/firestore_proto_api.d.ts +1 -1
  88. package/dist/lite/packages/firestore/src/remote/serializer.d.ts +10 -3
  89. package/dist/lite/packages/firestore/src/util/logic_utils.d.ts +52 -0
  90. package/dist/lite/packages/firestore/src/util/types.d.ts +1 -1
  91. package/dist/lite/packages/firestore/test/lite/helpers.d.ts +1 -1
  92. package/dist/lite/packages/firestore/test/unit/core/filter.test.d.ts +17 -0
  93. package/dist/lite/packages/firestore/test/unit/specs/spec_test_runner.d.ts +2 -1
  94. package/dist/lite/packages/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
  95. package/dist/lite/packages/firestore/test/util/helpers.d.ts +6 -2
  96. package/dist/lite/packages/firestore/test/util/test_platform.d.ts +2 -2
  97. package/dist/lite/private.d.ts +240 -66
  98. package/dist/packages/firestore/dist/index.esm2017.d.ts +370 -209
  99. package/dist/packages/firestore/lite/index.d.ts +1 -1
  100. package/dist/packages/firestore/rollup.config.debug.d.ts +1 -1
  101. package/dist/packages/firestore/src/api/filter.d.ts +1 -1
  102. package/dist/packages/firestore/src/api/reference_impl.d.ts +2 -1
  103. package/dist/packages/firestore/src/api.d.ts +1 -1
  104. package/dist/packages/firestore/src/core/bound.d.ts +49 -0
  105. package/dist/packages/firestore/src/core/filter.d.ts +134 -0
  106. package/dist/packages/firestore/src/core/order_by.d.ts +35 -0
  107. package/dist/packages/firestore/src/core/query.d.ts +5 -6
  108. package/dist/packages/firestore/src/core/target.d.ts +4 -120
  109. package/dist/packages/firestore/src/lite-api/query.d.ts +273 -66
  110. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
  111. package/dist/packages/firestore/src/local/local_documents_view.d.ts +0 -2
  112. package/dist/packages/firestore/src/model/document.d.ts +8 -1
  113. package/dist/packages/firestore/src/protos/firestore_proto_api.d.ts +1 -1
  114. package/dist/packages/firestore/src/remote/serializer.d.ts +10 -3
  115. package/dist/packages/firestore/src/util/logic_utils.d.ts +52 -0
  116. package/dist/packages/firestore/src/util/types.d.ts +1 -1
  117. package/dist/packages/firestore/test/lite/helpers.d.ts +1 -1
  118. package/dist/packages/firestore/test/unit/core/filter.test.d.ts +17 -0
  119. package/dist/packages/firestore/test/unit/specs/spec_test_runner.d.ts +2 -1
  120. package/dist/packages/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
  121. package/dist/packages/firestore/test/util/helpers.d.ts +6 -2
  122. package/dist/packages/firestore/test/util/test_platform.d.ts +2 -2
  123. package/dist/private.d.ts +242 -69
  124. package/package.json +14 -12
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -218,7 +218,7 @@ export interface SpecWatchEntity {
218
218
  }
219
219
  export interface SpecClientState {
220
220
  /** The visibility state of the browser tab running the client. */
221
- visibility?: VisibilityState;
221
+ visibility?: DocumentVisibilityState;
222
222
  /** Whether this tab should try to forcefully become primary. */
223
223
  primary?: true;
224
224
  }
@@ -262,6 +262,7 @@ export interface SpecQuery {
262
262
  export interface SpecDocument {
263
263
  key: string;
264
264
  version: TestSnapshotVersion;
265
+ createTime: TestSnapshotVersion;
265
266
  value: JsonObject<unknown> | null;
266
267
  options?: DocumentOptions;
267
268
  }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export {};
@@ -15,11 +15,13 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import { Bytes, DocumentReference } from '../../src';
18
+ import { Bound } from '../../src/core/bound';
18
19
  import { BundledDocuments } from '../../src/core/bundle';
19
20
  import { DatabaseId } from '../../src/core/database_info';
21
+ import { FieldFilter, CompositeFilter, Filter } from '../../src/core/filter';
22
+ import { OrderBy } from '../../src/core/order_by';
20
23
  import { Query } from '../../src/core/query';
21
24
  import { SnapshotVersion } from '../../src/core/snapshot_version';
22
- import { Bound, FieldFilter, Filter, OrderBy } from '../../src/core/target';
23
25
  import { TargetId } from '../../src/core/types';
24
26
  import { LimboDocumentChange, View, ViewChange } from '../../src/core/view';
25
27
  import { UserDataReader } from '../../src/lite-api/user_data_reader';
@@ -47,7 +49,7 @@ export declare type TestSnapshotVersion = number;
47
49
  export declare function testUserDataReader(useProto3Json?: boolean): UserDataReader;
48
50
  export declare function version(v: TestSnapshotVersion): SnapshotVersion;
49
51
  export declare function ref(key: string, offset?: number): DocumentReference;
50
- export declare function doc(keyStr: string, ver: TestSnapshotVersion, jsonOrObjectValue: JsonObject<unknown> | ObjectValue): MutableDocument;
52
+ export declare function doc(keyStr: string, ver: TestSnapshotVersion, jsonOrObjectValue: JsonObject<unknown> | ObjectValue, createTime?: TestSnapshotVersion): MutableDocument;
51
53
  export declare function deletedDoc(keyStr: string, ver: TestSnapshotVersion): MutableDocument;
52
54
  export declare function unknownDoc(keyStr: string, ver: TestSnapshotVersion): MutableDocument;
53
55
  export declare function removedDoc(keyStr: string): MutableDocument;
@@ -68,6 +70,8 @@ export declare function fieldIndex(collectionGroup: string, options?: {
68
70
  export declare function mask(...paths: string[]): FieldMask;
69
71
  export declare function blob(...bytes: number[]): Bytes;
70
72
  export declare function filter(path: string, op: string, value: unknown): FieldFilter;
73
+ export declare function andFilter(...filters: Filter[]): CompositeFilter;
74
+ export declare function orFilter(...filters: Filter[]): CompositeFilter;
71
75
  export declare function setMutation(keyStr: string, json: JsonObject<unknown>): SetMutation;
72
76
  export declare function patchMutation(keyStr: string, json: JsonObject<unknown>, precondition?: Precondition): PatchMutation;
73
77
  export declare function mergeMutation(keyStr: string, json: JsonObject<unknown>, updateMask: FieldPath[]): PatchMutation;
@@ -36,10 +36,10 @@ export declare function testWindow(sharedWebStorage?: SharedFakeWebStorage): Fak
36
36
  export declare class FakeDocument implements DocumentLike {
37
37
  private _visibilityState;
38
38
  private visibilityListener;
39
- get visibilityState(): VisibilityState;
39
+ get visibilityState(): DocumentVisibilityState;
40
40
  addEventListener(type: string, listener: EventListener): void;
41
41
  removeEventListener(type: string, listener: EventListener): void;
42
- raiseVisibilityEvent(visibility: VisibilityState): void;
42
+ raiseVisibilityEvent(visibility: DocumentVisibilityState): void;
43
43
  }
44
44
  export declare function testDocument(): FakeDocument;
45
45
  /**
package/dist/index.d.ts CHANGED
@@ -578,45 +578,45 @@ export declare function enableMultiTabIndexedDbPersistence(firestore: Firestore)
578
578
  */
579
579
  export declare function enableNetwork(firestore: Firestore): Promise<void>;
580
580
  /**
581
- * Creates a {@link QueryConstraint} that modifies the result set to end at the
582
- * provided document (inclusive). The end position is relative to the order of
583
- * the query. The document must contain all of the fields provided in the
581
+ * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at
582
+ * the provided document (inclusive). The end position is relative to the order
583
+ * of the query. The document must contain all of the fields provided in the
584
584
  * orderBy of the query.
585
585
  *
586
586
  * @param snapshot - The snapshot of the document to end at.
587
- * @returns A {@link QueryConstraint} to pass to `query()`
587
+ * @returns A {@link QueryEndAtConstraint} to pass to `query()`
588
588
  */
589
- export declare function endAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
589
+ export declare function endAt(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstraint;
590
590
  /**
591
- * Creates a {@link QueryConstraint} that modifies the result set to end at the
592
- * provided fields relative to the order of the query. The order of the field
591
+ * Creates a {@link QueryEndAtConstraint} that modifies the result set to end at
592
+ * the provided fields relative to the order of the query. The order of the field
593
593
  * values must match the order of the order by clauses of the query.
594
594
  *
595
595
  * @param fieldValues - The field values to end this query at, in order
596
596
  * of the query's order by.
597
- * @returns A {@link QueryConstraint} to pass to `query()`
597
+ * @returns A {@link QueryEndAtConstraint} to pass to `query()`
598
598
  */
599
- export declare function endAt(...fieldValues: unknown[]): QueryConstraint;
599
+ export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint;
600
600
  /**
601
- * Creates a {@link QueryConstraint} that modifies the result set to end before the
602
- * provided document (exclusive). The end position is relative to the order of
603
- * the query. The document must contain all of the fields provided in the
604
- * orderBy of the query.
601
+ * Creates a {@link QueryEndAtConstraint} that modifies the result set to end
602
+ * before the provided document (exclusive). The end position is relative to the
603
+ * order of the query. The document must contain all of the fields provided in
604
+ * the orderBy of the query.
605
605
  *
606
606
  * @param snapshot - The snapshot of the document to end before.
607
- * @returns A {@link QueryConstraint} to pass to `query()`
607
+ * @returns A {@link QueryEndAtConstraint} to pass to `query()`
608
608
  */
609
- export declare function endBefore(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
609
+ export declare function endBefore(snapshot: DocumentSnapshot<unknown>): QueryEndAtConstraint;
610
610
  /**
611
- * Creates a {@link QueryConstraint} that modifies the result set to end before the
612
- * provided fields relative to the order of the query. The order of the field
613
- * values must match the order of the order by clauses of the query.
611
+ * Creates a {@link QueryEndAtConstraint} that modifies the result set to end
612
+ * before the provided fields relative to the order of the query. The order of
613
+ * the field values must match the order of the order by clauses of the query.
614
614
  *
615
615
  * @param fieldValues - The field values to end this query before, in order
616
616
  * of the query's order by.
617
- * @returns A {@link QueryConstraint} to pass to `query()`
617
+ * @returns A {@link QueryEndAtConstraint} to pass to `query()`
618
618
  */
619
- export declare function endBefore(...fieldValues: unknown[]): QueryConstraint;
619
+ export declare function endBefore(...fieldValues: unknown[]): QueryEndAtConstraint;
620
620
  /**
621
621
  * A `FieldPath` refers to a field in a document. The path may consist of a
622
622
  * single field name (referring to a top-level field in the document), or a
@@ -974,7 +974,8 @@ export declare function getDocFromServer<T>(reference: DocumentReference<T>): Pr
974
974
  export declare function getDocs<T>(query: Query<T>): Promise<QuerySnapshot<T>>;
975
975
  /**
976
976
  * Executes the query and returns the results as a `QuerySnapshot` from cache.
977
- * Returns an error if the document is not currently cached.
977
+ * Returns an empty result set if no documents matching the query are currently
978
+ * cached.
978
979
  *
979
980
  * @returns A `Promise` that will be resolved with the results of the query.
980
981
  */
@@ -1087,22 +1088,24 @@ export declare interface IndexField {
1087
1088
  export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
1088
1089
  /* Excluded from this release type: _isBase64Available */
1089
1090
  /**
1090
- * Creates a {@link QueryConstraint} that only returns the first matching documents.
1091
+ * Creates a {@link QueryLimitConstraint} that only returns the first matching
1092
+ * documents.
1091
1093
  *
1092
1094
  * @param limit - The maximum number of items to return.
1093
- * @returns The created {@link Query}.
1095
+ * @returns The created {@link QueryLimitConstraint}.
1094
1096
  */
1095
- export declare function limit(limit: number): QueryConstraint;
1097
+ export declare function limit(limit: number): QueryLimitConstraint;
1096
1098
  /**
1097
- * Creates a {@link QueryConstraint} that only returns the last matching documents.
1099
+ * Creates a {@link QueryLimitConstraint} that only returns the last matching
1100
+ * documents.
1098
1101
  *
1099
1102
  * You must specify at least one `orderBy` clause for `limitToLast` queries,
1100
1103
  * otherwise an exception will be thrown during execution.
1101
1104
  *
1102
1105
  * @param limit - The maximum number of items to return.
1103
- * @returns The created {@link Query}.
1106
+ * @returns The created {@link QueryLimitConstraint}.
1104
1107
  */
1105
- export declare function limitToLast(limit: number): QueryConstraint;
1108
+ export declare function limitToLast(limit: number): QueryLimitConstraint;
1106
1109
  /**
1107
1110
  * Loads a Firestore bundle into the local cache.
1108
1111
  *
@@ -1377,15 +1380,18 @@ export declare function onSnapshotsInSync(firestore: Firestore, observer: {
1377
1380
  */
1378
1381
  export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe;
1379
1382
  /**
1380
- * Creates a {@link QueryConstraint} that sorts the query result by the
1383
+ * Creates a {@link QueryOrderByConstraint} that sorts the query result by the
1381
1384
  * specified field, optionally in descending order instead of ascending.
1382
1385
  *
1386
+ * Note: Documents that do not contain the specified field will not be present
1387
+ * in the query result.
1388
+ *
1383
1389
  * @param fieldPath - The field to sort by.
1384
1390
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
1385
1391
  * not specified, order will be ascending.
1386
- * @returns The created {@link Query}.
1392
+ * @returns The created {@link QueryOrderByConstraint}.
1387
1393
  */
1388
- export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryConstraint;
1394
+ export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint;
1389
1395
  /**
1390
1396
  * The direction of a {@link orderBy} clause is specified as 'desc' or 'asc'
1391
1397
  * (descending or ascending).
@@ -1453,26 +1459,29 @@ export declare class Query<T = DocumentData> {
1453
1459
  */
1454
1460
  withConverter<U>(converter: FirestoreDataConverter<U>): Query<U>;
1455
1461
  }
1462
+ /* Excluded declaration from this release type: query */
1456
1463
  /**
1457
- * Creates a new immutable instance of {@link Query} that is extended to also include
1458
- * additional query constraints.
1464
+ * Creates a new immutable instance of {@link Query} that is extended to also
1465
+ * include additional query constraints.
1459
1466
  *
1460
- * @param query - The {@link Query} instance to use as a base for the new constraints.
1467
+ * @param query - The {@link Query} instance to use as a base for the new
1468
+ * constraints.
1461
1469
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
1462
1470
  * @throws if any of the provided query constraints cannot be combined with the
1463
1471
  * existing or new constraints.
1464
1472
  */
1465
1473
  export declare function query<T>(query: Query<T>, ...queryConstraints: QueryConstraint[]): Query<T>;
1474
+ /* Excluded from this release type: QueryCompositeFilterConstraint */
1466
1475
  /**
1467
1476
  * A `QueryConstraint` is used to narrow the set of documents returned by a
1468
1477
  * Firestore query. `QueryConstraint`s are created by invoking {@link where},
1469
- * {@link orderBy}, {@link (startAt:1)}, {@link (startAfter:1)}, {@link
1470
- * endBefore:1}, {@link (endAt:1)}, {@link limit} or {@link limitToLast} and
1478
+ * {@link orderBy}, {@link startAt}, {@link startAfter}, {@link
1479
+ * endBefore}, {@link endAt}, {@link limit}, {@link limitToLast} and
1471
1480
  * can then be passed to {@link query} to create a new query instance that
1472
1481
  * also contains this `QueryConstraint`.
1473
1482
  */
1474
1483
  export declare abstract class QueryConstraint {
1475
- /** The type of this query constraints */
1484
+ /** The type of this query constraint */
1476
1485
  abstract readonly type: QueryConstraintType;
1477
1486
  }
1478
1487
  /** Describes the different query constraints available in this SDK. */
@@ -1504,6 +1513,17 @@ export declare class QueryDocumentSnapshot<T = DocumentData> extends DocumentSna
1504
1513
  */
1505
1514
  data(options?: SnapshotOptions): T;
1506
1515
  }
1516
+ /**
1517
+ * A `QueryEndAtConstraint` is used to exclude documents from the end of a
1518
+ * result set returned by a Firestore query.
1519
+ * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
1520
+ * {@link (endBefore:1)} and can then be passed to {@link query} to create a new
1521
+ * query instance that also contains this `QueryEndAtConstraint`.
1522
+ */
1523
+ export declare class QueryEndAtConstraint extends QueryConstraint {
1524
+ /** The type of this query constraint */
1525
+ readonly type: 'endBefore' | 'endAt';
1526
+ }
1507
1527
  /**
1508
1528
  * Returns true if the provided queries point to the same collection and apply
1509
1529
  * the same constraints.
@@ -1514,6 +1534,52 @@ export declare class QueryDocumentSnapshot<T = DocumentData> extends DocumentSna
1514
1534
  * Firestore database.
1515
1535
  */
1516
1536
  export declare function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;
1537
+ /**
1538
+ * A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by
1539
+ * a Firestore query by filtering on one or more document fields.
1540
+ * `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then
1541
+ * be passed to {@link query} to create a new query instance that also contains
1542
+ * this `QueryFieldFilterConstraint`.
1543
+ */
1544
+ export declare class QueryFieldFilterConstraint extends QueryConstraint {
1545
+ /** The type of this query constraint */
1546
+ readonly type = "where";
1547
+ }
1548
+ /* Excluded from this release type: QueryFilterConstraint */
1549
+ /**
1550
+ * A `QueryLimitConstraint` is used to limit the number of documents returned by
1551
+ * a Firestore query.
1552
+ * `QueryLimitConstraint`s are created by invoking {@link limit} or
1553
+ * {@link limitToLast} and can then be passed to {@link query} to create a new
1554
+ * query instance that also contains this `QueryLimitConstraint`.
1555
+ */
1556
+ export declare class QueryLimitConstraint extends QueryConstraint {
1557
+ /** The type of this query constraint */
1558
+ readonly type: 'limit' | 'limitToLast';
1559
+ }
1560
+ /**
1561
+ * `QueryNonFilterConstraint` is a helper union type that represents
1562
+ * QueryConstraints which are used to narrow or order the set of documents,
1563
+ * but that do not explicitly filter on a document field.
1564
+ * `QueryNonFilterConstraint`s are created by invoking {@link orderBy},
1565
+ * {@link startAt}, {@link startAfter}, {@link endBefore}, {@link endAt},
1566
+ * {@link limit} or {@link limitToLast} and can then be passed to {@link query}
1567
+ * to create a new query instance that also contains the `QueryConstraint`.
1568
+ */
1569
+ export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;
1570
+ /**
1571
+ * A `QueryOrderByConstraint` is used to sort the set of documents returned by a
1572
+ * Firestore query. `QueryOrderByConstraint`s are created by invoking
1573
+ * {@link orderBy} and can then be passed to {@link query} to create a new query
1574
+ * instance that also contains this `QueryOrderByConstraint`.
1575
+ *
1576
+ * Note: Documents that do not contain the orderBy field will not be present in
1577
+ * the query result.
1578
+ */
1579
+ export declare class QueryOrderByConstraint extends QueryConstraint {
1580
+ /** The type of this query constraint */
1581
+ readonly type = "orderBy";
1582
+ }
1517
1583
  /**
1518
1584
  * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects
1519
1585
  * representing the results of a query. The documents can be accessed as an
@@ -1558,6 +1624,17 @@ export declare class QuerySnapshot<T = DocumentData> {
1558
1624
  */
1559
1625
  docChanges(options?: SnapshotListenOptions): Array<DocumentChange<T>>;
1560
1626
  }
1627
+ /**
1628
+ * A `QueryStartAtConstraint` is used to exclude documents from the start of a
1629
+ * result set returned by a Firestore query.
1630
+ * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or
1631
+ * {@link (startAfter:1)} and can then be passed to {@link query} to create a
1632
+ * new query instance that also contains this `QueryStartAtConstraint`.
1633
+ */
1634
+ export declare class QueryStartAtConstraint extends QueryConstraint {
1635
+ /** The type of this query constraint */
1636
+ readonly type: 'startAt' | 'startAfter';
1637
+ }
1561
1638
  /**
1562
1639
  * Returns true if the provided references are equal.
1563
1640
  *
@@ -1772,45 +1849,45 @@ export declare interface SnapshotOptions {
1772
1849
  readonly serverTimestamps?: 'estimate' | 'previous' | 'none';
1773
1850
  }
1774
1851
  /**
1775
- * Creates a {@link QueryConstraint} that modifies the result set to start after the
1776
- * provided document (exclusive). The starting position is relative to the order
1777
- * of the query. The document must contain all of the fields provided in the
1778
- * orderBy of the query.
1852
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
1853
+ * start after the provided document (exclusive). The starting position is
1854
+ * relative to the order of the query. The document must contain all of the
1855
+ * fields provided in the orderBy of the query.
1779
1856
  *
1780
1857
  * @param snapshot - The snapshot of the document to start after.
1781
- * @returns A {@link QueryConstraint} to pass to `query()`
1858
+ * @returns A {@link QueryStartAtConstraint} to pass to `query()`
1782
1859
  */
1783
- export declare function startAfter(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
1860
+ export declare function startAfter(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
1784
1861
  /**
1785
- * Creates a {@link QueryConstraint} that modifies the result set to start after the
1786
- * provided fields relative to the order of the query. The order of the field
1787
- * values must match the order of the order by clauses of the query.
1862
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
1863
+ * start after the provided fields relative to the order of the query. The order
1864
+ * of the field values must match the order of the order by clauses of the query.
1788
1865
  *
1789
1866
  * @param fieldValues - The field values to start this query after, in order
1790
1867
  * of the query's order by.
1791
- * @returns A {@link QueryConstraint} to pass to `query()`
1868
+ * @returns A {@link QueryStartAtConstraint} to pass to `query()`
1792
1869
  */
1793
- export declare function startAfter(...fieldValues: unknown[]): QueryConstraint;
1870
+ export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;
1794
1871
  /**
1795
- * Creates a {@link QueryConstraint} that modifies the result set to start at the
1796
- * provided document (inclusive). The starting position is relative to the order
1797
- * of the query. The document must contain all of the fields provided in the
1798
- * `orderBy` of this query.
1872
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
1873
+ * start at the provided document (inclusive). The starting position is relative
1874
+ * to the order of the query. The document must contain all of the fields
1875
+ * provided in the `orderBy` of this query.
1799
1876
  *
1800
1877
  * @param snapshot - The snapshot of the document to start at.
1801
- * @returns A {@link QueryConstraint} to pass to `query()`.
1878
+ * @returns A {@link QueryStartAtConstraint} to pass to `query()`.
1802
1879
  */
1803
- export declare function startAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
1880
+ export declare function startAt(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
1804
1881
  /**
1805
- * Creates a {@link QueryConstraint} that modifies the result set to start at the
1806
- * provided fields relative to the order of the query. The order of the field
1807
- * values must match the order of the order by clauses of the query.
1882
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
1883
+ * start at the provided fields relative to the order of the query. The order of
1884
+ * the field values must match the order of the order by clauses of the query.
1808
1885
  *
1809
1886
  * @param fieldValues - The field values to start this query at, in order
1810
1887
  * of the query's order by.
1811
- * @returns A {@link QueryConstraint} to pass to `query()`.
1888
+ * @returns A {@link QueryStartAtConstraint} to pass to `query()`.
1812
1889
  */
1813
- export declare function startAt(...fieldValues: unknown[]): QueryConstraint;
1890
+ export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;
1814
1891
  /**
1815
1892
  * Represents the state of bundle loading tasks.
1816
1893
  *
@@ -2133,17 +2210,17 @@ export declare function updateDoc(reference: DocumentReference<unknown>, field:
2133
2210
  */
2134
2211
  export declare function waitForPendingWrites(firestore: Firestore): Promise<void>;
2135
2212
  /**
2136
- * Creates a {@link QueryConstraint} that enforces that documents must contain the
2137
- * specified field and that the value should satisfy the relation constraint
2138
- * provided.
2213
+ * Creates a {@link QueryFieldFilterConstraint} that enforces that documents
2214
+ * must contain the specified field and that the value should satisfy the
2215
+ * relation constraint provided.
2139
2216
  *
2140
2217
  * @param fieldPath - The path to compare
2141
2218
  * @param opStr - The operation string (e.g "&lt;", "&lt;=", "==", "&lt;",
2142
2219
  * "&lt;=", "!=").
2143
2220
  * @param value - The value for comparison
2144
- * @returns The created {@link Query}.
2221
+ * @returns The created {@link QueryFieldFilterConstraint}.
2145
2222
  */
2146
- export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryConstraint;
2223
+ export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint;
2147
2224
  /**
2148
2225
  * Filter conditions in a {@link where} clause are specified using the
2149
2226
  * strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in',