Path: blob/trunk/third_party/closure/goog/net/xhrlike.js
4500 views
/**1* @license2* Copyright The Closure Library Authors.3* SPDX-License-Identifier: Apache-2.04*/56goog.provide('goog.net.XhrLike');78910/**11* Interface for the common parts of XMLHttpRequest.12*13* Mostly copied from externs/w3c_xml.js.14*15* @interface16* @see http://www.w3.org/TR/XMLHttpRequest/17*/18goog.net.XhrLike = function() {};192021/**22* Typedef that refers to either native or custom-implemented XHR objects.23* @typedef {!goog.net.XhrLike|!XMLHttpRequest}24*/25goog.net.XhrLike.OrNative;262728/**29* @type {function()|null|undefined}30* @see http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange31*/32goog.net.XhrLike.prototype.onreadystatechange;333435/**36* @type {?ArrayBuffer|?Blob|?Document|?Object|?string}37* @see https://xhr.spec.whatwg.org/#response-object38*/39goog.net.XhrLike.prototype.response;404142/**43* @type {string}44* @see http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute45*/46goog.net.XhrLike.prototype.responseText;474849/**50* @type {string}51* @see https://xhr.spec.whatwg.org/#the-responsetype-attribute52*/53goog.net.XhrLike.prototype.responseType;545556/**57* @type {Document}58* @see http://www.w3.org/TR/XMLHttpRequest/#the-responsexml-attribute59*/60goog.net.XhrLike.prototype.responseXML;616263/**64* @type {number}65* @see http://www.w3.org/TR/XMLHttpRequest/#readystate66*/67goog.net.XhrLike.prototype.readyState;686970/**71* @type {number}72* @see http://www.w3.org/TR/XMLHttpRequest/#status73*/74goog.net.XhrLike.prototype.status;757677/**78* @type {string}79* @see http://www.w3.org/TR/XMLHttpRequest/#statustext80*/81goog.net.XhrLike.prototype.statusText;828384/**85* @param {string} method86* @param {string} url87* @param {?boolean=} opt_async88* @param {?string=} opt_user89* @param {?string=} opt_password90* @see http://www.w3.org/TR/XMLHttpRequest/#the-open()-method91*/92goog.net.XhrLike.prototype.open = function(93method, url, opt_async, opt_user, opt_password) {};949596/**97* @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=} opt_data98* @see http://www.w3.org/TR/XMLHttpRequest/#the-send()-method99*/100goog.net.XhrLike.prototype.send = function(opt_data) {};101102103/**104* @see http://www.w3.org/TR/XMLHttpRequest/#the-abort()-method105*/106goog.net.XhrLike.prototype.abort = function() {};107108109/**110* @param {string} header111* @param {string} value112* @see http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader()-method113*/114goog.net.XhrLike.prototype.setRequestHeader = function(header, value) {};115116117/**118* @param {string} header119* @return {?string}120* @see http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method121*/122goog.net.XhrLike.prototype.getResponseHeader = function(header) {};123124125/**126* @return {string}127* @see http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method128*/129goog.net.XhrLike.prototype.getAllResponseHeaders = function() {};130131/**132* @type {?function(!TrustTokenAttributeType): void | undefined}133* @see https://docs.google.com/document/d/1qUjtKgA7nMv9YGMhi0xWKEojkSITKzGLdIcZgoz6ZkI.134*/135goog.net.XhrLike.prototype.setTrustToken = function(trustTokenAttribute) {};136137138