2 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 // WebKit Web Facing API
34 * @param {!Object} object
35 * @param {!Function} callback
37 Object
.observe = function(object
, callback
) {}
39 /** @type {boolean} */
40 Event
.prototype.isMetaOrCtrlForTest
;
48 KeyboardEvent
.DOM_KEY_LOCATION_NUMPAD
;
52 * @param {boolean=} onlyFirst
56 Array
.prototype.remove = function(value
, onlyFirst
) {}
58 * @param {!Array.<!T>} array
62 Array
.prototype.pushAll = function(array
) {}
64 * @return {!Object.<string, boolean>}
68 Array
.prototype.keySet = function() {}
70 * @param {number} index
71 * @return {!Array.<!T>}
75 Array
.prototype.rotate = function(index
) {}
77 * @this {Array.<number>}
79 Array
.prototype.sortNumbers = function() {}
82 * @param {function(!T,!S):number=} comparator
87 Array
.prototype.lowerBound = function(object
, comparator
) {}
90 * @param {function(!T,!S):number=} comparator
95 Array
.prototype.upperBound = function(object
, comparator
) {}
98 * @param {function(!T,!S):number} comparator
103 Array
.prototype.binaryIndexOf = function(value
, comparator
) {}
105 * @param {function(number, number): number} comparator
106 * @param {number} leftBound
107 * @param {number} rightBound
108 * @param {number} sortWindowLeft
109 * @param {number} sortWindowRight
110 * @return {!Array.<number>}
111 * @this {Array.<number>}
113 Array
.prototype.sortRange = function(comparator
, leftBound
, rightBound
, sortWindowLeft
, sortWindowRight
) {}
116 * @param {function(!T,!T): number=} comparator
117 * @return {!Array.<T>}
121 Array
.prototype.stableSort = function(comparator
) {}
124 * @this {Array.<number>}
125 * @param {function(number,number):boolean} comparator
126 * @param {number} left
127 * @param {number} right
128 * @param {number} pivotIndex
131 Array
.prototype.partition = function(comparator
, left
, right
, pivotIndex
) {}
134 * @this {Array.<number>}
136 * @param {function(number,number):boolean=} comparator
139 Array
.prototype.qselect = function(k
, comparator
) {}
142 * @param {string} field
143 * @return {!Array.<!T>}
144 * @this {Array.<!Object.<string,T>>}
147 Array
.prototype.select = function(field
) {}
150 * @return {!T|undefined}
154 Array
.prototype.peekLast = function() {}
157 * @param {!Array.<T>} array
158 * @param {function(T,T):number} comparator
159 * @return {!Array.<T>}
163 Array
.prototype.intersectOrdered = function(array
, comparator
) {}
166 * @param {!Array.<T>} array
167 * @param {function(T,T):number} comparator
168 * @return {!Array.<T>}
172 Array
.prototype.mergeOrdered = function(array
, comparator
) {}
178 function DOMFileSystem() {}
181 * @type {DirectoryEntry}
183 DOMFileSystem
.prototype.root
= null;
188 window
.domAutomationController
;
190 var DevToolsHost
= {};
192 /** @typedef {{type:string, id:(number|undefined),
193 label:(string|undefined), enabled:(boolean|undefined), checked:(boolean|undefined),
194 subItems:(!Array.<!DevToolsHost.ContextMenuDescriptor>|undefined)}} */
195 DevToolsHost
.ContextMenuDescriptor
;
200 DevToolsHost
.zoomFactor = function() { }
203 * @param {string} origin
204 * @param {string} script
206 DevToolsHost
.setInjectedScriptForOrigin = function(origin
, script
) { }
209 * @param {string} text
211 DevToolsHost
.copyText = function(text
) { }
216 DevToolsHost
.platform = function() { }
221 * @param {!Array.<!DevToolsHost.ContextMenuDescriptor>} items
222 * @param {!Document} document
224 DevToolsHost
.showContextMenuAtPoint = function(x
, y
, items
, document
) { }
227 * @param {string} message
229 DevToolsHost
.sendMessageToBackend = function(message
) { }
232 * @param {string} message
234 DevToolsHost
.sendMessageToEmbedder = function(message
) { }
239 DevToolsHost
.getSelectionBackgroundColor = function() { }
244 DevToolsHost
.getSelectionForegroundColor = function() { }
249 DevToolsHost
.isUnderTest = function() { }
254 DevToolsHost
.isHostedMode = function() { }
256 // FIXME: remove everything below.
257 var FormatterWorker
= {}
258 var WebInspector
= {}
260 WebInspector
.panels
= {};
262 WebInspector
.reload = function() { }
264 /** Extensions API */
267 function AuditCategory() {}
269 function AuditResult() {}
271 function EventSink() {}
273 function ExtensionSidebarPane() {}
277 function PanelWithSidebar() {}
279 function Resource() {}
281 function Timeline() {}
288 function ExtensionDescriptor() {
296 function ExtensionReloadOptions() {
297 this.ignoreCache
= false;
298 this.injectedScript
= "";
303 /** @typedef {{id: string, name: string, url: string, adbAttachedForeign: boolean}} */
305 /** @typedef {{id: string, adbBrowserChromeVersion: string, compatibleVersion: boolean, adbBrowserName: string, source: string, adbBrowserVersion: string, pages: !Array<!Adb.Page>}} */
307 /** @typedef {{id: string, adbModel: string, adbSerial: string, browsers: !Array.<!Adb.Browser>, adbPortStatus: !Array.<number>, adbConnected: boolean}} */
309 /** @typedef {!Object.<string, string>} */
310 Adb
.PortForwardingConfig
;
315 function diff_match_patch()
319 diff_match_patch
.prototype = {
321 * @param {string} text1
322 * @param {string} text2
323 * @return {!Array.<!{0: number, 1: string}>}
325 diff_main: function(text1
, text2
) { }
337 rect: function(x
, y
, w
, h
) { },
342 moveTo: function(x
, y
) { },
347 lineTo: function(x
, y
) { }
351 var Doc = function() { }
353 /** @type {number} */
355 /** @type {number} */
360 var CodeMirror = function(element
, config
) { }
361 CodeMirror
.on = function(obj
, type
, handler
) { }
362 CodeMirror
.prototype = {
365 addKeyMap: function(map
) { },
366 addLineClass: function(handle
, where
, cls
) { },
367 /** @param {?Object=} options */
368 addLineWidget: function(handle
, node
, options
) { },
370 * @param {string|!Object} spec
371 * @param {!Object=} options
373 addOverlay: function(spec
, options
) { },
374 addWidget: function(pos
, node
, scroll
, vert
, horiz
) { },
375 charCoords: function(pos
, mode
) { },
376 clearGutter: function(gutterID
) { },
377 clearHistory: function() { },
378 clipPos: function(pos
) { },
379 /** @param {string=} mode */
380 coordsChar: function(coords
, mode
) { },
381 /** @param {string=} mode */
382 cursorCoords: function(start
, mode
) { },
383 defaultCharWidth: function() { },
384 defaultTextHeight: function() { },
385 deleteH: function(dir
, unit
) { },
390 eachLine: function(from, to
, op
) { },
391 execCommand: function(cmd
) { },
392 extendSelection: function(from, to
) { },
393 findMarksAt: function(pos
) { },
395 * @param {!CodeMirror.Pos} from
396 * @param {boolean=} strict
397 * @param {Object=} config
399 findMatchingBracket: function(from, strict
, config
) { },
400 findPosH: function(from, amount
, unit
, visually
) { },
401 findPosV: function(from, amount
, unit
, goalColumn
) { },
402 firstLine: function() { },
403 focus: function() { },
404 getAllMarks: function() { },
405 /** @param {string=} start */
406 getCursor: function(start
) { },
407 getDoc: function() { },
408 getGutterElement: function() { },
409 getHistory: function() { },
410 getInputField: function(){ },
411 getLine: function(line
) { },
413 * @return {!{wrapClass: string, height: number}}
415 getLineHandle: function(line
) { },
416 getLineNumber: function(line
) { },
418 * @return {!{token: function(CodeMirror.StringStream, Object):string}}
420 getMode: function() { },
421 getOption: function(option
) { },
422 /** @param {*=} lineSep */
423 getRange: function(from, to
, lineSep
) { },
425 * @return {!{left: number, top: number, width: number, height: number, clientWidth: number, clientHeight: number}}
427 getScrollInfo: function() { },
428 getScrollerElement: function() { },
429 getSelection: function() { },
430 getSelections: function() { },
431 getStateAfter: function(line
) { },
432 getTokenAt: function(pos
) { },
433 /** @param {*=} lineSep */
434 getValue: function(lineSep
) { },
435 getViewport: function() { },
436 getWrapperElement: function() { },
437 hasFocus: function() { },
438 historySize: function() { },
439 indentLine: function(n
, dir
, aggressive
) { },
440 indentSelection: function(how
) { },
441 indexFromPos: function(coords
) { },
442 isClean: function() { },
443 iterLinkedDocs: function(f
) { },
444 lastLine: function() { },
445 lineCount: function() { },
446 lineInfo: function(line
) { },
448 * @param {number} height
449 * @param {string=} mode
451 lineAtHeight: function(height
, mode
) { },
452 linkedDoc: function(options
) { },
453 listSelections: function() { },
454 markClean: function() { },
455 markText: function(from, to
, options
) { },
456 moveH: function(dir
, unit
) { },
457 moveV: function(dir
, unit
) { },
458 off: function(type
, f
) { },
459 on: function(type
, f
) { },
460 operation: function(f
) { },
461 posFromIndex: function(off
) { },
462 redo: function() { },
463 refresh: function() { },
464 removeKeyMap: function(map
) { },
465 removeLine: function(line
) { },
466 removeLineClass: function(handle
, where
, cls
) { },
467 removeLineWidget: function(widget
) { },
468 removeOverlay: function(spec
) { },
469 /** @param {*=} origin */
470 replaceRange: function(code
, from, to
, origin
) { },
472 * @param {string} replacement
473 * @param {string=} select
475 replaceSelection: function(replacement
, select
) { },
477 * @param {!Array.<string>} textPerSelection
479 replaceSelections: function(textPerSelection
) { },
480 /** @param {*=} margin */
481 scrollIntoView: function(pos
, margin
) { },
482 scrollTo: function(x
, y
) { },
483 setBookmark: function(pos
, options
) { },
484 setCursor: function(line
, ch
, extend
) { },
485 setExtending: function(val
) { },
486 setGutterMarker: function(line
, gutterID
, value
) { },
487 setHistory: function(histData
) { },
488 setLine: function(line
, text
) { },
489 setOption: function(option
, value
) { },
490 setSelection: function(anchor
, head
) { },
492 * @param {number=} primaryIndex
493 * @param {?Object=} config
495 setSelections: function(selections
, primaryIndex
, config
) { },
496 setSize: function(width
, height
) { },
497 setValue: function(code
) { },
498 somethingSelected: function() { },
499 swapDoc: function(doc
) { },
500 undo: function() { },
501 unlinkDoc: function(other
) { }
503 /** @type {!{cursorDiv: Element}} */
504 CodeMirror
.prototype.display
;
505 /** @type {!Object} */
507 CodeMirror
.showHint = function(codeMirror
, hintintFunction
) { };
508 CodeMirror
.commands
= {};
509 CodeMirror
.modes
= {};
510 CodeMirror
.mimeModes
= {};
511 CodeMirror
.getMode = function(options
, spec
) { };
512 CodeMirror
.overlayMode = function(mode1
, mode2
, squashSpans
) { };
513 CodeMirror
.defineMode = function(modeName
, modeConstructor
) { };
514 CodeMirror
.startState = function(mode
) { };
516 /** @typedef {{canceled: boolean, from: !CodeMirror.Pos, to: !CodeMirror.Pos, text: string, origin: string, cancel: function()}} */
517 CodeMirror
.BeforeChangeObject
;
519 /** @typedef {{from: !CodeMirror.Pos, to: !CodeMirror.Pos, origin: string, text: !Array.<string>, removed: !Array.<string>}} */
520 CodeMirror
.ChangeObject
;
523 CodeMirror
.Pos = function(line
, ch
) { }
524 /** @type {number} */
525 CodeMirror
.Pos
.prototype.line
;
526 /** @type {number} */
527 CodeMirror
.Pos
.prototype.ch
;
530 * @param {!CodeMirror.Pos} pos1
531 * @param {!CodeMirror.Pos} pos2
534 CodeMirror
.cmpPos = function(pos1
, pos2
) { };
537 CodeMirror
.StringStream = function(line
)
542 CodeMirror
.StringStream
.prototype = {
543 backUp: function(n
) { },
544 column: function() { },
545 current: function() { },
546 eat: function(match
) { },
547 eatSpace: function() { },
548 eatWhile: function(match
) { },
550 indentation: function() { },
552 * @param {!RegExp|string} pattern
553 * @param {boolean=} consume
554 * @param {boolean=} caseInsensitive
556 match: function(pattern
, consume
, caseInsensitive
) { },
557 next: function() { },
558 peek: function() { },
559 skipTo: function(ch
) { },
560 skipToEnd: function() { },
564 /** @type {Object.<string, !Object.<string, string>>} */
567 /** @type {{scrollLeft: number, scrollTop: number}} */
570 /** @type {boolean} */
571 window
.dispatchStandaloneTestRunnerMessages
;
577 ArrayBuffer
.isView = function(obj
) { }
580 * @param {Array.<Object>} keyframes
581 * @param {number|Object} timing
584 Element
.prototype.animate = function(keyframes
, timing
) { }
588 * @param {string} text
589 * @param {Object.<string, boolean>} options
590 * @return {!ESTree.Node}
592 parse: function(text
, options
) {},
595 * @param {string} text
596 * @param {Object.<string, boolean>} options
597 * @return {!Acorn.Tokenizer}
599 tokenizer: function(text
, options
) {},
602 _true
: new Acorn
.TokenType(),
603 _false
: new Acorn
.TokenType(),
604 num
: new Acorn
.TokenType(),
605 regexp
: new Acorn
.TokenType(),
606 string
: new Acorn
.TokenType(),
607 name
: new Acorn
.TokenType(),
608 eof
: new Acorn
.TokenType()
616 Acorn
.Tokenizer = function() {
617 /** @type {function():!Acorn.Token} */
624 Acorn
.TokenType = function() {
625 /** @type {string} */
627 /** @type {(string|undefined)} */
632 * @typedef {{type: !Acorn.TokenType, value: string, start: number, end: number}}
637 * @typedef {{type: string, value: string, start: number, end: number}}
642 * @typedef {(!Acorn.Token|!Acorn.Comment)}
644 Acorn
.TokenOrComment
;
651 ESTree
.Node = function()
653 /** @type {number} */
655 /** @type {number} */
657 /** @type {string} */
659 /** @type {(!ESTree.Node|undefined)} */
661 /** @type {(!Array.<!ESTree.Node>|undefined)} */
663 /** @type {(!Array.<!ESTree.Node>|undefined)} */
665 /** @type {(!ESTree.Node|undefined)} */
670 * @extends {ESTree.Node}
673 ESTree
.TemplateLiteralNode = function()
675 /** @type {!Array.<!ESTree.Node>} */
677 /** @type {!Array.<!ESTree.Node>} */