UNPKG

@schibstedspain/openads-appnexus-prebid

Version:
127 lines (91 loc) 2.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; /** * @class * @implements {AstClient} */ var AstClientImpl = /*#__PURE__*/ function () { function AstClientImpl(_ref) { var logger = _ref.logger, window = _ref.window; this._window = window; this._window.apntag = this._window.apntag || {}; this._window.apntag.anq = this._window.apntag.anq || []; this._apnTag = this._window.apntag; this._logger = logger; } var _proto = AstClientImpl.prototype; _proto.debugMode = function debugMode(_ref2) { var enabled = _ref2.enabled; this._apnTag.debug = enabled; return this; }; _proto.setPageOpts = function setPageOpts(data) { var _this = this; this._apnTag.anq.push(function () { return _this._apnTag.setPageOpts(data); }); return this; }; _proto.onEvent = function onEvent(_ref3) { var _this2 = this; var event = _ref3.event, targetId = _ref3.targetId, callback = _ref3.callback; this._logger.debug(this._logger.name, '| onEvent | event:', event, '| targetId:', targetId); this._apnTag.anq.push(function () { return _this2._apnTag.onEvent(event, targetId, callback); }); return this; }; _proto.defineTag = function defineTag(data) { var _this3 = this; this._logger.debug(this._logger.name, '| defineTag | data:', data); this._apnTag.anq.push(function () { return _this3._apnTag.defineTag(data); }); return this; }; _proto.loadTags = function loadTags() { var _this4 = this; this._logger.debug(this._logger.name, '| loadTags has been called'); this._apnTag.anq.push(function () { return _this4._apnTag.loadTags(); }); return this; }; _proto.showTag = function showTag(_ref4) { var _this5 = this; var targetId = _ref4.targetId; this._logger.debug(this._logger.name, '| showTag | targetId:', targetId); this._apnTag.anq.push(function () { return _this5._apnTag.showTag(targetId); }); return this; }; _proto.refresh = function refresh(targetsArray) { var _this6 = this; this._logger.debug(this._logger.name, '| refresh | targetsArray:', targetsArray); this._apnTag.anq.push(function () { return _this6._apnTag.refresh(targetsArray); }); return this; }; _proto.modifyTag = function modifyTag(_ref5) { var _this7 = this; var targetId = _ref5.targetId, data = _ref5.data; this._logger.debug(this._logger.name, '| modifyTag | targetId:', targetId, '| data:', data); this._apnTag.anq.push(function () { return _this7._apnTag.modifyTag(targetId, data); }); return this; }; return AstClientImpl; }(); exports.default = AstClientImpl;