From 76b96d4775dd158334a7982e1d4bb5815a5c8c64 Mon Sep 17 00:00:00 2001 From: ryiwamoto Date: Mon, 2 Feb 2015 21:00:06 +0900 Subject: [PATCH 1/2] add type annotations --- flot/jquery.flot.d.ts | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/flot/jquery.flot.d.ts b/flot/jquery.flot.d.ts index 1f6cf71cb7..62054809ba 100644 --- a/flot/jquery.flot.d.ts +++ b/flot/jquery.flot.d.ts @@ -173,6 +173,11 @@ declare module jquery.flot { y: number; } + interface offset { + left: number; + top: number; + } + interface canvasPoint { top: number; left: number; @@ -188,24 +193,24 @@ declare module jquery.flot { } interface axis extends axisOptions { - p2c(point):canvasPoint; - c2p(canvasPoint):point; + p2c(point: point):canvasPoint; + c2p(canvasPoint: canvasPoint):point; } interface plot { - highlight(series: dataSeries, datapoint: item); - unhightlight(); - unhighlight(series: dataSeries, datapoint: item); - setData(data: any); - setupGrid(); - draw(); - triggerRedrawOverlay(); - width(); - height(); - offset(); - pointOffset(point: point); - resize(); - shutdown(); + highlight(series: dataSeries, datapoint: item): void; + unhightlight(): void; + unhighlight(series: dataSeries, datapoint: item): void; + setData(data: any): void; + setupGrid(): void; + draw(): void; + triggerRedrawOverlay(): void; + width(): number; + height(): number; + offset(): JQueryCoordinates; + pointOffset(point: point): offset; + resize(): void; + shutdown(): void; getData(): dataSeries[]; getAxes(): axes; getPlaceholder(): JQuery; From 0a7d1f04b029ce02c01b1fcc6f21f4f0e922b41a Mon Sep 17 00:00:00 2001 From: ryiwamoto Date: Mon, 2 Feb 2015 21:35:51 +0900 Subject: [PATCH 2/2] update jquery.flot.d.ts --- flot/jquery.flot.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flot/jquery.flot.d.ts b/flot/jquery.flot.d.ts index 62054809ba..9ea862c5c9 100644 --- a/flot/jquery.flot.d.ts +++ b/flot/jquery.flot.d.ts @@ -193,6 +193,7 @@ declare module jquery.flot { } interface axis extends axisOptions { + options: axisOptions; p2c(point: point):canvasPoint; c2p(canvasPoint: canvasPoint):point; } @@ -213,6 +214,8 @@ declare module jquery.flot { shutdown(): void; getData(): dataSeries[]; getAxes(): axes; + getXAxes(): axis[]; + getYAxes(): axis[]; getPlaceholder(): JQuery; getCanvas(): HTMLCanvasElement; getPlotOffset(): canvasPoint;