@@ -273,28 +273,50 @@ export type WhereFilterOp =
273
273
export class Query < T = DocumentData > {
274
274
protected constructor ( ) ;
275
275
readonly firestore : FirebaseFirestore ;
276
- where (
277
- fieldPath : string | FieldPath ,
278
- opStr : WhereFilterOp ,
279
- value : any
280
- ) : Query < T > ;
281
- orderBy (
282
- fieldPath : string | FieldPath ,
283
- directionStr ?: OrderByDirection
284
- ) : Query < T > ;
285
- limit ( limit : number ) : Query < T > ;
286
- limitToLast ( limit : number ) : Query < T > ;
287
- startAt ( snapshot : DocumentSnapshot < any > ) : Query < T > ;
288
- startAt ( ...fieldValues : any [ ] ) : Query < T > ;
289
- startAfter ( snapshot : DocumentSnapshot < any > ) : Query < T > ;
290
- startAfter ( ...fieldValues : any [ ] ) : Query < T > ;
291
- endBefore ( snapshot : DocumentSnapshot < any > ) : Query < T > ;
292
- endBefore ( ...fieldValues : any [ ] ) : Query < T > ;
293
- endAt ( snapshot : DocumentSnapshot < any > ) : Query < T > ;
294
- endAt ( ...fieldValues : any [ ] ) : Query < T > ;
276
+
295
277
withConverter < U > ( converter : FirestoreDataConverter < U > ) : Query < U > ;
296
278
}
297
279
280
+ export type QueryConstraintType =
281
+ | 'where'
282
+ | 'orderBy'
283
+ | 'limit'
284
+ | 'limitToLast'
285
+ | 'startAt'
286
+ | 'startAfter'
287
+ | 'endAt'
288
+ | 'endBefore' ;
289
+
290
+ export class QueryConstraint {
291
+ private constructor ( ) ;
292
+ readonly type : QueryConstraintType ;
293
+ }
294
+
295
+ export function query < T > (
296
+ query : CollectionReference < T > | Query < T > ,
297
+ ...constraints : QueryConstraint [ ]
298
+ ) : Query < T > ;
299
+
300
+ export function where (
301
+ fieldPath : string | FieldPath ,
302
+ opStr : WhereFilterOp ,
303
+ value : any
304
+ ) : QueryConstraint ;
305
+ export function orderBy (
306
+ fieldPath : string | FieldPath ,
307
+ directionStr ?: OrderByDirection
308
+ ) : QueryConstraint ;
309
+ export function limit ( limit : number ) : QueryConstraint ;
310
+ export function limitToLast ( limit : number ) : QueryConstraint ;
311
+ export function startAt ( snapshot : DocumentSnapshot < any > ) : QueryConstraint ;
312
+ export function startAt ( ...fieldValues : any [ ] ) : QueryConstraint ;
313
+ export function startAfter ( snapshot : DocumentSnapshot < any > ) : QueryConstraint ;
314
+ export function startAfter ( ...fieldValues : any [ ] ) : QueryConstraint ;
315
+ export function endBefore ( snapshot : DocumentSnapshot < any > ) : QueryConstraint ;
316
+ export function endBefore ( ...fieldValues : any [ ] ) : QueryConstraint ;
317
+ export function endAt ( snapshot : DocumentSnapshot < any > ) : QueryConstraint ;
318
+ export function endAt ( ...fieldValues : any [ ] ) : QueryConstraint ;
319
+
298
320
export class QuerySnapshot < T = DocumentData > {
299
321
private constructor ( ) ;
300
322
readonly query : Query < T > ;
0 commit comments