Skip to content

Commit 918aacb

Browse files
Merge
2 parents 3ea3327 + 458f8b7 commit 918aacb

File tree

13 files changed

+705
-603
lines changed

13 files changed

+705
-603
lines changed

.changeset/thirty-flies-flow.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@firebase/database-types": patch
3+
"@firebase/database": patch
4+
---
5+
6+
Added interface `Database` which is implemented by `FirebaseDatabase`. This allows consumer SDKs (such as the Firebase Admin SDK) to export the database types as an interface.

packages/database-types/index.d.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,16 @@ export interface DataSnapshot {
3232
val(): any;
3333
}
3434

35-
export class FirebaseDatabase {
36-
private constructor();
35+
export interface Database {
36+
app: FirebaseApp;
37+
goOffline(): void;
38+
goOnline(): void;
39+
ref(path?: string | Reference): Reference;
40+
refFromURL(url: string): Reference;
41+
}
3742

43+
export class FirebaseDatabase implements Database {
44+
private constructor();
3845
app: FirebaseApp;
3946
goOffline(): void;
4047
goOnline(): void;

packages/database/index.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function initStandalone(app: FirebaseApp, url: string, version: string) {
8585
app,
8686
authProvider,
8787
url
88-
) as types.FirebaseDatabase,
88+
) as types.Database,
8989
namespace: {
9090
Reference,
9191
Query,

0 commit comments

Comments
 (0)