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

Adding the RTDB typings back #140

Merged
merged 2 commits into from
Nov 20, 2017
Merged

Adding the RTDB typings back #140

merged 2 commits into from
Nov 20, 2017

Conversation

hiranya911
Copy link
Contributor

Adding the old RTDB typings back until we figure out a more permanent solution with the JS SDK. Should resolve issues like #136

Copy link

@jshcrowthe jshcrowthe left a 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;

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

Copy link
Contributor Author

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>;

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.

Copy link
Contributor Author

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;

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?

Copy link
Contributor Author

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>;

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> {}

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>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@hiranya911 hiranya911 assigned hiranya911 and unassigned jshcrowthe Nov 20, 2017
@hiranya911 hiranya911 merged commit b6edf5a into master Nov 20, 2017
@hiranya911 hiranya911 deleted the hkj-db-typings branch November 20, 2017 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants