Skip to content

Commit

Permalink
Initial commit of externs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed May 3, 2016
1 parent c943755 commit 763a62e
Show file tree
Hide file tree
Showing 52 changed files with 29,808 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lib/amd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @param {string} id
* @param {(Array|Function)} arg2
* @param {Function=} arg3
*/
function define(id, arg2, arg3)
{
//
}

/** @type {!Object} */
define.amd = {};

/**
* Disabled because it conflicts with Node.js
*
* @param {Array.<string>} deps
* @param {Function} fn
*/
// function require(deps, fn) {}
156 changes: 156 additions & 0 deletions lib/chrome.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
/*
* Copyright 2013 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 globals in Chrome. This file describes the
* externs API for the chrome.* object when running in a normal browser
* context. For APIs available in Chrome Extensions, see chrome_extensions.js
* in this directory.
* @externs
*/


/**
* namespace
* @const
*/
var chrome = {};



/**
* Returns an object representing current load times. Note that the properties
* on the object do not change and the function must be called again to get
* up-to-date data.
*
* @see http://goto.google.com/chromeloadtimesextension
*
* @return {!ChromeLoadTimes}
*/
chrome.loadTimes = function() {};



/**
* The data object given by chrome.loadTimes().
* @constructor
*/
function ChromeLoadTimes() {}


/** @type {number} */
ChromeLoadTimes.prototype.requestTime;


/** @type {number} */
ChromeLoadTimes.prototype.startLoadTime;


/** @type {number} */
ChromeLoadTimes.prototype.commitLoadTime;


/** @type {number} */
ChromeLoadTimes.prototype.finishDocumentLoadTime;


/** @type {number} */
ChromeLoadTimes.prototype.finishLoadTime;


/** @type {number} */
ChromeLoadTimes.prototype.firstPaintTime;


/** @type {number} */
ChromeLoadTimes.prototype.firstPaintAfterLoadTime;


/** @type {number} */
ChromeLoadTimes.prototype.navigationType;


/**
* True iff the resource was fetched over SPDY.
* @type {boolean}
*/
ChromeLoadTimes.prototype.wasFetchedViaSpdy;


/** @type {boolean} */
ChromeLoadTimes.prototype.wasNpnNegotiated;


/** @type {string} */
ChromeLoadTimes.prototype.npnNegotiatedProtocol;


/** @type {boolean} */
ChromeLoadTimes.prototype.wasAlternateProtocolAvailable;


/** @type {string} */
ChromeLoadTimes.prototype.connectionInfo;


/**
* Returns an object containing timing information.
* @return {!ChromeCsiInfo}
*/
chrome.csi = function() {};



/**
* The data object given by chrome.csi().
* @constructor
*/
function ChromeCsiInfo() {}


/**
* Same as chrome.loadTimes().requestTime, if defined.
* Otherwise, gives the same value as chrome.loadTimes().startLoadTime.
* In milliseconds, truncated.
* @type {number}
*/
ChromeCsiInfo.prototype.startE;


/**
* Same as chrome.loadTimes().finishDocumentLoadTime but in milliseconds and
* truncated.
* @type {number}
*/
ChromeCsiInfo.prototype.onloadT;


/**
* The time since startE in milliseconds.
* @type {number}
*/
ChromeCsiInfo.prototype.pageT;


/** @type {number} */
ChromeCsiInfo.prototype.tran;


/**
* @param {string|!ArrayBuffer|!Object} message
* @see https://developers.google.com/native-client/devguide/tutorial
*/
HTMLEmbedElement.prototype.postMessage = function(message) {};
47 changes: 47 additions & 0 deletions lib/deprecated.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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 JavaScript Built-Ins that are not
* part of any specifications but are
* still needed in some project's build.
* @externs
*
*/

// Do we need an opera.js?
var opera;
Window.prototype.opera;
Window.prototype.opera.postError;

/** @constructor */ function XSLTProcessor() {}

/**
* @param {*=} opt_text
* @param {*=} opt_value
* @param {*=} opt_defaultSelected
* @param {*=} opt_selected
* @constructor
* @extends {Element}
*/
function Option(opt_text, opt_value, opt_defaultSelected, opt_selected) {}


// The "methods" object is a place to hang arbitrary external
// properties. It is a throwback to pre-typed days, and should
// not be used for any new definitions; it exists only to bridge
// the gap between the old way and the new way.
var methods = {};
Loading

0 comments on commit 763a62e

Please sign in to comment.