Source code

Revision control

Copy as Markdown

Other Tools

/*
* Copyright 2008 The Closure Compiler Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Definitions for W3C's XML related specifications.
* This file depends on w3c_dom2.js.
* The whole file has been fully type annotated.
*
* Provides the XML standards from W3C.
* Includes:
* XPath - Fully type annotated
* XMLHttpRequest - Fully type annotated
*
*
* @externs
* @author stevey@google.com (Steve Yegge)
*/
/**
* @constructor
*/
function XPathException() {}
/**
* @type {number}
*/
XPathException.INVALID_EXPRESSION_ERR = 52;
/**
* @type {number}
*/
XPathException.TYPE_ERR = 52;
/**
* @type {number}
*/
XPathException.prototype.code;
/**
* @constructor
*/
function XPathEvaluator() {}
/**
* @param {string} expr
* @param {?XPathNSResolver=} opt_resolver
* @throws XPathException
* @throws DOMException
*/
XPathEvaluator.prototype.createExpression = function(expr, opt_resolver) {};
/**
* @param {Node} nodeResolver
*/
XPathEvaluator.prototype.createNSResolver = function(nodeResolver) {};
/**
* @param {string} expr
* @param {Node} contextNode
* @param {?XPathNSResolver=} opt_resolver
* @param {?number=} opt_type
* @param {*=} opt_result
* @return {XPathResult}
* @throws XPathException
* @throws DOMException
*/
XPathEvaluator.prototype.evaluate = function(expr, contextNode, opt_resolver,
opt_type, opt_result) {};
/**
* @constructor
*/
function XPathExpression() {}
/**
* @param {Node} contextNode
* @param {number=} opt_type
* @param {*=} opt_result
* @return {*}
* @throws XPathException
* @throws DOMException
*/
XPathExpression.prototype.evaluate = function(contextNode, opt_type,
opt_result) {};
/**
* @constructor
*/
function XPathNSResolver() {}
/**
* @param {string} prefix
* @return {?string}
*/
XPathNSResolver.prototype.lookupNamespaceURI = function(prefix) {};
/**
*
* XPath is a language for addressing parts of an XML document, designed to be
* used by both XSLT and XPointer.
*
* @noalias
* @constructor
*/
function XPathResult() {}
/**
* @type {boolean} {@see XPathException.TYPE_ERR}
*/
XPathResult.prototype.booleanValue;
/**
* @type {boolean} {@see XPathException.TYPE_ERR}
*/
XPathResult.prototype.invalidInteratorState;
/**
* @type {number}
* @throws XPathException {@see XPathException.TYPE_ERR}
*/
XPathResult.prototype.numberValue;
/**
* @type {number}
* @throws XPathException {@see XPathException.TYPE_ERR}
*/
XPathResult.prototype.resultType;
/**
* @type {Node}
* @throws XPathException {@see XPathException.TYPE_ERR}
*/
XPathResult.prototype.singleNodeValue;
/**
* @type {number}
* @throws XPathException {@see XPathException.TYPE_ERR}
*/
XPathResult.prototype.snapshotLength;
/**
* @type {string}
* @throws XPathException {@see XPathException.TYPE_ERR}
*/
XPathResult.prototype.stringValue;
/**
* @return {Node}
* @throws XPathException {@see XPathException.TYPE_ERR}
* @throws DOMException {@see DOMException.INVALID_STATE_ERR}
*/
XPathResult.prototype.iterateNext = function() {};
/**
* @param {number} index
* @return {Node}
* @throws XPathException
*/
XPathResult.prototype.snapshotItem = function(index) {};
/**
* @type {number}
*/
XPathResult.ANY_TYPE = 0;
/**
* @type {number}
*/
XPathResult.NUMBER_TYPE = 1;
/**
* @type {number}
*/
XPathResult.STRING_TYPE = 2;
/**
* @type {number}
*/
XPathResult.BOOLEAN_TYPE = 3;
/**
* @type {number}
*/
XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4;
/**
* @type {number}
*/
XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5;
/**
* @type {number}
*/
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6;
/**
* @type {number}
*/
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7;
/**
* @type {number}
*/
XPathResult.ANY_UNORDERED_NODE_TYPE = 8;
/**
* @type {number}
*/
XPathResult.FIRST_ORDERED_NODE_TYPE = 9;
/**
* @constructor
* @extends {Node}
*/
function XPathNamespace() {}
/**
* @type {Element}
*/
XPathNamespace.prototype.ownerElement;
/**
* @type {number}
*/
XPathNamespace.XPATH_NAMESPACE_NODE = 13;
/**
*
* (Draft)
*
* The XMLHttpRequest Object specification defines an API that provides
* scripted client functionality for transferring data between a client and a
* server.
*
* @constructor
* @implements {EventTarget}
*/
function XMLHttpRequest() {}
/**
* @param {boolean=} opt_useCapture
* @override
*/
XMLHttpRequest.prototype.addEventListener =
function(type, listener, opt_useCapture) {};
/**
* @param {boolean=} opt_useCapture
* @override
*/
XMLHttpRequest.prototype.removeEventListener =
function(type, listener, opt_useCapture) {};
/** @override */
XMLHttpRequest.prototype.dispatchEvent = function(evt) {};
/**
* @param {string} method
* @param {string} url
* @param {?boolean=} opt_async
* @param {?string=} opt_user
* @param {?string=} opt_password
* @return {undefined}
*/
XMLHttpRequest.prototype.open = function(method, url, opt_async, opt_user,
opt_password) {};
/**
* @param {string} header
* @param {string} value
* @return {undefined}
*/
XMLHttpRequest.prototype.setRequestHeader = function(header, value) {};
/**
* @param {ArrayBuffer|ArrayBufferView|Blob|Document|FormData|string=} opt_data
* @return {undefined}
*/
XMLHttpRequest.prototype.send = function(opt_data) {};
/**
* @return {undefined}
*/
XMLHttpRequest.prototype.abort = function() {};
/**
* @return {string}
*/
XMLHttpRequest.prototype.getAllResponseHeaders = function() {};
/**
* @param {string} header
* @return {string}
*/
XMLHttpRequest.prototype.getResponseHeader = function(header) {};
/**
* @type {string}
*/
XMLHttpRequest.prototype.responseText;
/**
* @type {Document}
*/
XMLHttpRequest.prototype.responseXML;
/**
* @type {number}
*/
XMLHttpRequest.prototype.readyState;
/**
* @type {number}
*/
XMLHttpRequest.prototype.status;
/**
* @type {string}
*/
XMLHttpRequest.prototype.statusText;
/**
* @type {Function}
*/
XMLHttpRequest.prototype.onreadystatechange;
/**
* @type {Function}
*/
XMLHttpRequest.prototype.onerror;
/**
* The FormData object represents an ordered collection of entries. Each entry
* has a name and value.
*
* @param {?Element=} opt_form An optional form to use for constructing the form
* data set.
* @constructor
*/
function FormData(opt_form) {}
/**
* @param {string} name
* @param {Blob|string} value
*/
FormData.prototype.append = function(name, value) {};