From a80748bfbff3012a9e4f9ffe56c97e6bd7e11e85 Mon Sep 17 00:00:00 2001 From: Krystof Celba Date: Thu, 4 Jan 2018 03:39:10 +0100 Subject: [PATCH] [typings][typescript] Add missing types for Crashlytics --- lib/index.d.ts | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/lib/index.d.ts b/lib/index.d.ts index 688dd9bc..1eff94bf 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -64,6 +64,10 @@ declare module "react-native-firebase" { */ crash(): RNFirebase.crash.Crash; + static fabric: { + crashlytics(): RNFirebase.crashlytics.Crashlytics; + }; + apps: Array; googleApiAvailability: RNFirebase.GoogleApiAvailabilityType; @@ -846,5 +850,50 @@ declare module "react-native-firebase" { [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; + } + } } }