Skip to content

Commit

Permalink
Modify the "Firebase" declaration to interface by decomposing class.
Browse files Browse the repository at this point in the history
  • Loading branch information
in-async committed Nov 9, 2014
1 parent 1ad70f7 commit a1639fb
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions firebase/firebase.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ interface IFirebaseOnDisconnect {
cancel(onComplete?: (error: any) => void): void;
}

declare class IFirebaseQuery {
interface IFirebaseQuery {
/**
* Listens for data changes at a particular location.
*/
Expand Down Expand Up @@ -148,11 +148,7 @@ declare class IFirebaseQuery {
ref(): Firebase;
}

declare class Firebase extends IFirebaseQuery {
/**
* Constructs a new Firebase reference from a full Firebase URL.
*/
constructor(firebaseURL: string);
interface Firebase extends IFirebaseQuery {
/**
* @deprecated Use authWithCustomToken() instead.
* Authenticates a Firebase client using the provided authentication token or Firebase Secret.
Expand Down Expand Up @@ -272,23 +268,30 @@ declare class Firebase extends IFirebaseQuery {
*/
resetPassword(credentials: { email: string }, onComplete: (error: any) => void): void;
onDisconnect(): IFirebaseOnDisconnect;
}
interface FirebaseStatic {
/**
* Constructs a new Firebase reference from a full Firebase URL.
*/
new (firebaseURL: string): Firebase;
/**
* Manually disconnects the Firebase client from the server and disables automatic reconnection.
*/
static goOffline(): void;
goOffline(): void;
/**
* Manually reestablishes a connection to the Firebase server and enables automatic reconnection.
*/
static goOnline(): void;
goOnline(): void;

static ServerValue: {
ServerValue: {
/**
* A placeholder value for auto-populating the current timestamp
* (time since the Unix epoch, in milliseconds) by the Firebase servers.
*/
TIMESTAMP: any;
};
}
declare var Firebase: FirebaseStatic;

// Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html
interface IFirebaseAuthData {
Expand Down

0 comments on commit a1639fb

Please sign in to comment.