"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_native_1 = require("react-native");
const StringUtils_1 = require("./util/StringUtils");
const CloudwiseNative = react_native_1.NativeModules.CloudwiseBridge;
class CloudwiseAction {
    constructor(key) {
        this.key = key;
    }
    reportError(errorName, errorCode, platform) {
        if (!StringUtils_1.StringUtils.isStringNullEmptyOrWhitespace(errorName)) {
            CloudwiseNative.reportErrorInAction(this.key, errorName, errorCode, platform);
        }
    }
    reportEvent(eventName, platform) {
        if (!StringUtils_1.StringUtils.isStringNullEmptyOrWhitespace(eventName)) {
            CloudwiseNative.reportEventInAction(this.key, eventName, platform);
        }
    }
    reportStringValue(valueName, value, platform) {
        if (!StringUtils_1.StringUtils.isStringNullEmptyOrWhitespace(valueName)) {
            CloudwiseNative.reportStringValueInAction(this.key, valueName, value, platform);
        }
    }
    reportIntValue(valueName, value, platform) {
        if (!StringUtils_1.StringUtils.isStringNullEmptyOrWhitespace(valueName)) {
            CloudwiseNative.reportIntValueInAction(this.key, valueName, value, platform);
        }
    }
    reportDoubleValue(valueName, value, platform) {
        if (!StringUtils_1.StringUtils.isStringNullEmptyOrWhitespace(valueName)) {
            CloudwiseNative.reportDoubleValueInAction(this.key, valueName, value, platform);
        }
    }
    leaveAction(platform) {
        CloudwiseNative.leaveAction(this.key, platform);
    }
}
exports.CloudwiseAction = CloudwiseAction;
