Skip to content

Commit 4f63132

Browse files
jmwskiFeiyang1
andauthored
Add type definitions for get() (#4096)
* Add type definitions for get() * cleanup * Update .changeset/many-snails-kneel.md Co-authored-by: Feiyang <[email protected]> * more specific changelog Co-authored-by: Feiyang <[email protected]>
1 parent 3c3c5fa commit 4f63132

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

.changeset/many-snails-kneel.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"firebase": patch
3+
---
4+
5+
Add the missing type definition for 'Query.get()' for RTDB

packages/database-types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export interface Query {
8181
callback?: (a: DataSnapshot, b?: string | null) => any,
8282
context?: Object | null
8383
): void;
84+
get(): Promise<DataSnapshot>;
8485
on(
8586
eventType: EventType,
8687
callback: (a: DataSnapshot, b?: string | null) => any,

packages/firebase/index.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6171,6 +6171,16 @@ declare namespace firebase.database {
61716171
context?: Object | null
61726172
): void;
61736173

6174+
/**
6175+
* Gets the most up-to-date result for this query.
6176+
*
6177+
* @return A promise which resolves to the resulting DataSnapshot if
6178+
* a value is available, or rejects if the client is unable to return
6179+
* a value (e.g., if the server is unreachable and there is nothing
6180+
* cached).
6181+
*/
6182+
get(): Promise<DataSnapshot>;
6183+
61746184
/**
61756185
* Listens for data changes at a particular location.
61766186
*

0 commit comments

Comments
 (0)