# lib/goog/net/xhrlike.js

    1// Copyright 2013 The Closure Library Authors. All Rights Reserved.2//3// Licensed under the Apache License, Version 2.0 (the "License");4// you may not use this file except in compliance with the License.5// You may obtain a copy of the License at6//7//      http://www.apache.org/licenses/LICENSE-2.08//9// Unless required by applicable law or agreed to in writing, software10// distributed under the License is distributed on an "AS-IS" BASIS,11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12// See the License for the specific language governing permissions and13// limitations under the License.1415goog.provide('goog.net.XhrLike');16171819/**20 * Interface for the common parts of XMLHttpRequest.21 *22 * Mostly copied from externs/w3c_xml.js.23 *24 * @interface25 * @see http://www.w3.org/TR/XMLHttpRequest/26 */27goog.net.XhrLike = function() {};282930/**31 * Typedef that refers to either native or custom-implemented XHR objects.32 * @typedef {!goog.net.XhrLike|!XMLHttpRequest}33 */34goog.net.XhrLike.OrNative;353637/**38 * @type {function()|null|undefined}39 * @see http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange40 */41goog.net.XhrLike.prototype.onreadystatechange;424344/**45 * @type {string}46 * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute47 */48goog.net.XhrLike.prototype.responseText;495051/**52 * @type {Document}53 * @see http://www.w3.org/TR/XMLHttpRequest/#the-responsexml-attribute54 */55goog.net.XhrLike.prototype.responseXML;565758/**59 * @type {number}60 * @see http://www.w3.org/TR/XMLHttpRequest/#readystate61 */62goog.net.XhrLike.prototype.readyState;636465/**66 * @type {number}67 * @see http://www.w3.org/TR/XMLHttpRequest/#status68 */69goog.net.XhrLike.prototype.status;707172/**73 * @type {string}74 * @see http://www.w3.org/TR/XMLHttpRequest/#statustext75 */76goog.net.XhrLike.prototype.statusText;777879/**80 * @param {string} method81 * @param {string} url82 * @param {?boolean=} opt_async83 * @param {?string=} opt_user84 * @param {?string=} opt_password85 * @see http://www.w3.org/TR/XMLHttpRequest/#the-open()-method86 */87goog.net.XhrLike.prototype.open = function(method, url, opt_async, opt_user,88    opt_password) {};899091/**92 * @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=} opt_data93 * @see http://www.w3.org/TR/XMLHttpRequest/#the-send()-method94 */95goog.net.XhrLike.prototype.send = function(opt_data) {};969798/**99 * @see http://www.w3.org/TR/XMLHttpRequest/#the-abort()-method100 */101goog.net.XhrLike.prototype.abort = function() {};102103104/**105 * @param {string} header106 * @param {string} value107 * @see http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method108 */109goog.net.XhrLike.prototype.setRequestHeader = function(header, value) {};110111112/**113 * @param {string} header114 * @return {string}115 * @see http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method116 */117goog.net.XhrLike.prototype.getResponseHeader = function(header) {};118119120/**121 * @return {string}122 * @see http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method123 */124goog.net.XhrLike.prototype.getAllResponseHeaders = function() {};