-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(firestore): type definitions #8378
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -701,7 +722,7 @@ export function loadBundle( | |||
* @param name - The name of the query. | |||
* @returns A named Query. | |||
*/ | |||
export function namedQuery(firestore: Firestore, name: string): Query<DocumentData>; | |||
export function namedQuery(firestore: Firestore, name: string): Promise<Query | null>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double checking, @mikehardy, in the firebase-js-sdk documentation, it returns a Promise<Query | null>. But we currently return a Query
. Should we match the firebase-js-sdk in this instance? (I assume yes!).
@@ -173,7 +176,7 @@ export type OrderByDirection = 'desc' | 'asc'; | |||
*/ | |||
export function orderBy( | |||
fieldPath: string | FieldPath, | |||
directionStr: OrderByDirection = 'asc', | |||
directionStr?: OrderByDirection, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep this as it was before, no harm in the additional default information I think
*/ | ||
export function endAt(value: number | string | boolean | null, key?: string): QueryConstraint; | ||
export declare function endAt(...fieldValues: unknown[]): QueryEndAtConstraint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to add the other way of calling endAt:
export function endAt<AppModelType, DbModelType extends DocumentData>(
snapshot: DocumentSnapshot<AppModelType, DbModelType>
): QueryEndAtConstraint;
export function endAt(fieldValues) { | ||
throw new Error('endAt is not implemented'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be revised to match the firebase-js-sdk:
I think it should literally be:
endAt(...fieldValues) {
return new QueryConstraint('endAt', ...fieldValues);
}
return new QueryConstraint('endBefore', value, key); | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
export function endBefore(fieldValues) { | ||
throw new Error('endBefore is not implemented'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as endAt()
above.
* @param firestore | ||
* @param observer | ||
*/ | ||
export declare function onSnapshotsInSync( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onSnapshotsInSync
needs to be implemented in a separate PR. We don't have this functionality at the moment for some reason
Release Summary
Checklist
Android
iOS
Other
(macOS, web)e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__
Test Plan
Think
react-native-firebase
is great? Please consider supporting the project with any of the below:React Native Firebase
andInvertase
on Twitter