-
Notifications
You must be signed in to change notification settings - Fork 373
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
Adding the RTDB typings back #140
Conversation
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.
If you'll look at the comments that'd be great. All-things-considered, this looks good.
src/index.d.ts
Outdated
hasChild(path: string): boolean; | ||
hasChildren(): boolean; | ||
numChildren(): number; | ||
toJSON(): Object; |
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.
JS SDK has this line as Object | 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.
Done
} | ||
|
||
interface OnDisconnect { | ||
cancel(onComplete?: (a: Error|null) => any): Promise<void>; |
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.
JS SDK does Promise<any>
here and on the rest of the functions in this interface.
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.
I will keep this unchanged for now, since we already seem to have some other (non-DB) APIs that return Promise<void>
src/index.d.ts
Outdated
key: string|null; | ||
parent: admin.database.Reference|null; | ||
root: admin.database.Reference; | ||
|
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 is missing the path
property?
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.
Done
child(path: string): admin.database.Reference; | ||
onDisconnect(): admin.database.OnDisconnect; | ||
push(value?: any, onComplete?: (a: Error|null) => any): admin.database.ThenableReference; | ||
remove(onComplete?: (a: Error|null) => any): Promise<void>; |
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.
Promise<any>
?
src/index.d.ts
Outdated
update(values: Object, onComplete?: (a: Error|null) => any): Promise<void>; | ||
} | ||
|
||
interface ThenableReference extends admin.database.Reference, Promise<any> {} |
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.
JS SDK extends a PromiseLike<any>
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.
Done
Adding the old RTDB typings back until we figure out a more permanent solution with the JS SDK. Should resolve issues like #136