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;
45 KeyboardEvent.DOM_KEY_LOCATION_NUMPAD;
48 * @param {string} eventName
49 * @param {!Function} listener
50 * @param {boolean=} capturing
52 function addEventListener(eventName, listener, capturing) {}
56 * @param {boolean=} onlyFirst
60 Array.prototype.remove = function(value, onlyFirst) {}
62 * @param {!Array.<!T>} array
66 Array.prototype.pushAll = function(array) {}
68 * @return {!Object.<string, boolean>}
72 Array.prototype.keySet = function() {}
74 * @param {number} index
75 * @return {!Array.<!T>}
79 Array.prototype.rotate = function(index) {}
81 * @this {Array.<number>}
83 Array.prototype.sortNumbers = function() {}
86 * @param {function(!T,!S):number=} comparator
91 Array.prototype.lowerBound = function(object, comparator) {}
94 * @param {function(!T,!S):number=} comparator
99 Array.prototype.upperBound = function(object, comparator) {}
102 * @param {function(!T,!S):number} comparator
107 Array.prototype.binaryIndexOf = function(value, comparator) {}
109 * @param {function(number, number): number} comparator
110 * @param {number} leftBound
111 * @param {number} rightBound
112 * @param {number} sortWindowLeft
113 * @param {number} sortWindowRight
114 * @return {!Array.<number>}
115 * @this {Array.<number>}
117 Array.prototype.sortRange = function(comparator, leftBound, rightBound, sortWindowLeft, sortWindowRight) {}
120 * @param {function(!T,!T): number=} comparator
121 * @return {!Array.<T>}
125 Array.prototype.stableSort = function(comparator) {}
128 * @this {Array.<number>}
129 * @param {function(number,number):boolean} comparator
130 * @param {number} left
131 * @param {number} right
132 * @param {number} pivotIndex
135 Array.prototype.partition = function(comparator, left, right, pivotIndex) {}
138 * @this {Array.<number>}
140 * @param {function(number,number):boolean=} comparator
143 Array.prototype.qselect = function(k, comparator) {}
146 * @param {string} field
147 * @return {!Array.<!T>}
148 * @this {Array.<!Object.<string,T>>}
151 Array.prototype.select = function(field) {}
154 * @return {!T|undefined}
158 Array.prototype.peekLast = function() {}
161 * @param {!Array.<T>} array
162 * @param {function(T,T):number} comparator
163 * @return {!Array.<T>}
167 Array.prototype.intersectOrdered = function(array, comparator) {}
170 * @param {!Array.<T>} array
171 * @param {function(T,T):number} comparator
172 * @return {!Array.<T>}
176 Array.prototype.mergeOrdered = function(array, comparator) {}
182 function DOMFileSystem() {}
185 * @type {DirectoryEntry}
187 DOMFileSystem.prototype.root = null;
189 // FIXME: remove everything below.
190 var FormatterWorker = {}
191 var WebInspector = {}
193 WebInspector.panels = {};
195 WebInspector.reload = function() { }
197 /** Extensions API */
200 function AuditCategory() {}
202 function AuditResult() {}
204 function EventSink() {}
206 function ExtensionSidebarPane() {}
210 function PanelWithSidebar() {}
212 function Request() {}
214 function Resource() {}
216 function Timeline() {}
223 function ExtensionDescriptor() {
231 function ExtensionReloadOptions() {
232 this.ignoreCache = false;
233 this.injectedScript = "";
234 this.preprocessingScript = "";
240 difflib.stringAsLines = function(text) { return []; }
242 difflib.SequenceMatcher = function(baseText, newText) { }
243 difflib.SequenceMatcher.prototype.get_opcodes = function() { return []; }
246 var Doc = function() { }
248 /** @type {number} */
250 /** @type {number} */
255 var CodeMirror = function(element, config) { }
256 CodeMirror.on = function(obj, type, handler) { }
257 CodeMirror.prototype = {
260 addKeyMap: function(map) { },
261 addLineClass: function(handle, where, cls) { },
262 /** @param {?Object=} options */
263 addLineWidget: function(handle, node, options) { },
265 * @param {string|!Object} spec
266 * @param {!Object=} options
268 addOverlay: function(spec, options) { },
269 addWidget: function(pos, node, scroll, vert, horiz) { },
270 charCoords: function(pos, mode) { },
271 clearGutter: function(gutterID) { },
272 clearHistory: function() { },
273 clipPos: function(pos) { },
274 /** @param {string=} mode */
275 coordsChar: function(coords, mode) { },
276 /** @param {string=} mode */
277 cursorCoords: function(start, mode) { },
278 defaultCharWidth: function() { },
279 defaultTextHeight: function() { },
280 deleteH: function(dir, unit) { },
285 eachLine: function(from, to, op) { },
286 execCommand: function(cmd) { },
287 extendSelection: function(from, to) { },
288 findMarksAt: function(pos) { },
290 * @param {!CodeMirror.Pos} from
291 * @param {boolean=} strict
292 * @param {Object=} config
294 findMatchingBracket: function(from, strict, config) { },
295 findPosH: function(from, amount, unit, visually) { },
296 findPosV: function(from, amount, unit, goalColumn) { },
297 firstLine: function() { },
298 focus: function() { },
299 getAllMarks: function() { },
300 /** @param {string=} start */
301 getCursor: function(start) { },
302 getDoc: function() { },
303 getGutterElement: function() { },
304 getHistory: function() { },
305 getInputField: function(){ },
306 getLine: function(line) { },
308 * @return {!{wrapClass: string}}
310 getLineHandle: function(line) { },
311 getLineNumber: function(line) { },
312 getMode: function() { },
313 getOption: function(option) { },
314 /** @param {*=} lineSep */
315 getRange: function(from, to, lineSep) { },
317 * @return {!{left: number, top: number, width: number, height: number, clientWidth: number, clientHeight: number}}
319 getScrollInfo: function() { },
320 getScrollerElement: function() { },
321 getSelection: function() { },
322 getSelections: function() { },
323 getStateAfter: function(line) { },
324 getTokenAt: function(pos) { },
325 /** @param {*=} lineSep */
326 getValue: function(lineSep) { },
327 getViewport: function() { },
328 getWrapperElement: function() { },
329 hasFocus: function() { },
330 historySize: function() { },
331 indentLine: function(n, dir, aggressive) { },
332 indentSelection: function(how) { },
333 indexFromPos: function(coords) { },
334 isClean: function() { },
335 iterLinkedDocs: function(f) { },
336 lastLine: function() { },
337 lineCount: function() { },
338 lineInfo: function(line) { },
340 * @param {number} height
341 * @param {string=} mode
343 lineAtHeight: function(height, mode) { },
344 linkedDoc: function(options) { },
345 listSelections: function() { },
346 markClean: function() { },
347 markText: function(from, to, options) { },
348 moveH: function(dir, unit) { },
349 moveV: function(dir, unit) { },
350 off: function(type, f) { },
351 on: function(type, f) { },
352 operation: function(f) { },
353 posFromIndex: function(off) { },
354 redo: function() { },
355 refresh: function() { },
356 removeKeyMap: function(map) { },
357 removeLine: function(line) { },
358 removeLineClass: function(handle, where, cls) { },
359 removeLineWidget: function(widget) { },
360 removeOverlay: function(spec) { },
361 /** @param {*=} origin */
362 replaceRange: function(code, from, to, origin) { },
364 * @param {string} replacement
365 * @param {string=} select
367 replaceSelection: function(replacement, select) { },
369 * @param {!Array.<string>} textPerSelection
371 replaceSelections: function(textPerSelection) { },
372 /** @param {*=} margin */
373 scrollIntoView: function(pos, margin) { },
374 scrollTo: function(x, y) { },
375 setBookmark: function(pos, options) { },
376 setCursor: function(line, ch, extend) { },
377 setExtending: function(val) { },
378 setGutterMarker: function(line, gutterID, value) { },
379 setHistory: function(histData) { },
380 setLine: function(line, text) { },
381 setOption: function(option, value) { },
382 setSelection: function(anchor, head) { },
384 * @param {number=} primaryIndex
385 * @param {?Object=} config
387 setSelections: function(selections, primaryIndex, config) { },
388 setSize: function(width, height) { },
389 setValue: function(code) { },
390 somethingSelected: function() { },
391 swapDoc: function(doc) { },
392 undo: function() { },
393 unlinkDoc: function(other) { }
395 /** @type {!{cursorDiv: Element}} */
396 CodeMirror.prototype.display;
397 /** @type {!Object} */
399 CodeMirror.showHint = function(codeMirror, hintintFunction) { };
400 CodeMirror.commands = {};
401 CodeMirror.modes = {};
402 CodeMirror.mimeModes = {};
403 CodeMirror.getMode = function(options, spec) { };
404 CodeMirror.overlayMode = function(mode1, mode2, squashSpans) { };
405 CodeMirror.defineMode = function(modeName, modeConstructor) { };
406 CodeMirror.startState = function(mode) { };
409 CodeMirror.Pos = function(line, ch) { }
410 /** @type {number} */
411 CodeMirror.Pos.prototype.line;
412 /** @type {number} */
413 CodeMirror.Pos.prototype.ch;
416 * @param {!CodeMirror.Pos} pos1
417 * @param {!CodeMirror.Pos} pos2
420 CodeMirror.cmpPos = function(pos1, pos2) { };
423 CodeMirror.StringStream = function(line)
428 CodeMirror.StringStream.prototype = {
429 backUp: function (n) { },
430 column: function () { },
431 current: function () { },
432 eat: function (match) { },
433 eatSpace: function () { },
434 eatWhile: function (match) { },
435 eol: function () { },
436 indentation: function () { },
438 * @param {!RegExp|string} pattern
439 * @param {boolean=} consume
440 * @param {boolean=} caseInsensitive
442 match: function (pattern, consume, caseInsensitive) { },
443 next: function () { },
444 peek: function () { },
445 skipTo: function (ch) { },
446 skipToEnd: function () { },
450 /** @type {Object.<string, !Object.<string, string>>} */
453 /** @type {{scrollLeft: number, scrollTop: number}} */
460 function ErrorEvent() {}
462 /** @type {string} */
463 ErrorEvent.prototype.message;
465 /** @type {boolean} */
466 window.dispatchStandaloneTestRunnerMessages;
469 * @param {function()} onCatch
471 Promise.prototype.catch = function(onCatch) {};
473 // FIXME: Remove once ES6 is supported natively by JS compiler.
475 /** @typedef {string} */
479 * @param {string} description
482 function Symbol(description) {}