import { ENABLE_CRASHLYTICS_HINT } from "./crashlytics-common";
export function sendCrashLog(exception) {
    if (isCrashlyticsAvailable()) {
        Crashlytics.sharedInstance().recordError(exception);
    }
}
export function log(msg, tag, priority) {
    if (isCrashlyticsAvailable()) {
        if (tag) {
            TNSCrashlyticsLoggerWrapper.log(tag + " - " + msg);
        }
        else {
            TNSCrashlyticsLoggerWrapper.log(msg);
        }
    }
}
export function setString(key, value) {
    if (isCrashlyticsAvailable()) {
        Crashlytics.sharedInstance().setObjectValueForKey(value, key);
    }
}
export function setBool(key, value) {
    if (isCrashlyticsAvailable()) {
        Crashlytics.sharedInstance().setBoolValueForKey(value, key);
    }
}
export function setFloat(key, value) {
    if (isCrashlyticsAvailable()) {
        Crashlytics.sharedInstance().setFloatValueForKey(value, key);
    }
}
export function setInt(key, value) {
    if (isCrashlyticsAvailable()) {
        Crashlytics.sharedInstance().setIntValueForKey(value, key);
    }
}
export function setDouble(key, value) {
    if (isCrashlyticsAvailable()) {
        Crashlytics.sharedInstance().setFloatValueForKey(value, key);
    }
}
export function setUserId(id) {
    if (isCrashlyticsAvailable()) {
        Crashlytics.sharedInstance().setUserIdentifier(id);
    }
}
export function crash() {
    if (isCrashlyticsAvailable()) {
        Crashlytics.sharedInstance().crash();
    }
    Fabric.with(NSArray.arrayWithObject(Crashlytics.class()));
}
export function setCrashlyticsCollectionEnabled(enabled) {
    if (isCrashlyticsAvailable()) {
        Fabric.with(NSArray.arrayWithObject(Crashlytics.class()));
    }
}
function isCrashlyticsAvailable() {
    if (typeof (Crashlytics) === "undefined") {
        console.log(ENABLE_CRASHLYTICS_HINT);
        return false;
    }
    return true;
}
//# sourceMappingURL=crashlytics.ios.js.map