From ea8e106129be44663384614e7948b9dbc8990267 Mon Sep 17 00:00:00 2001 From: Adam Michel Date: Tue, 24 Apr 2018 12:46:23 -0700 Subject: [PATCH] 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. --- lib/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 86ffd2d0..669c469d 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -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 {