2
0
mirror of synced 2025-01-11 14:44:12 +00:00

Use union type for fieldPath option to query orderBy and where functions.

Constructing and passing a FieldPath object to the `orderBy` or `where` functions of a Firestore query currently raises a type error since those functions are only typed to expect a `string` value. This fixes that since those functions do accept FieldPath object types as well as astrings.
This commit is contained in:
Adam Michel 2018-04-24 12:46:23 -07:00
parent 7614f5b7e4
commit ea8e106129
No known key found for this signature in database
GPG Key ID: 3531332DFE01A0DA

4
lib/index.d.ts vendored
View File

@ -1502,7 +1502,7 @@ declare module "react-native-firebase" {
startAfter(...varargs: any[]): Query;
startAt(snapshot: DocumentSnapshot): Query;
startAt(...varargs: any[]): Query;
where(fieldPath: string, op: Types.QueryOperator, value: any): Query;
where(fieldPath: string | FieldPath, op: Types.QueryOperator, value: any): Query;
}
interface DocumentChange {
@ -1598,7 +1598,7 @@ declare module "react-native-firebase" {
startAfter(...varargs: any[]): Query;
startAt(snapshot: DocumentSnapshot): Query;
startAt(...varargs: any[]): Query;
where(fieldPath: string, op: Types.QueryOperator, value: any): Query;
where(fieldPath: string | FieldPath, op: Types.QueryOperator, value: any): Query;
}
namespace Query {
interface NativeFieldPath {