@firebase/firestore 3.7.3 → 3.8.0

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 (120) 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.d.ts +1 -1
  5. package/dist/firestore/src/core/bound.d.ts +49 -0
  6. package/dist/firestore/src/core/filter.d.ts +134 -0
  7. package/dist/firestore/src/core/order_by.d.ts +35 -0
  8. package/dist/firestore/src/core/query.d.ts +5 -6
  9. package/dist/firestore/src/core/target.d.ts +4 -120
  10. package/dist/firestore/src/lite-api/query.d.ts +273 -66
  11. package/dist/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
  12. package/dist/firestore/src/local/local_documents_view.d.ts +0 -2
  13. package/dist/firestore/src/model/document.d.ts +8 -1
  14. package/dist/firestore/src/protos/firestore_proto_api.d.ts +1 -1
  15. package/dist/firestore/src/remote/serializer.d.ts +10 -3
  16. package/dist/firestore/src/util/logic_utils.d.ts +52 -0
  17. package/dist/firestore/src/util/types.d.ts +1 -1
  18. package/dist/firestore/test/lite/helpers.d.ts +1 -1
  19. package/dist/firestore/test/unit/core/filter.test.d.ts +17 -0
  20. package/dist/firestore/test/unit/specs/spec_test_runner.d.ts +2 -1
  21. package/dist/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
  22. package/dist/firestore/test/util/helpers.d.ts +6 -2
  23. package/dist/firestore/test/util/test_platform.d.ts +2 -2
  24. package/dist/index.d.ts +138 -62
  25. package/dist/index.esm2017.js +4295 -3742
  26. package/dist/index.esm2017.js.map +1 -1
  27. package/dist/index.esm5.js +4981 -4410
  28. package/dist/index.esm5.js.map +1 -1
  29. package/dist/index.node.cjs.js +1657 -889
  30. package/dist/index.node.cjs.js.map +1 -1
  31. package/dist/index.node.mjs +1650 -890
  32. package/dist/index.node.mjs.map +1 -1
  33. package/dist/index.rn.js +4520 -3967
  34. package/dist/index.rn.js.map +1 -1
  35. package/dist/internal.d.ts +328 -68
  36. package/dist/lite/firestore/lite/index.d.ts +1 -1
  37. package/dist/lite/firestore/src/api/filter.d.ts +1 -1
  38. package/dist/lite/firestore/src/api.d.ts +1 -1
  39. package/dist/lite/firestore/src/core/bound.d.ts +49 -0
  40. package/dist/lite/firestore/src/core/filter.d.ts +134 -0
  41. package/dist/lite/firestore/src/core/order_by.d.ts +35 -0
  42. package/dist/lite/firestore/src/core/query.d.ts +5 -6
  43. package/dist/lite/firestore/src/core/target.d.ts +4 -120
  44. package/dist/lite/firestore/src/lite-api/query.d.ts +273 -66
  45. package/dist/lite/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
  46. package/dist/lite/firestore/src/local/local_documents_view.d.ts +0 -2
  47. package/dist/lite/firestore/src/model/document.d.ts +8 -1
  48. package/dist/lite/firestore/src/protos/firestore_proto_api.d.ts +1 -1
  49. package/dist/lite/firestore/src/remote/serializer.d.ts +10 -3
  50. package/dist/lite/firestore/src/util/logic_utils.d.ts +52 -0
  51. package/dist/lite/firestore/src/util/types.d.ts +1 -1
  52. package/dist/lite/firestore/test/lite/helpers.d.ts +1 -1
  53. package/dist/lite/firestore/test/unit/core/filter.test.d.ts +17 -0
  54. package/dist/lite/firestore/test/unit/specs/spec_test_runner.d.ts +2 -1
  55. package/dist/lite/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
  56. package/dist/lite/firestore/test/util/helpers.d.ts +6 -2
  57. package/dist/lite/firestore/test/util/test_platform.d.ts +2 -2
  58. package/dist/lite/index.browser.esm2017.js +2091 -1793
  59. package/dist/lite/index.browser.esm2017.js.map +1 -1
  60. package/dist/lite/index.browser.esm5.js +2239 -2000
  61. package/dist/lite/index.browser.esm5.js.map +1 -1
  62. package/dist/lite/index.d.ts +138 -62
  63. package/dist/lite/index.node.cjs.js +2212 -1802
  64. package/dist/lite/index.node.cjs.js.map +1 -1
  65. package/dist/lite/index.node.mjs +2205 -1803
  66. package/dist/lite/index.node.mjs.map +1 -1
  67. package/dist/lite/index.rn.esm2017.js +2077 -1778
  68. package/dist/lite/index.rn.esm2017.js.map +1 -1
  69. package/dist/lite/internal.d.ts +328 -66
  70. package/dist/lite/packages/firestore/dist/lite/index.browser.esm2017.d.ts +322 -174
  71. package/dist/lite/packages/firestore/lite/index.d.ts +1 -1
  72. package/dist/lite/packages/firestore/rollup.config.debug.d.ts +1 -1
  73. package/dist/lite/packages/firestore/src/api/filter.d.ts +1 -1
  74. package/dist/lite/packages/firestore/src/api.d.ts +1 -1
  75. package/dist/lite/packages/firestore/src/core/bound.d.ts +49 -0
  76. package/dist/lite/packages/firestore/src/core/filter.d.ts +134 -0
  77. package/dist/lite/packages/firestore/src/core/order_by.d.ts +35 -0
  78. package/dist/lite/packages/firestore/src/core/query.d.ts +5 -6
  79. package/dist/lite/packages/firestore/src/core/target.d.ts +4 -120
  80. package/dist/lite/packages/firestore/src/lite-api/query.d.ts +273 -66
  81. package/dist/lite/packages/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
  82. package/dist/lite/packages/firestore/src/local/local_documents_view.d.ts +0 -2
  83. package/dist/lite/packages/firestore/src/model/document.d.ts +8 -1
  84. package/dist/lite/packages/firestore/src/protos/firestore_proto_api.d.ts +1 -1
  85. package/dist/lite/packages/firestore/src/remote/serializer.d.ts +10 -3
  86. package/dist/lite/packages/firestore/src/util/logic_utils.d.ts +52 -0
  87. package/dist/lite/packages/firestore/src/util/types.d.ts +1 -1
  88. package/dist/lite/packages/firestore/test/lite/helpers.d.ts +1 -1
  89. package/dist/lite/packages/firestore/test/unit/core/filter.test.d.ts +17 -0
  90. package/dist/lite/packages/firestore/test/unit/specs/spec_test_runner.d.ts +2 -1
  91. package/dist/lite/packages/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
  92. package/dist/lite/packages/firestore/test/util/helpers.d.ts +6 -2
  93. package/dist/lite/packages/firestore/test/util/test_platform.d.ts +2 -2
  94. package/dist/lite/private.d.ts +240 -66
  95. package/dist/packages/firestore/dist/index.esm2017.d.ts +368 -208
  96. package/dist/packages/firestore/lite/index.d.ts +1 -1
  97. package/dist/packages/firestore/rollup.config.debug.d.ts +1 -1
  98. package/dist/packages/firestore/src/api/filter.d.ts +1 -1
  99. package/dist/packages/firestore/src/api.d.ts +1 -1
  100. package/dist/packages/firestore/src/core/bound.d.ts +49 -0
  101. package/dist/packages/firestore/src/core/filter.d.ts +134 -0
  102. package/dist/packages/firestore/src/core/order_by.d.ts +35 -0
  103. package/dist/packages/firestore/src/core/query.d.ts +5 -6
  104. package/dist/packages/firestore/src/core/target.d.ts +4 -120
  105. package/dist/packages/firestore/src/lite-api/query.d.ts +273 -66
  106. package/dist/packages/firestore/src/local/indexeddb_index_manager.d.ts +2 -0
  107. package/dist/packages/firestore/src/local/local_documents_view.d.ts +0 -2
  108. package/dist/packages/firestore/src/model/document.d.ts +8 -1
  109. package/dist/packages/firestore/src/protos/firestore_proto_api.d.ts +1 -1
  110. package/dist/packages/firestore/src/remote/serializer.d.ts +10 -3
  111. package/dist/packages/firestore/src/util/logic_utils.d.ts +52 -0
  112. package/dist/packages/firestore/src/util/types.d.ts +1 -1
  113. package/dist/packages/firestore/test/lite/helpers.d.ts +1 -1
  114. package/dist/packages/firestore/test/unit/core/filter.test.d.ts +17 -0
  115. package/dist/packages/firestore/test/unit/specs/spec_test_runner.d.ts +2 -1
  116. package/dist/packages/firestore/test/unit/util/logic_utils.test.d.ts +17 -0
  117. package/dist/packages/firestore/test/util/helpers.d.ts +6 -2
  118. package/dist/packages/firestore/test/util/test_platform.d.ts +2 -2
  119. package/dist/private.d.ts +240 -68
  120. package/package.json +13 -11
@@ -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
@@ -1087,22 +1087,24 @@ export declare interface IndexField {
1087
1087
  export declare function initializeFirestore(app: FirebaseApp, settings: FirestoreSettings, databaseId?: string): Firestore;
1088
1088
  /* Excluded from this release type: _isBase64Available */
1089
1089
  /**
1090
- * Creates a {@link QueryConstraint} that only returns the first matching documents.
1090
+ * Creates a {@link QueryLimitConstraint} that only returns the first matching
1091
+ * documents.
1091
1092
  *
1092
1093
  * @param limit - The maximum number of items to return.
1093
- * @returns The created {@link Query}.
1094
+ * @returns The created {@link QueryLimitConstraint}.
1094
1095
  */
1095
- export declare function limit(limit: number): QueryConstraint;
1096
+ export declare function limit(limit: number): QueryLimitConstraint;
1096
1097
  /**
1097
- * Creates a {@link QueryConstraint} that only returns the last matching documents.
1098
+ * Creates a {@link QueryLimitConstraint} that only returns the last matching
1099
+ * documents.
1098
1100
  *
1099
1101
  * You must specify at least one `orderBy` clause for `limitToLast` queries,
1100
1102
  * otherwise an exception will be thrown during execution.
1101
1103
  *
1102
1104
  * @param limit - The maximum number of items to return.
1103
- * @returns The created {@link Query}.
1105
+ * @returns The created {@link QueryLimitConstraint}.
1104
1106
  */
1105
- export declare function limitToLast(limit: number): QueryConstraint;
1107
+ export declare function limitToLast(limit: number): QueryLimitConstraint;
1106
1108
  /**
1107
1109
  * Loads a Firestore bundle into the local cache.
1108
1110
  *
@@ -1377,15 +1379,18 @@ export declare function onSnapshotsInSync(firestore: Firestore, observer: {
1377
1379
  */
1378
1380
  export declare function onSnapshotsInSync(firestore: Firestore, onSync: () => void): Unsubscribe;
1379
1381
  /**
1380
- * Creates a {@link QueryConstraint} that sorts the query result by the
1382
+ * Creates a {@link QueryOrderByConstraint} that sorts the query result by the
1381
1383
  * specified field, optionally in descending order instead of ascending.
1382
1384
  *
1385
+ * Note: Documents that do not contain the specified field will not be present
1386
+ * in the query result.
1387
+ *
1383
1388
  * @param fieldPath - The field to sort by.
1384
1389
  * @param directionStr - Optional direction to sort by ('asc' or 'desc'). If
1385
1390
  * not specified, order will be ascending.
1386
- * @returns The created {@link Query}.
1391
+ * @returns The created {@link QueryOrderByConstraint}.
1387
1392
  */
1388
- export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryConstraint;
1393
+ export declare function orderBy(fieldPath: string | FieldPath, directionStr?: OrderByDirection): QueryOrderByConstraint;
1389
1394
  /**
1390
1395
  * The direction of a {@link orderBy} clause is specified as 'desc' or 'asc'
1391
1396
  * (descending or ascending).
@@ -1453,26 +1458,29 @@ export declare class Query<T = DocumentData> {
1453
1458
  */
1454
1459
  withConverter<U>(converter: FirestoreDataConverter<U>): Query<U>;
1455
1460
  }
1461
+ /* Excluded declaration from this release type: query */
1456
1462
  /**
1457
- * Creates a new immutable instance of {@link Query} that is extended to also include
1458
- * additional query constraints.
1463
+ * Creates a new immutable instance of {@link Query} that is extended to also
1464
+ * include additional query constraints.
1459
1465
  *
1460
- * @param query - The {@link Query} instance to use as a base for the new constraints.
1466
+ * @param query - The {@link Query} instance to use as a base for the new
1467
+ * constraints.
1461
1468
  * @param queryConstraints - The list of {@link QueryConstraint}s to apply.
1462
1469
  * @throws if any of the provided query constraints cannot be combined with the
1463
1470
  * existing or new constraints.
1464
1471
  */
1465
1472
  export declare function query<T>(query: Query<T>, ...queryConstraints: QueryConstraint[]): Query<T>;
1473
+ /* Excluded from this release type: QueryCompositeFilterConstraint */
1466
1474
  /**
1467
1475
  * A `QueryConstraint` is used to narrow the set of documents returned by a
1468
1476
  * 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
1477
+ * {@link orderBy}, {@link startAt}, {@link startAfter}, {@link
1478
+ * endBefore}, {@link endAt}, {@link limit}, {@link limitToLast} and
1471
1479
  * can then be passed to {@link query} to create a new query instance that
1472
1480
  * also contains this `QueryConstraint`.
1473
1481
  */
1474
1482
  export declare abstract class QueryConstraint {
1475
- /** The type of this query constraints */
1483
+ /** The type of this query constraint */
1476
1484
  abstract readonly type: QueryConstraintType;
1477
1485
  }
1478
1486
  /** Describes the different query constraints available in this SDK. */
@@ -1504,6 +1512,17 @@ export declare class QueryDocumentSnapshot<T = DocumentData> extends DocumentSna
1504
1512
  */
1505
1513
  data(options?: SnapshotOptions): T;
1506
1514
  }
1515
+ /**
1516
+ * A `QueryEndAtConstraint` is used to exclude documents from the end of a
1517
+ * result set returned by a Firestore query.
1518
+ * `QueryEndAtConstraint`s are created by invoking {@link (endAt:1)} or
1519
+ * {@link (endBefore:1)} and can then be passed to {@link query} to create a new
1520
+ * query instance that also contains this `QueryEndAtConstraint`.
1521
+ */
1522
+ export declare class QueryEndAtConstraint extends QueryConstraint {
1523
+ /** The type of this query constraint */
1524
+ readonly type: 'endBefore' | 'endAt';
1525
+ }
1507
1526
  /**
1508
1527
  * Returns true if the provided queries point to the same collection and apply
1509
1528
  * the same constraints.
@@ -1514,6 +1533,52 @@ export declare class QueryDocumentSnapshot<T = DocumentData> extends DocumentSna
1514
1533
  * Firestore database.
1515
1534
  */
1516
1535
  export declare function queryEqual<T>(left: Query<T>, right: Query<T>): boolean;
1536
+ /**
1537
+ * A `QueryFieldFilterConstraint` is used to narrow the set of documents returned by
1538
+ * a Firestore query by filtering on one or more document fields.
1539
+ * `QueryFieldFilterConstraint`s are created by invoking {@link where} and can then
1540
+ * be passed to {@link query} to create a new query instance that also contains
1541
+ * this `QueryFieldFilterConstraint`.
1542
+ */
1543
+ export declare class QueryFieldFilterConstraint extends QueryConstraint {
1544
+ /** The type of this query constraint */
1545
+ readonly type = "where";
1546
+ }
1547
+ /* Excluded from this release type: QueryFilterConstraint */
1548
+ /**
1549
+ * A `QueryLimitConstraint` is used to limit the number of documents returned by
1550
+ * a Firestore query.
1551
+ * `QueryLimitConstraint`s are created by invoking {@link limit} or
1552
+ * {@link limitToLast} and can then be passed to {@link query} to create a new
1553
+ * query instance that also contains this `QueryLimitConstraint`.
1554
+ */
1555
+ export declare class QueryLimitConstraint extends QueryConstraint {
1556
+ /** The type of this query constraint */
1557
+ readonly type: 'limit' | 'limitToLast';
1558
+ }
1559
+ /**
1560
+ * `QueryNonFilterConstraint` is a helper union type that represents
1561
+ * QueryConstraints which are used to narrow or order the set of documents,
1562
+ * but that do not explicitly filter on a document field.
1563
+ * `QueryNonFilterConstraint`s are created by invoking {@link orderBy},
1564
+ * {@link startAt}, {@link startAfter}, {@link endBefore}, {@link endAt},
1565
+ * {@link limit} or {@link limitToLast} and can then be passed to {@link query}
1566
+ * to create a new query instance that also contains the `QueryConstraint`.
1567
+ */
1568
+ export declare type QueryNonFilterConstraint = QueryOrderByConstraint | QueryLimitConstraint | QueryStartAtConstraint | QueryEndAtConstraint;
1569
+ /**
1570
+ * A `QueryOrderByConstraint` is used to sort the set of documents returned by a
1571
+ * Firestore query. `QueryOrderByConstraint`s are created by invoking
1572
+ * {@link orderBy} and can then be passed to {@link query} to create a new query
1573
+ * instance that also contains this `QueryOrderByConstraint`.
1574
+ *
1575
+ * Note: Documents that do not contain the orderBy field will not be present in
1576
+ * the query result.
1577
+ */
1578
+ export declare class QueryOrderByConstraint extends QueryConstraint {
1579
+ /** The type of this query constraint */
1580
+ readonly type = "orderBy";
1581
+ }
1517
1582
  /**
1518
1583
  * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects
1519
1584
  * representing the results of a query. The documents can be accessed as an
@@ -1558,6 +1623,17 @@ export declare class QuerySnapshot<T = DocumentData> {
1558
1623
  */
1559
1624
  docChanges(options?: SnapshotListenOptions): Array<DocumentChange<T>>;
1560
1625
  }
1626
+ /**
1627
+ * A `QueryStartAtConstraint` is used to exclude documents from the start of a
1628
+ * result set returned by a Firestore query.
1629
+ * `QueryStartAtConstraint`s are created by invoking {@link (startAt:1)} or
1630
+ * {@link (startAfter:1)} and can then be passed to {@link query} to create a
1631
+ * new query instance that also contains this `QueryStartAtConstraint`.
1632
+ */
1633
+ export declare class QueryStartAtConstraint extends QueryConstraint {
1634
+ /** The type of this query constraint */
1635
+ readonly type: 'startAt' | 'startAfter';
1636
+ }
1561
1637
  /**
1562
1638
  * Returns true if the provided references are equal.
1563
1639
  *
@@ -1772,45 +1848,45 @@ export declare interface SnapshotOptions {
1772
1848
  readonly serverTimestamps?: 'estimate' | 'previous' | 'none';
1773
1849
  }
1774
1850
  /**
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.
1851
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
1852
+ * start after the provided document (exclusive). The starting position is
1853
+ * relative to the order of the query. The document must contain all of the
1854
+ * fields provided in the orderBy of the query.
1779
1855
  *
1780
1856
  * @param snapshot - The snapshot of the document to start after.
1781
- * @returns A {@link QueryConstraint} to pass to `query()`
1857
+ * @returns A {@link QueryStartAtConstraint} to pass to `query()`
1782
1858
  */
1783
- export declare function startAfter(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
1859
+ export declare function startAfter(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
1784
1860
  /**
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.
1861
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
1862
+ * start after the provided fields relative to the order of the query. The order
1863
+ * of the field values must match the order of the order by clauses of the query.
1788
1864
  *
1789
1865
  * @param fieldValues - The field values to start this query after, in order
1790
1866
  * of the query's order by.
1791
- * @returns A {@link QueryConstraint} to pass to `query()`
1867
+ * @returns A {@link QueryStartAtConstraint} to pass to `query()`
1792
1868
  */
1793
- export declare function startAfter(...fieldValues: unknown[]): QueryConstraint;
1869
+ export declare function startAfter(...fieldValues: unknown[]): QueryStartAtConstraint;
1794
1870
  /**
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.
1871
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
1872
+ * start at the provided document (inclusive). The starting position is relative
1873
+ * to the order of the query. The document must contain all of the fields
1874
+ * provided in the `orderBy` of this query.
1799
1875
  *
1800
1876
  * @param snapshot - The snapshot of the document to start at.
1801
- * @returns A {@link QueryConstraint} to pass to `query()`.
1877
+ * @returns A {@link QueryStartAtConstraint} to pass to `query()`.
1802
1878
  */
1803
- export declare function startAt(snapshot: DocumentSnapshot<unknown>): QueryConstraint;
1879
+ export declare function startAt(snapshot: DocumentSnapshot<unknown>): QueryStartAtConstraint;
1804
1880
  /**
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.
1881
+ * Creates a {@link QueryStartAtConstraint} that modifies the result set to
1882
+ * start at the provided fields relative to the order of the query. The order of
1883
+ * the field values must match the order of the order by clauses of the query.
1808
1884
  *
1809
1885
  * @param fieldValues - The field values to start this query at, in order
1810
1886
  * of the query's order by.
1811
- * @returns A {@link QueryConstraint} to pass to `query()`.
1887
+ * @returns A {@link QueryStartAtConstraint} to pass to `query()`.
1812
1888
  */
1813
- export declare function startAt(...fieldValues: unknown[]): QueryConstraint;
1889
+ export declare function startAt(...fieldValues: unknown[]): QueryStartAtConstraint;
1814
1890
  /**
1815
1891
  * Represents the state of bundle loading tasks.
1816
1892
  *
@@ -2133,17 +2209,17 @@ export declare function updateDoc(reference: DocumentReference<unknown>, field:
2133
2209
  */
2134
2210
  export declare function waitForPendingWrites(firestore: Firestore): Promise<void>;
2135
2211
  /**
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.
2212
+ * Creates a {@link QueryFieldFilterConstraint} that enforces that documents
2213
+ * must contain the specified field and that the value should satisfy the
2214
+ * relation constraint provided.
2139
2215
  *
2140
2216
  * @param fieldPath - The path to compare
2141
2217
  * @param opStr - The operation string (e.g "&lt;", "&lt;=", "==", "&lt;",
2142
2218
  * "&lt;=", "!=").
2143
2219
  * @param value - The value for comparison
2144
- * @returns The created {@link Query}.
2220
+ * @returns The created {@link QueryFieldFilterConstraint}.
2145
2221
  */
2146
- export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryConstraint;
2222
+ export declare function where(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown): QueryFieldFilterConstraint;
2147
2223
  /**
2148
2224
  * Filter conditions in a {@link where} clause are specified using the
2149
2225
  * strings '&lt;', '&lt;=', '==', '!=', '&gt;=', '&gt;', 'array-contains', 'in',