Skip to content

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
Contributor

@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;
Copy link
Contributor

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>;
Copy link
Contributor

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>

key: string|null;
parent: admin.database.Reference|null;
root: admin.database.Reference;

Copy link
Contributor

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>;
Copy link
Contributor

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> {}
Copy link
Contributor

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