| 1 | /* |
| 2 | * Copyright 2008 Closure Compiler Authors |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * @fileoverview Definitions for W3C's XML related specifications. |
| 19 | * This file depends on w3c_dom2.js. |
| 20 | * The whole file has been fully type annotated. |
| 21 | * |
| 22 | * Provides the XML standards from W3C. |
| 23 | * Includes: |
| 24 | * XPath - Fully type annotated |
| 25 | * XMLHttpRequest - Fully type annotated |
| 26 | * |
| 27 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html |
| 28 | * @see http://www.w3.org/TR/XMLHttpRequest/ |
| 29 | * @see http://www.w3.org/TR/XMLHttpRequest2/ |
| 30 | * |
| 31 | * @externs |
| 32 | */ |
| 33 | |
| 34 | |
| 35 | /** |
| 36 | * @constructor |
| 37 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathException |
| 38 | */ |
| 39 | function XPathException() {} |
| 40 | |
| 41 | /** |
| 42 | * @type {number} |
| 43 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#INVALID_EXPRESSION_ERR |
| 44 | */ |
| 45 | XPathException.INVALID_EXPRESSION_ERR = 52; |
| 46 | |
| 47 | /** |
| 48 | * @type {number} |
| 49 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#TYPE_ERR |
| 50 | */ |
| 51 | XPathException.TYPE_ERR = 52; |
| 52 | |
| 53 | /** |
| 54 | * @type {number} |
| 55 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html# |
| 56 | */ |
| 57 | XPathException.prototype.code; |
| 58 | |
| 59 | /** |
| 60 | * @constructor |
| 61 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator |
| 62 | */ |
| 63 | function XPathEvaluator() {} |
| 64 | |
| 65 | /** |
| 66 | * @param {string} expr |
| 67 | * @param {?XPathNSResolver=} opt_resolver |
| 68 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createExpression |
| 69 | * @throws XPathException |
| 70 | * @throws DOMException |
| 71 | */ |
| 72 | XPathEvaluator.prototype.createExpression = function(expr, opt_resolver) {}; |
| 73 | |
| 74 | /** |
| 75 | * @param {Node} nodeResolver |
| 76 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-createNSResolver |
| 77 | */ |
| 78 | XPathEvaluator.prototype.createNSResolver = function(nodeResolver) {}; |
| 79 | |
| 80 | /** |
| 81 | * @param {string} expr |
| 82 | * @param {Node} contextNode |
| 83 | * @param {?XPathNSResolver=} opt_resolver |
| 84 | * @param {?number=} opt_type |
| 85 | * @param {*=} opt_result |
| 86 | * @return {XPathResult} |
| 87 | * @throws XPathException |
| 88 | * @throws DOMException |
| 89 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator-evaluate |
| 90 | */ |
| 91 | XPathEvaluator.prototype.evaluate = function(expr, contextNode, opt_resolver, |
| 92 | opt_type, opt_result) {}; |
| 93 | |
| 94 | |
| 95 | /** |
| 96 | * @constructor |
| 97 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression |
| 98 | */ |
| 99 | function XPathExpression() {} |
| 100 | |
| 101 | /** |
| 102 | * @param {Node} contextNode |
| 103 | * @param {number=} opt_type |
| 104 | * @param {*=} opt_result |
| 105 | * @return {*} |
| 106 | * @throws XPathException |
| 107 | * @throws DOMException |
| 108 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression-evaluate |
| 109 | */ |
| 110 | XPathExpression.prototype.evaluate = function(contextNode, opt_type, |
| 111 | opt_result) {}; |
| 112 | |
| 113 | |
| 114 | /** |
| 115 | * @constructor |
| 116 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver |
| 117 | */ |
| 118 | function XPathNSResolver() {} |
| 119 | |
| 120 | /** |
| 121 | * @param {string} prefix |
| 122 | * @return {?string} |
| 123 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver-lookupNamespaceURI |
| 124 | */ |
| 125 | XPathNSResolver.prototype.lookupNamespaceURI = function(prefix) {}; |
| 126 | |
| 127 | /** |
| 128 | * From http://www.w3.org/TR/xpath |
| 129 | * |
| 130 | * XPath is a language for addressing parts of an XML document, designed to be |
| 131 | * used by both XSLT and XPointer. |
| 132 | * |
| 133 | * @noalias |
| 134 | * @constructor |
| 135 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult |
| 136 | */ |
| 137 | function XPathResult() {} |
| 138 | |
| 139 | /** |
| 140 | * @type {boolean} {@see XPathException.TYPE_ERR} |
| 141 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-booleanValue |
| 142 | */ |
| 143 | XPathResult.prototype.booleanValue; |
| 144 | |
| 145 | /** |
| 146 | * @type {boolean} {@see XPathException.TYPE_ERR} |
| 147 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-invalid-iterator-state |
| 148 | */ |
| 149 | XPathResult.prototype.invalidInteratorState; |
| 150 | |
| 151 | /** |
| 152 | * @type {number} |
| 153 | * @throws XPathException {@see XPathException.TYPE_ERR} |
| 154 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-numberValue |
| 155 | */ |
| 156 | XPathResult.prototype.numberValue; |
| 157 | |
| 158 | /** |
| 159 | * @type {number} |
| 160 | * @throws XPathException {@see XPathException.TYPE_ERR} |
| 161 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-resultType |
| 162 | */ |
| 163 | XPathResult.prototype.resultType; |
| 164 | |
| 165 | /** |
| 166 | * @type {Node} |
| 167 | * @throws XPathException {@see XPathException.TYPE_ERR} |
| 168 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-singleNodeValue |
| 169 | */ |
| 170 | XPathResult.prototype.singleNodeValue; |
| 171 | |
| 172 | /** |
| 173 | * @type {number} |
| 174 | * @throws XPathException {@see XPathException.TYPE_ERR} |
| 175 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-snapshot-length |
| 176 | */ |
| 177 | XPathResult.prototype.snapshotLength; |
| 178 | |
| 179 | /** |
| 180 | * @type {string} |
| 181 | * @throws XPathException {@see XPathException.TYPE_ERR} |
| 182 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-stringValue |
| 183 | */ |
| 184 | XPathResult.prototype.stringValue; |
| 185 | |
| 186 | /** |
| 187 | * @return {Node} |
| 188 | * @throws XPathException {@see XPathException.TYPE_ERR} |
| 189 | * @throws DOMException {@see DOMException.INVALID_STATE_ERR} |
| 190 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-iterateNext |
| 191 | */ |
| 192 | XPathResult.prototype.iterateNext = function() {}; |
| 193 | |
| 194 | /** |
| 195 | * @param {number} index |
| 196 | * @return {Node} |
| 197 | * @throws XPathException |
| 198 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-snapshotItem |
| 199 | */ |
| 200 | XPathResult.prototype.snapshotItem = function(index) {}; |
| 201 | |
| 202 | /** |
| 203 | * @type {number} |
| 204 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ANY-TYPE |
| 205 | */ |
| 206 | XPathResult.ANY_TYPE = 0; |
| 207 | |
| 208 | /** |
| 209 | * @type {number} |
| 210 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-NUMBER-TYPE |
| 211 | */ |
| 212 | XPathResult.NUMBER_TYPE = 1; |
| 213 | |
| 214 | /** |
| 215 | * @type {number} |
| 216 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-STRING-TYPE |
| 217 | */ |
| 218 | XPathResult.STRING_TYPE = 2; |
| 219 | |
| 220 | /** |
| 221 | * @type {number} |
| 222 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-BOOLEAN-TYPE |
| 223 | */ |
| 224 | XPathResult.BOOLEAN_TYPE = 3; |
| 225 | |
| 226 | /** |
| 227 | * @type {number} |
| 228 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-UNORDERED-NODE-ITERATOR-TYPE |
| 229 | */ |
| 230 | XPathResult.UNORDERED_NODE_ITERATOR_TYPE = 4; |
| 231 | |
| 232 | /** |
| 233 | * @type {number} |
| 234 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-ITERATOR-TYPE |
| 235 | */ |
| 236 | XPathResult.ORDERED_NODE_ITERATOR_TYPE = 5; |
| 237 | |
| 238 | /** |
| 239 | * @type {number} |
| 240 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-UNORDERED-NODE-SNAPSHOT-TYPE |
| 241 | */ |
| 242 | XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE = 6; |
| 243 | |
| 244 | /** |
| 245 | * @type {number} |
| 246 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ORDERED-NODE-SNAPSHOT-TYPE |
| 247 | */ |
| 248 | XPathResult.ORDERED_NODE_SNAPSHOT_TYPE = 7; |
| 249 | |
| 250 | /** |
| 251 | * @type {number} |
| 252 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-ANY-UNORDERED-NODE-TYPE |
| 253 | */ |
| 254 | XPathResult.ANY_UNORDERED_NODE_TYPE = 8; |
| 255 | |
| 256 | /** |
| 257 | * @type {number} |
| 258 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult-FIRST-ORDERED-NODE-TYPE |
| 259 | */ |
| 260 | XPathResult.FIRST_ORDERED_NODE_TYPE = 9; |
| 261 | |
| 262 | /** |
| 263 | * @constructor |
| 264 | * @extends {Node} |
| 265 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNamespace |
| 266 | */ |
| 267 | function XPathNamespace() {} |
| 268 | |
| 269 | /** |
| 270 | * @type {Element} |
| 271 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNamespace-ownerElement |
| 272 | */ |
| 273 | XPathNamespace.prototype.ownerElement; |
| 274 | |
| 275 | /** |
| 276 | * @type {number} |
| 277 | * @see http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPATH_NAMESPACE_NODE |
| 278 | */ |
| 279 | XPathNamespace.XPATH_NAMESPACE_NODE = 13; |
| 280 | |
| 281 | /** |
| 282 | * From http://www.w3.org/TR/XMLHttpRequest/ |
| 283 | * |
| 284 | * (Draft) |
| 285 | * |
| 286 | * The XMLHttpRequest Object specification defines an API that provides |
| 287 | * scripted client functionality for transferring data between a client and a |
| 288 | * server. |
| 289 | * |
| 290 | * @constructor |
| 291 | * @implements {EventTarget} |
| 292 | * @see http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest-object |
| 293 | */ |
| 294 | function XMLHttpRequest() {} |
| 295 | |
| 296 | /** @override */ |
| 297 | XMLHttpRequest.prototype.addEventListener = |
| 298 | function(type, listener, useCapture) {}; |
| 299 | |
| 300 | /** @override */ |
| 301 | XMLHttpRequest.prototype.removeEventListener = |
| 302 | function(type, listener, useCapture) {}; |
| 303 | |
| 304 | /** @override */ |
| 305 | XMLHttpRequest.prototype.dispatchEvent = function(evt) {}; |
| 306 | |
| 307 | /** |
| 308 | * @param {string} method |
| 309 | * @param {string} url |
| 310 | * @param {?boolean=} opt_async |
| 311 | * @param {?string=} opt_user |
| 312 | * @param {?string=} opt_password |
| 313 | * @return {undefined} |
| 314 | * @see http://www.w3.org/TR/XMLHttpRequest/#open |
| 315 | */ |
| 316 | XMLHttpRequest.prototype.open = function(method, url, opt_async, opt_user, |
| 317 | opt_password) {}; |
| 318 | |
| 319 | /** |
| 320 | * @param {string} header |
| 321 | * @param {string} value |
| 322 | * @return {undefined} |
| 323 | * @see http://www.w3.org/TR/XMLHttpRequest/#setrequestheader |
| 324 | */ |
| 325 | XMLHttpRequest.prototype.setRequestHeader = function(header, value) {}; |
| 326 | |
| 327 | /** |
| 328 | * @param {ArrayBuffer|Blob|Document|FormData|string=} opt_data |
| 329 | * @return {undefined} |
| 330 | * @see http://www.w3.org/TR/XMLHttpRequest/#send |
| 331 | * @see http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-send-method |
| 332 | */ |
| 333 | XMLHttpRequest.prototype.send = function(opt_data) {}; |
| 334 | |
| 335 | /** |
| 336 | * @return {undefined} |
| 337 | * @see http://www.w3.org/TR/XMLHttpRequest/#abort |
| 338 | */ |
| 339 | XMLHttpRequest.prototype.abort = function() {}; |
| 340 | |
| 341 | /** |
| 342 | * @return {string} |
| 343 | * @see http://www.w3.org/TR/XMLHttpRequest/#getallresponseheaders |
| 344 | */ |
| 345 | XMLHttpRequest.prototype.getAllResponseHeaders = function() {}; |
| 346 | |
| 347 | /** |
| 348 | * @param {string} header |
| 349 | * @return {string} |
| 350 | * @see http://www.w3.org/TR/XMLHttpRequest/#getresponseheader |
| 351 | */ |
| 352 | XMLHttpRequest.prototype.getResponseHeader = function(header) {}; |
| 353 | |
| 354 | /** |
| 355 | * @type {string} |
| 356 | * @see http://www.w3.org/TR/XMLHttpRequest/#responsetext |
| 357 | */ |
| 358 | XMLHttpRequest.prototype.responseText; |
| 359 | |
| 360 | /** |
| 361 | * @type {Document} |
| 362 | * @see http://www.w3.org/TR/XMLHttpRequest/#responsexml |
| 363 | */ |
| 364 | XMLHttpRequest.prototype.responseXML; |
| 365 | |
| 366 | /** |
| 367 | * @type {number} |
| 368 | * @see http://www.w3.org/TR/XMLHttpRequest/#readystate |
| 369 | */ |
| 370 | XMLHttpRequest.prototype.readyState; |
| 371 | |
| 372 | /** |
| 373 | * @type {number} |
| 374 | * @see http://www.w3.org/TR/XMLHttpRequest/#status |
| 375 | */ |
| 376 | XMLHttpRequest.prototype.status; |
| 377 | |
| 378 | /** |
| 379 | * @type {string} |
| 380 | * @see http://www.w3.org/TR/XMLHttpRequest/#statustext |
| 381 | */ |
| 382 | XMLHttpRequest.prototype.statusText; |
| 383 | |
| 384 | /** |
| 385 | * @type {Function} |
| 386 | * @see http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange |
| 387 | */ |
| 388 | XMLHttpRequest.prototype.onreadystatechange; |
| 389 | |
| 390 | /** |
| 391 | * The FormData object represents an ordered collection of entries. Each entry |
| 392 | * has a name and value. |
| 393 | * |
| 394 | * @param {?Element=} opt_form An optional form to use for constructing the form |
| 395 | * data set. |
| 396 | * @constructor |
| 397 | * @see http://www.w3.org/TR/XMLHttpRequest2/#the-formdata-interface |
| 398 | */ |
| 399 | function FormData(opt_form) {} |
| 400 | |
| 401 | /** |
| 402 | * @param {string} name |
| 403 | * @param {Blob|string} value |
| 404 | */ |
| 405 | FormData.prototype.append = function(name, value) {}; |