Merge pull request #724 from krystofcelba/typescript-fabric-crashlytics

[typings][typescript] Add missing types for Crashlytics
This commit is contained in:
Elliot Hesp 2018-01-04 08:47:03 +00:00 committed by GitHub
commit 1b7c6dd8a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 49 additions and 0 deletions

49
lib/index.d.ts vendored
View File

@ -64,6 +64,10 @@ declare module "react-native-firebase" {
*/ */
crash(): RNFirebase.crash.Crash; crash(): RNFirebase.crash.Crash;
static fabric: {
crashlytics(): RNFirebase.crashlytics.Crashlytics;
};
apps: Array<string>; apps: Array<string>;
googleApiAvailability: RNFirebase.GoogleApiAvailabilityType; googleApiAvailability: RNFirebase.GoogleApiAvailabilityType;
@ -846,5 +850,50 @@ declare module "react-native-firebase" {
[key: string]: any; [key: string]: any;
} }
} }
namespace crashlytics {
interface Crashlytics {
/**
* Forces a crash. Useful for testing your application is set up correctly.
*/
crash(): void;
/**
* Logs a message that will appear in any subsequent crash reports.
*/
log(message: string): void;
/**
* Logs a non fatal exception.
*/
recordError(code: number, message: string): void;
/**
* Set a boolean value to show alongside any subsequent crash reports.
*/
setBoolValue(key: string, value: boolean): void;
/**
* Set a float value to show alongside any subsequent crash reports.
*/
setFloatValue(key: string, value: number): void;
/**
* Set an integer value to show alongside any subsequent crash reports.
*/
setIntValue(key: string, value: number): void;
/**
* Set a string value to show alongside any subsequent crash reports.
*/
setStringValue(key: string, value: string): void;
/**
* Set the user ID to show alongside any subsequent crash reports.
*/
setUserIdentifier(userId: string): void;
}
}
} }
} }