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

fix(database): fixed typescript type definitions #4550

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/database/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,10 @@ export namespace FirebaseDatabaseTypes {
*/
on(
eventType?: EventType,
callback?: Function,
cancelCallbackOrContext?: Record<string, any>,
callback?: (a: DataSnapshot, b?: string | null) => any,
cancelCallbackOrContext?: ((a: Error) => any) | Record<string, any> | null,
context?: Record<string, any> | null,
): Function;
): (a: DataSnapshot, b?: string | null) => any;

/**
* Listens for exactly one event of the specified event type, and then stops listening.
Expand All @@ -670,12 +670,14 @@ export namespace FirebaseDatabaseTypes {
* @param eventType One of the following strings: "value", "child_added", "child_changed", "child_removed", or "child_moved."
* @param successCallback A callback that fires when the specified event occurs. The callback will be passed a DataSnapshot. For ordering purposes, "child_added", "child_changed", and "child_moved" will also be passed a string containing the key of the previous child by sort order, or `null` if it is the first child.
@param failureCallbackContext An optional callback that will be notified if your client does not have permission to read the data. This callback will be passed an Error object indicating why the failure occurred.
@param context If provided, this object will be used as this when calling your callback(s).
*/

once(
eventType: EventType,
successCallback?: (a: DataSnapshot, b?: string | null) => any,
failureCallbackContext?: ((a: Error) => void) | Record<string, any> | null,
context?: Record<string, any> | null,
): Promise<DataSnapshot>;

/**
Expand Down