react-native-firebase-compiled
Version:
A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto
67 lines (48 loc) • 2.11 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _native = require("../../utils/native");
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
class HttpMetric {
constructor(perf, url, httpMethod) {
_defineProperty(this, "url", void 0);
_defineProperty(this, "httpMethod", void 0);
_defineProperty(this, "_perf", void 0);
this._perf = perf;
this.url = url;
this.httpMethod = httpMethod;
}
getAttribute(attribute) {
return (0, _native.getNativeModule)(this._perf).getHttpMetricAttribute(this.url, this.httpMethod, attribute);
}
getAttributes() {
return (0, _native.getNativeModule)(this._perf).getHttpMetricAttributes(this.url, this.httpMethod);
}
putAttribute(attribute, value) {
return (0, _native.getNativeModule)(this._perf).putHttpMetricAttribute(this.url, this.httpMethod, attribute, value);
}
removeAttribute(attribute) {
return (0, _native.getNativeModule)(this._perf).removeHttpMetricAttribute(this.url, this.httpMethod, attribute);
}
setHttpResponseCode(code) {
return (0, _native.getNativeModule)(this._perf).setHttpMetricResponseCode(this.url, this.httpMethod, code);
}
setRequestPayloadSize(bytes) {
return (0, _native.getNativeModule)(this._perf).setHttpMetricRequestPayloadSize(this.url, this.httpMethod, bytes);
}
setResponseContentType(type) {
return (0, _native.getNativeModule)(this._perf).setHttpMetricResponseContentType(this.url, this.httpMethod, type);
}
setResponsePayloadSize(bytes) {
return (0, _native.getNativeModule)(this._perf).setHttpMetricResponsePayloadSize(this.url, this.httpMethod, bytes);
}
start() {
return (0, _native.getNativeModule)(this._perf).startHttpMetric(this.url, this.httpMethod);
}
stop() {
return (0, _native.getNativeModule)(this._perf).stopHttpMetric(this.url, this.httpMethod);
}
}
exports.default = HttpMetric;