Skip to content

Commit

Permalink
export types from @firebase/database-compat for admin SDK (#5531)
Browse files Browse the repository at this point in the history
* export types for admin SDK

* Create violet-goats-turn.md

* add app-compat to devDeps
  • Loading branch information
Feiyang1 committed Sep 22, 2021
1 parent 5823d0b commit b79bd33
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-goats-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/database-compat": patch
---

export types from @firebase/database-compat for admin SDK
3 changes: 3 additions & 0 deletions packages/database-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@
"@firebase/util": "1.3.0",
"@firebase/component": "0.5.6",
"tslib": "^2.1.0"
},
"devDependencies": {
"@firebase/app-compat": "0.1.1"
}
}
5 changes: 5 additions & 0 deletions packages/database-compat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export function registerDatabase(instance: FirebaseNamespace) {

registerDatabase(firebase);

// Types to export for the admin SDK. They are exported in the browser entry point only for typings
// The same symbol should be exported from the node entry point so their values can be accessed at runtime by admin SDK
export type { Database, Query, Reference, enableLogging, ServerValue, DataSnapshot };
export type { OnDisconnect } from '@firebase/database';

declare module '@firebase/app-compat' {
interface FirebaseNamespace {
database?: {
Expand Down

0 comments on commit b79bd33

Please sign in to comment.