/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Injectable } from '@angular/core'; var /** @type {?} */ _nextRequestId = 0; export var /** @type {?} */ JSONP_HOME = '__ng_jsonp__'; var /** @type {?} */ _jsonpConnections = null; /** * @return {?} */ function _getJsonpConnections() { var /** @type {?} */ w = typeof window == 'object' ? window : {}; if (_jsonpConnections === null) { _jsonpConnections = w[JSONP_HOME] = {}; } return _jsonpConnections; } export var BrowserJsonp = (function () { function BrowserJsonp() { } /** * @param {?} url * @return {?} */ BrowserJsonp.prototype.build = function (url) { var /** @type {?} */ node = document.createElement('script'); node.src = url; return node; }; /** * @return {?} */ BrowserJsonp.prototype.nextRequestID = function () { return "__req" + _nextRequestId++; }; /** * @param {?} id * @return {?} */ BrowserJsonp.prototype.requestCallback = function (id) { return JSONP_HOME + "." + id + ".finished"; }; /** * @param {?} id * @param {?} connection * @return {?} */ BrowserJsonp.prototype.exposeConnection = function (id, connection) { var /** @type {?} */ connections = _getJsonpConnections(); connections[id] = connection; }; /** * @param {?} id * @return {?} */ BrowserJsonp.prototype.removeConnection = function (id) { var /** @type {?} */ connections = _getJsonpConnections(); connections[id] = null; }; /** * @param {?} node * @return {?} */ BrowserJsonp.prototype.send = function (node) { document.body.appendChild(/** @type {?} */ ((node))); }; /** * @param {?} node * @return {?} */ BrowserJsonp.prototype.cleanup = function (node) { if (node.parentNode) { node.parentNode.removeChild(/** @type {?} */ ((node))); } }; BrowserJsonp.decorators = [ { type: Injectable }, ]; /** @nocollapse */ BrowserJsonp.ctorParameters = function () { return []; }; return BrowserJsonp; }()); function BrowserJsonp_tsickle_Closure_declarations() { /** @type {?} */ BrowserJsonp.decorators; /** * @nocollapse * @type {?} */ BrowserJsonp.ctorParameters; } //# sourceMappingURL=browser_jsonp.js.map