diff --git a/.changeset/many-snails-kneel.md b/.changeset/many-snails-kneel.md new file mode 100644 index 00000000000..3755e4ce876 --- /dev/null +++ b/.changeset/many-snails-kneel.md @@ -0,0 +1,5 @@ +--- +"firebase": patch +--- + +Add the missing type definition for 'Query.get()' for RTDB diff --git a/packages/database-types/index.d.ts b/packages/database-types/index.d.ts index fa377fb241d..a59be87eb4d 100644 --- a/packages/database-types/index.d.ts +++ b/packages/database-types/index.d.ts @@ -81,6 +81,7 @@ export interface Query { callback?: (a: DataSnapshot, b?: string | null) => any, context?: Object | null ): void; + get(): Promise; on( eventType: EventType, callback: (a: DataSnapshot, b?: string | null) => any, diff --git a/packages/firebase/index.d.ts b/packages/firebase/index.d.ts index 2cae198c74d..b922fcff0e5 100644 --- a/packages/firebase/index.d.ts +++ b/packages/firebase/index.d.ts @@ -6171,6 +6171,16 @@ declare namespace firebase.database { context?: Object | null ): void; + /** + * Gets the most up-to-date result for this query. + * + * @return A promise which resolves to the resulting DataSnapshot if + * a value is available, or rejects if the client is unable to return + * a value (e.g., if the server is unreachable and there is nothing + * cached). + */ + get(): Promise; + /** * Listens for data changes at a particular location. *