Definitions for FPSMeter

This commit is contained in:
Aaron Lampros 2013-05-03 13:08:24 -04:00
parent 347814358a
commit cc49d1febb
2 changed files with 44 additions and 0 deletions

43
FPSMeter/FPSMeter.d.ts vendored Normal file
View File

@ -0,0 +1,43 @@
// Type definitions for FPSmeter v0.3.0
// Project: http://darsa.in/fpsmeter/
// Definitions by: Aaron Lampros <http://github.com/alampros/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface FPSMeterOptions {
interval?: number; // Update interval in milliseconds.
smoothing?: number; // Spike smoothing strength. 1 means no smoothing.
show?: string; // Whether to show 'fps', or 'ms' = frame duration in milliseconds.
toggleOn?: string; // Toggle between show 'fps' and 'ms' on this event.
decimals?: number; // Number of decimals in FPS number. 1 = 59.9, 2 = 59.94, ...
maxFps?: number; // Max expected FPS value.
threshold?: number; // Minimal tick reporting interval in milliseconds.
position?: string; // Meter position.
zIndex?: number; // Meter Z index.
left?: string; // Meter left offset.
top?: string; // Meter top offset.
right?: string; // Meter right offset.
bottom?: string; // Meter bottom offset.
margin?: string; // Meter margin. Helps with centering the counter when left: 50%;
theme?: string; // Meter theme. Build in: 'dark', 'light', 'transparent', 'colorful'.
heat?: number; // Allow themes to use coloring by FPS heat. 0 FPS = red, maxFps = green.
graph?: number; // Whether to show history graph.
history?: number; // How many history states to show in a graph.
}
declare class FPSMeter {
constructor(anchor?: HTMLElement, options?: FPSMeterOptions);
public tick(): void;
public tickStart(): void;
public pause(): FPSMeter;
public resume(): FPSMeter;
public set(name: string, value: any): FPSMeter;
public showDuration(): FPSMeter;
public showFps(): FPSMeter;
public toggle(): FPSMeter;
public hide(): FPSMeter;
public show(): FPSMeter;
public destroy() : void;
}

View File

@ -57,6 +57,7 @@ List of Definitions
* [Firebase](https://www.firebase.com/docs/javascript/firebase) (by [Vincent Bortone](https://github.com/vbortone))
* [FlexSlider](http://www.woothemes.com/flexslider/) (by [Diullei Gomes](https://github.com/Diullei))
* [Foundation](http://foundation.zurb.com/) (by [Boris Yankov](https://github.com/borisyankov))
* [FPSMeter](http://darsa.in/fpsmeter/) (by [Aaron Lampros](https://github.com/alampros))
* [Gamepad](http://www.w3.org/TR/gamepad/) (by [Kon](http://phyzkit.net/))
* [glDatePicker](http://glad.github.com/glDatePicker/) (by [D<EFBFBD>niel Tar](https://github.com/qcz))
* [GreenSock Animation Platform (GSAP)](http://www.greensock.com/get-started-js/) (by [Robert S.](https://github.com/codeBelt))