Skip to content
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

interface DataSnapshot should have a type param #88

Open
anfedorov opened this issue Jul 5, 2017 · 2 comments
Open

interface DataSnapshot should have a type param #88

anfedorov opened this issue Jul 5, 2017 · 2 comments

Comments

@anfedorov
Copy link

anfedorov commented Jul 5, 2017

  • 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;
  }
@google-oss-bot
Copy link
Contributor

Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.

@jshcrowthe
Copy link
Contributor

This seems like a great potential PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants