Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/externs.js

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: all done Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 * @return {!Array.<T>} 179 * @return {!Array.<T>}
180 * @this {!Array.<T>} 180 * @this {!Array.<T>}
181 * @template T 181 * @template T
182 */ 182 */
183 Array.prototype.mergeOrdered = function(array, comparator) {}; 183 Array.prototype.mergeOrdered = function(array, comparator) {};
184 184
185 // File System API 185 // File System API
186 /** 186 /**
187 * @constructor 187 * @constructor
188 */ 188 */
189 function DOMFileSystem() {} 189 function DOMFileSystem() {
190 }
190 191
191 /** 192 /**
192 * @type {DirectoryEntry} 193 * @type {DirectoryEntry}
193 */ 194 */
194 DOMFileSystem.prototype.root = null; 195 DOMFileSystem.prototype.root = null;
195 196
196 /** 197 /**
197 * @type {*} 198 * @type {*}
198 */ 199 */
199 window.domAutomationController; 200 window.domAutomationController;
200 201
201 var DevToolsHost = function() {}; 202 var DevToolsHost = function() {};
202 203
203 /** @typedef {{type:string, id:(number|undefined), 204 /** @typedef {{type:string, id:(number|undefined),
204 label:(string|undefined), enabled:(boolean|undefined), checked:(bo olean|undefined), 205 label:(string|undefined), enabled:(boolean|undefined), checked:(bo olean|undefined),
205 subItems:(!Array.<!DevToolsHost.ContextMenuDescriptor>|undefined)} } */ 206 subItems:(!Array.<!DevToolsHost.ContextMenuDescriptor>|undefined)} } */
206 DevToolsHost.ContextMenuDescriptor; 207 DevToolsHost.ContextMenuDescriptor;
207 208
208 /** 209 /**
209 * @return {number} 210 * @return {number}
210 */ 211 */
211 DevToolsHost.zoomFactor = function() { }; 212 DevToolsHost.zoomFactor = function() {};
212 213
213 /** 214 /**
214 * @param {string} origin 215 * @param {string} origin
215 * @param {string} script 216 * @param {string} script
216 */ 217 */
217 DevToolsHost.setInjectedScriptForOrigin = function(origin, script) { }; 218 DevToolsHost.setInjectedScriptForOrigin = function(origin, script) {};
218 219
219 /** 220 /**
220 * @param {string} text 221 * @param {string} text
221 */ 222 */
222 DevToolsHost.copyText = function(text) { }; 223 DevToolsHost.copyText = function(text) {};
223 224
224 /** 225 /**
225 * @return {string} 226 * @return {string}
226 */ 227 */
227 DevToolsHost.platform = function() { }; 228 DevToolsHost.platform = function() {};
228 229
229 /** 230 /**
230 * @param {number} x 231 * @param {number} x
231 * @param {number} y 232 * @param {number} y
232 * @param {!Array.<!DevToolsHost.ContextMenuDescriptor>} items 233 * @param {!Array.<!DevToolsHost.ContextMenuDescriptor>} items
233 * @param {!Document} document 234 * @param {!Document} document
234 */ 235 */
235 DevToolsHost.showContextMenuAtPoint = function(x, y, items, document) { }; 236 DevToolsHost.showContextMenuAtPoint = function(x, y, items, document) {};
236 237
237 /** 238 /**
238 * @param {string} message 239 * @param {string} message
239 */ 240 */
240 DevToolsHost.sendMessageToEmbedder = function(message) { }; 241 DevToolsHost.sendMessageToEmbedder = function(message) {};
241 242
242 /** 243 /**
243 * @return {string} 244 * @return {string}
244 */ 245 */
245 DevToolsHost.getSelectionBackgroundColor = function() { }; 246 DevToolsHost.getSelectionBackgroundColor = function() {};
246 247
247 /** 248 /**
248 * @return {string} 249 * @return {string}
249 */ 250 */
250 DevToolsHost.getSelectionForegroundColor = function() { }; 251 DevToolsHost.getSelectionForegroundColor = function() {};
251 252
252 /** 253 /**
253 * @return {boolean} 254 * @return {boolean}
254 */ 255 */
255 DevToolsHost.isUnderTest = function() { }; 256 DevToolsHost.isUnderTest = function() {};
256 257
257 /** 258 /**
258 * @return {boolean} 259 * @return {boolean}
259 */ 260 */
260 DevToolsHost.isHostedMode = function() { }; 261 DevToolsHost.isHostedMode = function() {};
261 262
262 /** 263 /**
263 * @param {string} fileSystemId 264 * @param {string} fileSystemId
264 * @param {string} registeredName 265 * @param {string} registeredName
265 * @return {?DOMFileSystem} 266 * @return {?DOMFileSystem}
266 */ 267 */
267 DevToolsHost.isolatedFileSystem = function(fileSystemId, registeredName) { }; 268 DevToolsHost.isolatedFileSystem = function(fileSystemId, registeredName) {};
268 269
269 /** 270 /**
270 * @param {!FileSystem} fileSystem 271 * @param {!FileSystem} fileSystem
271 */ 272 */
272 DevToolsHost.upgradeDraggedFileSystemPermissions = function(fileSystem) { }; 273 DevToolsHost.upgradeDraggedFileSystemPermissions = function(fileSystem) {};
273 274
274 var WebInspector = function() {}; 275 var WebInspector = function() {};
275 276
276 /** Extensions API */ 277 /** Extensions API */
277 278
278 /** @constructor */ 279 /** @constructor */
279 function AuditCategory() {} 280 function AuditCategory() {
281 }
280 /** @constructor */ 282 /** @constructor */
281 function AuditResult() {} 283 function AuditResult() {
284 }
282 /** @constructor */ 285 /** @constructor */
283 function EventSink() {} 286 function EventSink() {
287 }
284 /** @constructor */ 288 /** @constructor */
285 function ExtensionSidebarPane() {} 289 function ExtensionSidebarPane() {
290 }
286 /** @constructor */ 291 /** @constructor */
287 function Panel() {} 292 function Panel() {
293 }
288 /** @constructor */ 294 /** @constructor */
289 function PanelWithSidebar() {} 295 function PanelWithSidebar() {
296 }
290 /** @constructor */ 297 /** @constructor */
291 function Resource() {} 298 function Resource() {
299 }
292 300
293 var extensionServer; 301 var extensionServer;
294 302
295 /** 303 /**
296 * @constructor 304 * @constructor
297 */ 305 */
298 function ExtensionDescriptor() { 306 function ExtensionDescriptor() {
299 this.startPage = ""; 307 this.startPage = '';
300 this.name = ""; 308 this.name = '';
301 this.exposeExperimentalAPIs = false; 309 this.exposeExperimentalAPIs = false;
302 } 310 }
303 311
304 /** 312 /**
305 * @constructor 313 * @constructor
306 */ 314 */
307 function ExtensionReloadOptions() { 315 function ExtensionReloadOptions() {
308 this.ignoreCache = false; 316 this.ignoreCache = false;
309 this.injectedScript = ""; 317 this.injectedScript = '';
310 this.userAgent = ""; 318 this.userAgent = '';
311 } 319 }
312 320
313 var Adb = {}; 321 var Adb = {};
314 /** @typedef {{id: string, name: string, url: string, attached: boolean}} */ 322 /** @typedef {{id: string, name: string, url: string, attached: boolean}} */
315 Adb.Page; 323 Adb.Page;
316 /** @typedef {{id: string, adbBrowserChromeVersion: string, compatibleVersion: b oolean, adbBrowserName: string, source: string, adbBrowserVersion: string, pages : !Array<!Adb.Page>}} */ 324 /** @typedef {{id: string, adbBrowserChromeVersion: string, compatibleVersion: b oolean, adbBrowserName: string, source: string, adbBrowserVersion: string, pages : !Array<!Adb.Page>}} */
317 Adb.Browser; 325 Adb.Browser;
318 /** @typedef {{id: string, adbModel: string, adbSerial: string, browsers: !Array .<!Adb.Browser>, adbPortStatus: !Array.<number>, adbConnected: boolean}} */ 326 /** @typedef {{id: string, adbModel: string, adbSerial: string, browsers: !Array .<!Adb.Browser>, adbPortStatus: !Array.<number>, adbConnected: boolean}} */
319 Adb.Device; 327 Adb.Device;
320 /** @typedef {!Object.<string, string>} */ 328 /** @typedef {!Object.<string, string>} */
321 Adb.PortForwardingConfig; 329 Adb.PortForwardingConfig;
322 /** @typedef {!{port: string, address: string}} */ 330 /** @typedef {!{port: string, address: string}} */
323 Adb.PortForwardingRule; 331 Adb.PortForwardingRule;
324 /** @typedef {{ports: !Object<string, number>, browserId: string}} */ 332 /** @typedef {{ports: !Object<string, number>, browserId: string}} */
325 Adb.DevicePortForwardingStatus; 333 Adb.DevicePortForwardingStatus;
326 /** @typedef {!Object<string, !Adb.DevicePortForwardingStatus>} */ 334 /** @typedef {!Object<string, !Adb.DevicePortForwardingStatus>} */
327 Adb.PortForwardingStatus; 335 Adb.PortForwardingStatus;
328 336
329 /** 337 /**
330 * @constructor 338 * @constructor
331 */ 339 */
332 function diff_match_patch() 340 function diff_match_patch() {
333 {
334 } 341 }
335 342
336 diff_match_patch.prototype = { 343 diff_match_patch.prototype = {
337 /** 344 /**
338 * @param {string} text1 345 * @param {string} text1
339 * @param {string} text2 346 * @param {string} text2
340 * @return {!Array.<!{0: number, 1: string}>} 347 * @return {!Array.<!{0: number, 1: string}>}
341 */ 348 */
342 diff_main: function(text1, text2) { } 349 diff_main: function(text1, text2) {}
343 }; 350 };
344 351
345 /** @constructor */ 352 /** @constructor */
346 function Path2D() {} 353 function Path2D() {
354 }
347 Path2D.prototype = { 355 Path2D.prototype = {
348 /** 356 /**
349 * @param {number} x 357 * @param {number} x
350 * @param {number} y 358 * @param {number} y
351 * @param {number} w 359 * @param {number} w
352 * @param {number} h 360 * @param {number} h
353 */ 361 */
354 rect: function(x, y, w, h) { }, 362 rect: function(x, y, w, h) {},
355 /** 363 /**
356 * @param {number} x 364 * @param {number} x
357 * @param {number} y 365 * @param {number} y
358 */ 366 */
359 moveTo: function(x, y) { }, 367 moveTo: function(x, y) {},
360 /** 368 /**
361 * @param {number} x 369 * @param {number} x
362 * @param {number} y 370 * @param {number} y
363 */ 371 */
364 lineTo: function(x, y) { } 372 lineTo: function(x, y) {}
365 }; 373 };
366 374
367 /** @constructor */ 375 /** @constructor */
368 var Doc = function() { }; 376 var Doc = function() {};
369 Doc.prototype = { 377 Doc.prototype = {
370 /** @type {number} */ 378 /** @type {number} */
371 scrollLeft: 0, 379 scrollLeft: 0,
372 /** @type {number} */ 380 /** @type {number} */
373 scrollTop: 0 381 scrollTop: 0
374 }; 382 };
375 383
376 /** @constructor */ 384 /** @constructor */
377 var CodeMirror = function(element, config) { }; 385 var CodeMirror = function(element, config) {};
378 CodeMirror.on = function(obj, type, handler) { }; 386 CodeMirror.on = function(obj, type, handler) {};
379 CodeMirror.prototype = { 387 CodeMirror.prototype = {
380 /** @type {!Doc} */ 388 /** @type {!Doc} */
381 doc: null, 389 doc: null,
382 addKeyMap: function(map) { }, 390 addKeyMap: function(map) {},
383 addLineClass: function(handle, where, cls) { }, 391 addLineClass: function(handle, where, cls) {},
384 /** 392 /**
385 * @param {?Object=} options 393 * @param {?Object=} options
386 * @return {!CodeMirror.LineWidget} 394 * @return {!CodeMirror.LineWidget}
387 */ 395 */
388 addLineWidget: function(handle, node, options) { }, 396 addLineWidget: function(handle, node, options) {},
389 /** 397 /**
390 * @param {string|!Object} spec 398 * @param {string|!Object} spec
391 * @param {!Object=} options 399 * @param {!Object=} options
392 */ 400 */
393 addOverlay: function(spec, options) { }, 401 addOverlay: function(spec, options) {},
394 addWidget: function(pos, node, scroll, vert, horiz) { }, 402 addWidget: function(pos, node, scroll, vert, horiz) {},
395 charCoords: function(pos, mode) { }, 403 charCoords: function(pos, mode) {},
396 clearGutter: function(gutterID) { }, 404 clearGutter: function(gutterID) {},
397 clearHistory: function() { }, 405 clearHistory: function() {},
398 clipPos: function(pos) { }, 406 clipPos: function(pos) {},
399 /** @param {string=} mode */ 407 /** @param {string=} mode */
400 coordsChar: function(coords, mode) { }, 408 coordsChar: function(coords, mode) {},
401 /** @param {string=} mode */ 409 /** @param {string=} mode */
402 cursorCoords: function(start, mode) { }, 410 cursorCoords: function(start, mode) {},
403 defaultCharWidth: function() { }, 411 defaultCharWidth: function() {},
404 defaultTextHeight: function() { }, 412 defaultTextHeight: function() {},
405 deleteH: function(dir, unit) { }, 413 deleteH: function(dir, unit) {},
406 /** 414 /**
407 * @param {*=} to 415 * @param {*=} to
408 * @param {*=} op 416 * @param {*=} op
409 */ 417 */
410 eachLine: function(from, to, op) { }, 418 eachLine: function(from, to, op) {},
411 execCommand: function(cmd) { }, 419 execCommand: function(cmd) {},
412 extendSelection: function(from, to) { }, 420 extendSelection: function(from, to) {},
413 findMarks: function(from, to) { }, 421 findMarks: function(from, to) {},
414 findMarksAt: function(pos) { }, 422 findMarksAt: function(pos) {},
415 /** 423 /**
416 * @param {!CodeMirror.Pos} from 424 * @param {!CodeMirror.Pos} from
417 * @param {boolean=} strict 425 * @param {boolean=} strict
418 * @param {Object=} config 426 * @param {Object=} config
419 */ 427 */
420 findMatchingBracket: function(from, strict, config) { }, 428 findMatchingBracket: function(from, strict, config) {},
421 findPosH: function(from, amount, unit, visually) { }, 429 findPosH: function(from, amount, unit, visually) {},
422 findPosV: function(from, amount, unit, goalColumn) { }, 430 findPosV: function(from, amount, unit, goalColumn) {},
423 firstLine: function() { }, 431 firstLine: function() {},
424 focus: function() { }, 432 focus: function() {},
425 getAllMarks: function() { }, 433 getAllMarks: function() {},
426 /** @param {string=} start */ 434 /** @param {string=} start */
427 getCursor: function(start) { }, 435 getCursor: function(start) {},
428 getDoc: function() { }, 436 getDoc: function() {},
429 getGutterElement: function() { }, 437 getGutterElement: function() {},
430 getHistory: function() { }, 438 getHistory: function() {},
431 getInputField: function(){ }, 439 getInputField: function() {},
432 getLine: function(line) { }, 440 getLine: function(line) {},
433 /** 441 /**
434 * @return {!{wrapClass: string, height: number}} 442 * @return {!{wrapClass: string, height: number}}
435 */ 443 */
436 getLineHandle: function(line) { }, 444 getLineHandle: function(line) {},
437 getLineNumber: function(line) { }, 445 getLineNumber: function(line) {},
438 /** 446 /**
439 * @return {!{token: function(CodeMirror.StringStream, Object):string}} 447 * @return {!{token: function(CodeMirror.StringStream, Object):string}}
440 */ 448 */
441 getMode: function() { }, 449 getMode: function() {},
442 getOption: function(option) { }, 450 getOption: function(option) {},
443 /** @param {*=} lineSep */ 451 /** @param {*=} lineSep */
444 getRange: function(from, to, lineSep) { }, 452 getRange: function(from, to, lineSep) {},
445 /** 453 /**
446 * @return {!{left: number, top: number, width: number, height: number, clie ntWidth: number, clientHeight: number}} 454 * @return {!{left: number, top: number, width: number, height: number, client Width: number, clientHeight: number}}
447 */ 455 */
448 getScrollInfo: function() { }, 456 getScrollInfo: function() {},
449 getScrollerElement: function() { }, 457 getScrollerElement: function() {},
450 getSelection: function() { }, 458 getSelection: function() {},
451 getSelections: function() { }, 459 getSelections: function() {},
452 getStateAfter: function(line) { }, 460 getStateAfter: function(line) {},
453 getTokenAt: function(pos) { }, 461 getTokenAt: function(pos) {},
454 /** @param {*=} lineSep */ 462 /** @param {*=} lineSep */
455 getValue: function(lineSep) { }, 463 getValue: function(lineSep) {},
456 getViewport: function() { }, 464 getViewport: function() {},
457 getWrapperElement: function() { }, 465 getWrapperElement: function() {},
458 hasFocus: function() { }, 466 hasFocus: function() {},
459 historySize: function() { }, 467 historySize: function() {},
460 indentLine: function(n, dir, aggressive) { }, 468 indentLine: function(n, dir, aggressive) {},
461 indentSelection: function(how) { }, 469 indentSelection: function(how) {},
462 indexFromPos: function(coords) { }, 470 indexFromPos: function(coords) {},
463 isClean: function() { }, 471 isClean: function() {},
464 iterLinkedDocs: function(f) { }, 472 iterLinkedDocs: function(f) {},
465 lastLine: function() { }, 473 lastLine: function() {},
466 lineCount: function() { }, 474 lineCount: function() {},
467 lineInfo: function(line) { }, 475 lineInfo: function(line) {},
468 /** 476 /**
469 * @param {number} height 477 * @param {number} height
470 * @param {string=} mode 478 * @param {string=} mode
471 */ 479 */
472 lineAtHeight: function(height, mode) { }, 480 lineAtHeight: function(height, mode) {},
473 linkedDoc: function(options) { }, 481 linkedDoc: function(options) {},
474 listSelections: function() { }, 482 listSelections: function() {},
475 markClean: function() { }, 483 markClean: function() {},
476 markText: function(from, to, options) { }, 484 markText: function(from, to, options) {},
477 moveH: function(dir, unit) { }, 485 moveH: function(dir, unit) {},
478 moveV: function(dir, unit) { }, 486 moveV: function(dir, unit) {},
479 off: function(type, f) { }, 487 off: function(type, f) {},
480 on: function(type, f) { }, 488 on: function(type, f) {},
481 operation: function(f) { }, 489 operation: function(f) {},
482 posFromIndex: function(off) { }, 490 posFromIndex: function(off) {},
483 redo: function() { }, 491 redo: function() {},
484 refresh: function() { }, 492 refresh: function() {},
485 removeKeyMap: function(map) { }, 493 removeKeyMap: function(map) {},
486 removeLine: function(line) { }, 494 removeLine: function(line) {},
487 removeLineClass: function(handle, where, cls) { }, 495 removeLineClass: function(handle, where, cls) {},
488 removeLineWidget: function(widget) { }, 496 removeLineWidget: function(widget) {},
489 removeOverlay: function(spec) { }, 497 removeOverlay: function(spec) {},
490 /** @param {*=} origin */ 498 /** @param {*=} origin */
491 replaceRange: function(code, from, to, origin) { }, 499 replaceRange: function(code, from, to, origin) {},
492 /** 500 /**
493 * @param {string} replacement 501 * @param {string} replacement
494 * @param {string=} select 502 * @param {string=} select
495 */ 503 */
496 replaceSelection: function(replacement, select) { }, 504 replaceSelection: function(replacement, select) {},
497 /** 505 /**
498 * @param {!Array.<string>} textPerSelection 506 * @param {!Array.<string>} textPerSelection
499 */ 507 */
500 replaceSelections: function(textPerSelection) { }, 508 replaceSelections: function(textPerSelection) {},
501 /** @param {*=} margin */ 509 /** @param {*=} margin */
502 scrollIntoView: function(pos, margin) { }, 510 scrollIntoView: function(pos, margin) {},
503 scrollTo: function(x, y) { }, 511 scrollTo: function(x, y) {},
504 setBookmark: function(pos, options) { }, 512 setBookmark: function(pos, options) {},
505 setCursor: function(line, ch, extend) { }, 513 setCursor: function(line, ch, extend) {},
506 setExtending: function(val) { }, 514 setExtending: function(val) {},
507 setGutterMarker: function(line, gutterID, value) { }, 515 setGutterMarker: function(line, gutterID, value) {},
508 setHistory: function(histData) { }, 516 setHistory: function(histData) {},
509 setLine: function(line, text) { }, 517 setLine: function(line, text) {},
510 setOption: function(option, value) { }, 518 setOption: function(option, value) {},
511 setSelection: function(anchor, head) { }, 519 setSelection: function(anchor, head) {},
512 /** 520 /**
513 * @param {number=} primaryIndex 521 * @param {number=} primaryIndex
514 * @param {?Object=} config 522 * @param {?Object=} config
515 */ 523 */
516 setSelections: function(selections, primaryIndex, config) { }, 524 setSelections: function(selections, primaryIndex, config) {},
517 setSize: function(width, height) { }, 525 setSize: function(width, height) {},
518 setValue: function(code) { }, 526 setValue: function(code) {},
519 somethingSelected: function() { }, 527 somethingSelected: function() {},
520 swapDoc: function(doc) { }, 528 swapDoc: function(doc) {},
521 undo: function() { }, 529 undo: function() {},
522 unlinkDoc: function(other) { } 530 unlinkDoc: function(other) {}
523 }; 531 };
524 /** @type {!{cursorDiv: Element}} */ 532 /** @type {!{cursorDiv: Element}} */
525 CodeMirror.prototype.display; 533 CodeMirror.prototype.display;
526 /** @type {!Object} */ 534 /** @type {!Object} */
527 CodeMirror.Pass; 535 CodeMirror.Pass;
528 CodeMirror.showHint = function(codeMirror, hintintFunction) { }; 536 CodeMirror.showHint = function(codeMirror, hintintFunction) {};
529 CodeMirror.commands = {}; 537 CodeMirror.commands = {};
530 CodeMirror.modes = {}; 538 CodeMirror.modes = {};
531 CodeMirror.mimeModes = {}; 539 CodeMirror.mimeModes = {};
532 CodeMirror.getMode = function(options, spec) { }; 540 CodeMirror.getMode = function(options, spec) {};
533 CodeMirror.overlayMode = function(mode1, mode2, squashSpans) { }; 541 CodeMirror.overlayMode = function(mode1, mode2, squashSpans) {};
534 CodeMirror.defineMode = function(modeName, modeConstructor) { }; 542 CodeMirror.defineMode = function(modeName, modeConstructor) {};
535 CodeMirror.startState = function(mode) { }; 543 CodeMirror.startState = function(mode) {};
536 544
537 /** @typedef {{canceled: boolean, from: !CodeMirror.Pos, to: !CodeMirror.Pos, te xt: string, origin: string, cancel: function()}} */ 545 /** @typedef {{canceled: boolean, from: !CodeMirror.Pos, to: !CodeMirror.Pos, te xt: string, origin: string, cancel: function()}} */
538 CodeMirror.BeforeChangeObject; 546 CodeMirror.BeforeChangeObject;
539 547
540 /** @typedef {{from: !CodeMirror.Pos, to: !CodeMirror.Pos, origin: string, text: !Array.<string>, removed: !Array.<string>}} */ 548 /** @typedef {{from: !CodeMirror.Pos, to: !CodeMirror.Pos, origin: string, text: !Array.<string>, removed: !Array.<string>}} */
541 CodeMirror.ChangeObject; 549 CodeMirror.ChangeObject;
542 550
543 /** @constructor */ 551 /** @constructor */
544 CodeMirror.Pos = function(line, ch) { }; 552 CodeMirror.Pos = function(line, ch) {};
545 /** @type {number} */ 553 /** @type {number} */
546 CodeMirror.Pos.prototype.line; 554 CodeMirror.Pos.prototype.line;
547 /** @type {number} */ 555 /** @type {number} */
548 CodeMirror.Pos.prototype.ch; 556 CodeMirror.Pos.prototype.ch;
549 557
550 /** 558 /**
551 * @param {!CodeMirror.Pos} pos1 559 * @param {!CodeMirror.Pos} pos1
552 * @param {!CodeMirror.Pos} pos2 560 * @param {!CodeMirror.Pos} pos2
553 * @return {number} 561 * @return {number}
554 */ 562 */
555 CodeMirror.cmpPos = function(pos1, pos2) { }; 563 CodeMirror.cmpPos = function(pos1, pos2) {};
556 564
557 /** 565 /**
558 * @param {string} mode 566 * @param {string} mode
559 * @param {?} definition 567 * @param {?} definition
560 */ 568 */
561 CodeMirror.defineSimpleMode = function(mode, definition) {}; 569 CodeMirror.defineSimpleMode = function(mode, definition) {};
562 570
563 /** @constructor */ 571 /** @constructor */
564 CodeMirror.StringStream = function(line) 572 CodeMirror.StringStream = function(line) {
565 { 573 this.pos = 0;
566 this.pos = 0; 574 this.start = 0;
567 this.start = 0;
568 }; 575 };
569 CodeMirror.StringStream.prototype = { 576 CodeMirror.StringStream.prototype = {
570 backUp: function(n) { }, 577 backUp: function(n) {},
571 column: function() { }, 578 column: function() {},
572 current: function() { }, 579 current: function() {},
573 eat: function(match) { }, 580 eat: function(match) {},
574 eatSpace: function() { }, 581 eatSpace: function() {},
575 eatWhile: function(match) { }, 582 eatWhile: function(match) {},
576 eol: function() { }, 583 eol: function() {},
577 indentation: function() { }, 584 indentation: function() {},
578 /** 585 /**
579 * @param {!RegExp|string} pattern 586 * @param {!RegExp|string} pattern
580 * @param {boolean=} consume 587 * @param {boolean=} consume
581 * @param {boolean=} caseInsensitive 588 * @param {boolean=} caseInsensitive
582 */ 589 */
583 match: function(pattern, consume, caseInsensitive) { }, 590 match: function(pattern, consume, caseInsensitive) {},
584 next: function() { }, 591 next: function() {},
585 peek: function() { }, 592 peek: function() {},
586 skipTo: function(ch) { }, 593 skipTo: function(ch) {},
587 skipToEnd: function() { }, 594 skipToEnd: function() {},
588 sol: function() { } 595 sol: function() {}
589 }; 596 };
590 597
591 /** @constructor */ 598 /** @constructor */
592 CodeMirror.TextMarker = function(doc, type) { }; 599 CodeMirror.TextMarker = function(doc, type) {};
593 CodeMirror.TextMarker.prototype = { 600 CodeMirror.TextMarker.prototype = {
594 clear: function() { }, 601 clear: function() {},
595 find: function() { }, 602 find: function() {},
596 changed: function() { } 603 changed: function() {}
597 }; 604 };
598 605
599 /** @constructor */ 606 /** @constructor */
600 CodeMirror.LineWidget = function() { }; 607 CodeMirror.LineWidget = function() {};
601 CodeMirror.LineWidget.prototype = { 608 CodeMirror.LineWidget.prototype = {
602 clear: function() { } 609 clear: function() {}
603 }; 610 };
604 611
605
606 /** @type {Object.<string, !Object.<string, string>>} */ 612 /** @type {Object.<string, !Object.<string, string>>} */
607 CodeMirror.keyMap; 613 CodeMirror.keyMap;
608 614
609 /** @type {{scrollLeft: number, scrollTop: number}} */ 615 /** @type {{scrollLeft: number, scrollTop: number}} */
610 CodeMirror.doc; 616 CodeMirror.doc;
611 617
612 /** @type {boolean} */ 618 /** @type {boolean} */
613 window.dispatchStandaloneTestRunnerMessages; 619 window.dispatchStandaloneTestRunnerMessages;
614 620
615 /** 621 /**
616 * @param {*} obj 622 * @param {*} obj
617 * @return {boolean} 623 * @return {boolean}
618 */ 624 */
619 ArrayBuffer.isView = function(obj) { }; 625 ArrayBuffer.isView = function(obj) {};
620 626
621 /** 627 /**
622 * @param {Array.<Object>} keyframes 628 * @param {Array.<Object>} keyframes
623 * @param {number|Object} timing 629 * @param {number|Object} timing
624 * @return {Object} 630 * @return {Object}
625 */ 631 */
626 Element.prototype.animate = function(keyframes, timing) { }; 632 Element.prototype.animate = function(keyframes, timing) {};
627 633
628 /** 634 /**
629 * @override 635 * @override
630 * @param {string} type 636 * @param {string} type
631 * @param {(!EventListener|!function (!Event): (boolean|undefined)|null)} listen er 637 * @param {(!EventListener|!function (!Event): (boolean|undefined)|null)} listen er
632 * @param {(boolean|!{capture: (boolean|undefined), once: (boolean|undefined), p assive: (boolean|undefined)})=} options 638 * @param {(boolean|!{capture: (boolean|undefined), once: (boolean|undefined), p assive: (boolean|undefined)})=} options
633 * @this {EventTarget} 639 * @this {EventTarget}
634 */ 640 */
635 Element.prototype.addEventListener = function(type, listener, options) { }; 641 Element.prototype.addEventListener = function(type, listener, options) {};
636 642
637 var acorn = { 643 var acorn = {
638 /** 644 /**
639 * @param {string} text 645 * @param {string} text
640 * @param {Object.<string, boolean>} options 646 * @param {Object.<string, boolean>} options
641 * @return {!ESTree.Node} 647 * @return {!ESTree.Node}
642 */ 648 */
643 parse: function(text, options) {}, 649 parse: function(text, options) {},
644 650
645 /** 651 /**
646 * @param {string} text 652 * @param {string} text
647 * @param {Object.<string, boolean>} options 653 * @param {Object.<string, boolean>} options
648 * @return {!Acorn.Tokenizer} 654 * @return {!Acorn.Tokenizer}
649 */ 655 */
650 tokenizer: function(text, options) {}, 656 tokenizer: function(text, options) {},
651 657
652 tokTypes: { 658 tokTypes: {
653 _true: new Acorn.TokenType(), 659 _true: new Acorn.TokenType(),
654 _false: new Acorn.TokenType(), 660 _false: new Acorn.TokenType(),
655 _null: new Acorn.TokenType(), 661 _null: new Acorn.TokenType(),
656 num: new Acorn.TokenType(), 662 num: new Acorn.TokenType(),
657 regexp: new Acorn.TokenType(), 663 regexp: new Acorn.TokenType(),
658 string: new Acorn.TokenType(), 664 string: new Acorn.TokenType(),
659 name: new Acorn.TokenType(), 665 name: new Acorn.TokenType(),
660 eof: new Acorn.TokenType() 666 eof: new Acorn.TokenType()
661 } 667 }
662 }; 668 };
663 669
664 var Acorn = {}; 670 var Acorn = {};
665 /** 671 /**
666 * @constructor 672 * @constructor
667 */ 673 */
668 Acorn.Tokenizer = function() { 674 Acorn.Tokenizer = function() {
669 /** @type {function():!Acorn.Token} */ 675 /** @type {function():!Acorn.Token} */
670 this.getToken; 676 this.getToken;
671 }; 677 };
672 678
673 /** 679 /**
674 * @constructor 680 * @constructor
675 */ 681 */
676 Acorn.TokenType = function() { 682 Acorn.TokenType = function() {
677 /** @type {string} */ 683 /** @type {string} */
678 this.label; 684 this.label;
679 /** @type {(string|undefined)} */ 685 /** @type {(string|undefined)} */
680 this.keyword; 686 this.keyword;
681 }; 687 };
682 688
683 /** 689 /**
684 * @typedef {{type: !Acorn.TokenType, value: string, start: number, end: number} } 690 * @typedef {{type: !Acorn.TokenType, value: string, start: number, end: number} }
685 */ 691 */
686 Acorn.Token; 692 Acorn.Token;
687 693
688 /** 694 /**
689 * @typedef {{type: string, value: string, start: number, end: number}} 695 * @typedef {{type: string, value: string, start: number, end: number}}
690 */ 696 */
691 Acorn.Comment; 697 Acorn.Comment;
692 698
693 /** 699 /**
694 * @typedef {(!Acorn.Token|!Acorn.Comment)} 700 * @typedef {(!Acorn.Token|!Acorn.Comment)}
695 */ 701 */
696 Acorn.TokenOrComment; 702 Acorn.TokenOrComment;
697 703
698 var ESTree = {}; 704 var ESTree = {};
699 705
700 /** 706 /**
701 * @constructor 707 * @constructor
702 */ 708 */
703 ESTree.Node = function() 709 ESTree.Node = function() {
704 { 710 /** @type {number} */
705 /** @type {number} */ 711 this.start;
706 this.start; 712 /** @type {number} */
707 /** @type {number} */ 713 this.end;
708 this.end; 714 /** @type {string} */
709 /** @type {string} */ 715 this.type;
710 this.type; 716 /** @type {(!ESTree.Node|undefined)} */
711 /** @type {(!ESTree.Node|undefined)} */ 717 this.body;
712 this.body; 718 /** @type {(!Array.<!ESTree.Node>|undefined)} */
713 /** @type {(!Array.<!ESTree.Node>|undefined)} */ 719 this.declarations;
714 this.declarations; 720 /** @type {(!Array.<!ESTree.Node>|undefined)} */
715 /** @type {(!Array.<!ESTree.Node>|undefined)} */ 721 this.properties;
716 this.properties; 722 /** @type {(!ESTree.Node|undefined)} */
717 /** @type {(!ESTree.Node|undefined)} */ 723 this.init;
718 this.init; 724 /** @type {(!Array.<!ESTree.Node>|undefined)} */
719 /** @type {(!Array.<!ESTree.Node>|undefined)} */ 725 this.params;
720 this.params; 726 /** @type {(string|undefined)} */
721 /** @type {(string|undefined)} */ 727 this.name;
722 this.name; 728 /** @type {(?ESTree.Node|undefined)} */
723 /** @type {(?ESTree.Node|undefined)} */ 729 this.id;
724 this.id; 730 /** @type {(number|undefined)} */
725 /** @type {(number|undefined)} */ 731 this.length;
726 this.length; 732 /** @type {(?ESTree.Node|undefined)} */
727 /** @type {(?ESTree.Node|undefined)} */ 733 this.argument;
728 this.argument; 734 /** @type {(string|undefined)} */
729 /** @type {(string|undefined)} */ 735 this.operator;
730 this.operator;
731 }; 736 };
732 737
733 /** 738 /**
734 * @extends {ESTree.Node} 739 * @extends {ESTree.Node}
735 * @constructor 740 * @constructor
736 */ 741 */
737 ESTree.TemplateLiteralNode = function() 742 ESTree.TemplateLiteralNode = function() {
738 { 743 /** @type {!Array.<!ESTree.Node>} */
739 /** @type {!Array.<!ESTree.Node>} */ 744 this.quasis;
740 this.quasis; 745 /** @type {!Array.<!ESTree.Node>} */
741 /** @type {!Array.<!ESTree.Node>} */ 746 this.expressions;
742 this.expressions;
743 }; 747 };
744 748
745 var Gonzales = {}; 749 var Gonzales = {};
746 var gonzales = { 750 var gonzales = {
747 /** 751 /**
748 * @param {string} text 752 * @param {string} text
749 * @param {!Object=} options 753 * @param {!Object=} options
750 * @return {!Gonzales.Node} 754 * @return {!Gonzales.Node}
751 */ 755 */
752 parse: function(text, options) { }, 756 parse: function(text, options) {},
753 }; 757 };
754 758
755 /** 759 /**
756 * @constructor 760 * @constructor
757 */ 761 */
758 Gonzales.Location = function() 762 Gonzales.Location = function() {
759 { 763 /** @type {number} */
760 /** @type {number} */ 764 this.line;
761 this.line; 765 /** @type {number} */
762 /** @type {number} */ 766 this.column;
763 this.column;
764 }; 767 };
765 768
766 /** 769 /**
767 * @constructor 770 * @constructor
768 */ 771 */
769 Gonzales.Node = function() 772 Gonzales.Node = function() {
770 { 773 /** @type {string} */
771 /** @type {string} */ 774 this.type;
772 this.type; 775 /** @type {string} */
773 /** @type {string} */ 776 this.syntax;
774 this.syntax; 777 /** @type {!Gonzales.Location} */
775 /** @type {!Gonzales.Location} */ 778 this.start;
776 this.start; 779 /** @type {!Gonzales.Location} */
777 /** @type {!Gonzales.Location} */ 780 this.end;
778 this.end; 781 /** @type {(string|!Array<!Gonzales.Node>)} */
779 /** @type {(string|!Array<!Gonzales.Node>)} */ 782 this.content;
780 this.content;
781 }; 783 };
782 784
783 /** 785 /**
784 * @type {string} 786 * @type {string}
785 * @see http://heycam.github.io/webidl/#es-DOMException-prototype-object 787 * @see http://heycam.github.io/webidl/#es-DOMException-prototype-object
786 * TODO(jsbell): DOMException should be a subclass of Error. 788 * TODO(jsbell): DOMException should be a subclass of Error.
787 */ 789 */
788 DOMException.prototype.message; 790 DOMException.prototype.message;
789 /** @type {number} */ 791 /** @type {number} */
790 DOMException.ABORT_ERR; 792 DOMException.ABORT_ERR;
791 793
792 /** 794 /**
793 * @constructor 795 * @constructor
794 * @param {!Object} params 796 * @param {!Object} params
795 */ 797 */
796 var Terminal = function(params) { }; 798 var Terminal = function(params) {};
797 799
798 Terminal.prototype = { 800 Terminal.prototype = {
799 fit: function() { }, 801 fit: function() {},
800 linkify: function() { }, 802 linkify: function() {},
801 /** @param {!Element} element */ 803 /** @param {!Element} element */
802 open: function(element) { }, 804 open: function(element) {},
803 /** @param {string} eventName * @param {!Function} handler */ 805 /** @param {string} eventName * @param {!Function} handler */
804 on: function(eventName, handler) { } 806 on: function(eventName, handler) {}
805 }; 807 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698