Update index.d.ts

namespace interfaces, export class as default
This commit is contained in:
Tal Jacobson 2017-03-23 12:06:07 +02:00 committed by GitHub
parent 59a0d7ed6a
commit d4f31e0039
1 changed files with 58 additions and 53 deletions

23
index.d.ts vendored
View File

@ -1,15 +1,15 @@
// Type definitions for React Native Firebase v1.0.0-alpha7
// Project: https://github.com/invertase/react-native-firebase
// Definitions by: Tal <https://github.com/taljacobson>
// TypeScript Version: 2.1
// TODO definitions for storage, database methods, undocumented features
declare module "react-native-firebase" {
class FireBase {
constructor(config?: configurationOptions)
analytics(): Analytics
auth(): Auth
on(type: string, handler: (msg:any) => void): any
export default class FireBase {
constructor(config?: RNFirebase.configurationOptions)
analytics(): RNFirebase.Analytics
auth(): RNFirebase.Auth
on(type: string, handler: (msg: any) => void): any
/** mimics firebase Web SDK */
database(): any
/**RNFirebase mimics the Web Firebase SDK Storage,
@ -22,7 +22,7 @@
* As the Firebase Web SDK has limited messaging functionality,
* the following methods within react-native-firebase have been created to handle FCM in the React Native environment.
*/
messaging(): Messaging
messaging(): RNFirebase.Messaging
/**
* RNFirebase provides crash reporting for your app out of the box.
* Please note crashes do not appear in real-time on the console,
@ -30,9 +30,11 @@
* If you want to manually report a crash,
* such as a pre-caught exception this is possible by using the report method.
*/
crash(): Crash
crash(): RNFirebase.Crash
}
namespace RNFirebase {
/**
* pass custom options by passing an object with configuration options.
* The configuration object will be generated first by the native configuration object, if set and then will be overridden if passed in JS.
@ -387,4 +389,7 @@
*/
report(error: Error, maxStackSize: Number): void
}
}
}