Skip to content

Fixing Typings for RTDB #264

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

Merged
merged 4 commits into from
Oct 25, 2017
Merged
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions packages/database/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ import './src/nodePatches';
* @param app A valid FirebaseApp-like object
* @param url A valid Firebase databaseURL
*/

const ServerValue = Database.ServerValue;

export function initStandalone(app, url) {
return {
instance: RepoManager.getInstance().databaseFromApp(app, url),
Expand All @@ -41,7 +44,7 @@ export function initStandalone(app, url) {
Database,
enableLogging,
INTERNAL,
ServerValue: Database.ServerValue,
ServerValue,
TEST_ACCESS
}
};
Expand All @@ -59,7 +62,7 @@ export function registerDatabase(instance: FirebaseNamespace) {
Database,
enableLogging,
INTERNAL,
ServerValue: Database.ServerValue,
ServerValue,
TEST_ACCESS
},
null,
Expand All @@ -72,3 +75,9 @@ export function registerDatabase(instance: FirebaseNamespace) {
}

registerDatabase(firebase);

// Types to export for the admin SDK
export { Database, Query, Reference, enableLogging, ServerValue };

export { DataSnapshot } from './src/api/DataSnapshot';
export { OnDisconnect } from './src/api/onDisconnect';
10 changes: 9 additions & 1 deletion packages/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import * as INTERNAL from './src/api/internal';
import * as TEST_ACCESS from './src/api/test_access';
import { isNodeSdk } from '@firebase/util';

const ServerValue = Database.ServerValue;

export function registerDatabase(instance: FirebaseNamespace) {
// Register the Database Service with the 'firebase' namespace.
const namespace = instance.INTERNAL.registerService(
Expand All @@ -36,7 +38,7 @@ export function registerDatabase(instance: FirebaseNamespace) {
Database,
enableLogging,
INTERNAL,
ServerValue: Database.ServerValue,
ServerValue,
TEST_ACCESS
},
null,
Expand All @@ -49,3 +51,9 @@ export function registerDatabase(instance: FirebaseNamespace) {
}

registerDatabase(firebase);

// Types to export for the admin SDK
export { Database, Query, Reference, enableLogging, ServerValue };

export { DataSnapshot } from './src/api/DataSnapshot';
export { OnDisconnect } from './src/api/onDisconnect';
2 changes: 1 addition & 1 deletion packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
"bugs": {
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"typings": "dist/index.d.ts"
"typings": "dist/cjs/index.d.ts"
}