diff --git a/packages/firestore/lib/index.d.ts b/packages/firestore/lib/index.d.ts index 7a52a7f954..6747e705ec 100644 --- a/packages/firestore/lib/index.d.ts +++ b/packages/firestore/lib/index.d.ts @@ -55,7 +55,7 @@ export namespace FirebaseFirestoreTypes { export type QueryFilterType = 'OR' | 'AND'; - export interface QueryFilterConstraint { + export interface QueryFieldFilterConstraint { fieldPath: keyof T | FieldPath; operator: WhereFilterOp; value: any; @@ -63,8 +63,11 @@ export namespace FirebaseFirestoreTypes { export interface QueryCompositeFilterConstraint { operator: QueryFilterType; - queries: QueryFilterConstraint[]; + queries: QueryFieldFilterConstraint[]; } + + export type QueryFilterConstraint = QueryFieldFilterConstraint | QueryCompositeFilterConstraint; + /** * The Filter functions used to generate an instance of Filter. */ @@ -73,7 +76,11 @@ export namespace FirebaseFirestoreTypes { * The Filter function used to generate an instance of Filter. * e.g. Filter('name', '==', 'Ada') */ - (fieldPath: keyof T | FieldPath, operator: WhereFilterOp, value: any): QueryFilterConstraint; + ( + fieldPath: keyof T | FieldPath, + operator: WhereFilterOp, + value: any, + ): QueryFieldFilterConstraint; /** * The Filter.or() static function used to generate a logical OR query using multiple Filter instances. * e.g. Filter.or(Filter('name', '==', 'Ada'), Filter('name', '==', 'Bob')) @@ -1412,7 +1419,7 @@ export namespace FirebaseFirestoreTypes { * * @param filter The filter to apply to the query. */ - where(filter: QueryFilterConstraint | QueryCompositeFilterConstraint): Query; + where(filter: QueryFilterConstraint): Query; } /**