firebase-js-sdk
firebase-js-sdk copied to clipboard
interface DataSnapshot should have a type param
- Operating System version: n/a
- Firebase SDK version: latest
- Firebase Product: database
Describe the problem
I'd like to define types of things in my firebase repo. DataSnapshot.val() returns any.
Steps to reproduce:
call .val on a DataSnapshot
Potential Fix
interface DataSnapshot<S> {
child(path: string): firebase.database.DataSnapshot<any>;
exists(): boolean;
exportVal(): S;
forEach(action: (a: firebase.database.DataSnapshot<S>) => boolean): boolean;
getPriority(): string | number | null;
hasChild(path: string): boolean;
hasChildren(): boolean;
key: string | null;
numChildren(): number;
ref: firebase.database.Reference;
toJSON(): Object | null;
val(): S;
}
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
This seems like a great potential PR!
Hi! I’d like to work on this issue. Could you please assign it to me if it’s still available?