firebase / firebase/firebase-js-sdk
interface DataSnapshot should have a type param
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 37
Description
* 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
```javascript
interface DataSnapshot {
child(path: string): firebase.database.DataSnapshot;
exists(): boolean;
exportVal(): S;
forEach(action: (a: firebase.database.DataSnapshot) => 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;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.