From: Dan Vanderkam Date: Sat, 26 Oct 2013 19:09:06 +0000 (-0500) Subject: Update dygraph-externs to better reflect the public API (thanks mcantos) X-Git-Tag: v1.1.0~75^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=0e7874c79a2aee1e685b34d5fe163d7571d8959a;p=dygraphs.git Update dygraph-externs to better reflect the public API (thanks mcantos) --- diff --git a/dygraph-externs.js b/dygraph-externs.js index ed5de4c..b4b8e5d 100644 --- a/dygraph-externs.js +++ b/dygraph-externs.js @@ -1,93 +1,143 @@ +// TODO(danvk): move the Dygraph definitions out of here once I closure-ify dygraphs.js /** - * @param {Object} dict - * @return {!Array.} + * @param {!HTMLDivElement|string} div + * @param {DygraphDataArray| + * GVizDataTable| + * string| + * function():(DygraphDataArray|GVizDataTable|string)} file + * @param {Object} attrs + * @constructor */ -function printStackTrace(dict) {} +function Dygraph(div, file, attrs) {} +/** @type {string} */ +Dygraph.NAME; -/** - * @constructor - */ -function G_vmlCanvasManager() {} +/** @type {string} */ +Dygraph.VERSION; -/** - * @param {!HTMLCanvasElement} canvas - */ -G_vmlCanvasManager.initElement = function(canvas) {}; +/** @type {function(): string} */ +Dygraph.toString; -// For IE -/** - * @param {string} type - * @param {Object} fn - */ -Element.prototype.detachEvent = function(type, fn) {}; +/** @type {function(?string): boolean} */ +Dygraph.prototype.isZoomed; +/** @type {function(): string} */ +Dygraph.prototype.toString; -/** - * @typedef {function( - * (number|Date), - * number, - * function(string):*, - * (Dygraph|undefined) - * ):string} - */ -var AxisLabelFormatter; +/** @type {function(string, string)} */ +Dygraph.prototype.getOption; +/** @type {function(): number} */ +Dygraph.prototype.rollPeriod; -/** - * @typedef {function(number,function(string),Dygraph):string} - */ -var ValueFormatter; +/** @type {function(): ?Array.} */ +Dygraph.prototype.xAxisRange; +/** @type {function(): Array.} */ +Dygraph.prototype.xAxisExtremes; -/** - * @typedef {Array.>>} - */ -var DygraphDataArray; +/** @type {function(number): ?Array.} */ +Dygraph.prototype.yAxisRange; -/** - * @constructor - */ -function GVizDataTable() {} +/** @type {function(): Array.>} */ +Dygraph.prototype.yAxisRanges; -// TODO(danvk): move the Dygraph definitions out of here once I closure-ify dygraphs.js -/** - * @param {!HTMLDivElement|string} div - * @param {DygraphDataArray| - * GVizDataTable| - * string| - * function():(DygraphDataArray|GVizDataTable|string)} file - * @param {Object} attrs - * @constructor - */ -function Dygraph(div, file, attrs) {} +/** @type {function(?number, ?number, ?number): Array.} */ +Dygraph.prototype.toDomCoords -/** - * @constructor - */ -function DygraphLayout() {} +/** @type {function(?number): ?number} */ +Dygraph.prototype.toDomXCoord; -/** - * @type {Array} - */ -DygraphLayout.prototype.datasets; +/** @type {function(?number, ?number): ?number} */ +Dygraph.prototype.toDomYCoord; -// TODO: DygraphOptions should not reach inside Dygraph private data like this. -/** @type {Object} */ -Dygraph.prototype.attrs_; -/** @type {Object} */ -Dygraph.prototype.user_attrs_; +/** @type {function(?number, ?number, ?number): Array.} */ +Dygraph.prototype.toDataCoords; -/** - * @type {DygraphLayout} - */ -Dygraph.prototype.layout_; +/** @type {function(?number): ?number} */ +Dygraph.prototype.toDataXCoord; + +/** @type {function(?number, ?number): ?number} */ +Dygraph.prototype.toDataYCoord; + +/** @type {function(?number, ?number): ?number} */ +Dygraph.prototype.toPercentYCoord; + +/** @type {function(?number): ?number} */ +Dygraph.prototype.toPercentXCoord; + +/** @type {function(): number} */ +Dygraph.prototype.numColumns; + +/** @type {function(): number} */ +Dygraph.prototype.numRows; + +/** @type {function(number, number)} */ +Dygraph.prototype.getValue; + +/** @type {function()} */ +Dygraph.prototype.destroy; + +/** @type {function()} */ +Dygraph.prototype.getColors; + +/** @type {function(string)} */ +Dygraph.prototype.getPropertiesForSeries; + +/** @type {function()} */ +Dygraph.prototype.resetZoom; + +/** @type {function(): {x, y, w, h}} */ +Dygraph.prototype.getArea; + +/** @type {function(Object): Array.} */ +Dygraph.prototype.eventToDomCoords; + +/** @type {function(number, string, boolean): boolean} */ +Dygraph.prototype.setSelection; + +/** @type {function()} */ +Dygraph.prototype.clearSelection; + +/** @type {function(): number} */ +Dygraph.prototype.getSelection; /** @type {function(): string} */ Dygraph.prototype.getHighlightSeries; -/** @type {Array.<{elem:Element,type:string,fn:function(!Event):(boolean|undefined|null)}>} */ -Dygraph.prototype.registeredEvents_; +/** @type {function(): boolean} */ +Dygraph.prototype.isSeriesLocked; + +/** @type {function(): number} */ +Dygraph.prototype.numAxes; + +/** @type {function(Object, Boolean=)} */ +Dygraph.prototype.updateOptions; + +/** @type {function(number, number)} */ +Dygraph.prototype.resize; + +/** @type {function(number)} */ +Dygraph.prototype.adjustRoll; + +/** @type {function(): Array.} */ +Dygraph.prototype.visibility; + +/** @type {function(number, boolean)} */ +Dygraph.prototype.setVisibility; + +/** @type {function(Array., boolean)} */ +Dygraph.prototype.setAnnotations; + +/** @type {function(): Array.} */ +Dygraph.prototype.annotations; + +/** @type {function(): ?Array.} */ +Dygraph.prototype.getLabels; + +/** @type {function(string): ?number} */ +Dygraph.prototype.indexFromSetName; -/** @type {{axes: Object}} */ -Dygraph.DEFAULT_ATTRS; +/** @type {function(function(!Dygraph))} */ +Dygraph.prototype.ready;