diff --git a/lib/Stopwatch.d.ts b/lib/Stopwatch.d.ts new file mode 100644 index 0000000..421675a --- /dev/null +++ b/lib/Stopwatch.d.ts @@ -0,0 +1,25 @@ +declare class Stopwatch { + constructor(name?: string | boolean, autostart?: boolean, delta?: number); + + start(): void; + stop(): number | null; + restart(): void; + suspend(): number | null; + resume(): void; + split(): number | null; + unsplit(): number | null; + reset(): void; + read(precision?: number, units?: 's' | 'ms'): number | null; + toString(): string; + prettyPrint(): void; + + static STATES: { + INIT: string; + RUNNING: string; + STOPPED: string; + SPLIT: string; + }; +} + +export = Stopwatch; + diff --git a/package.json b/package.json index 13c9113..80f2a9a 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "2.18.0", "description": "statman-stopwatch is one of the metrics from the statman library. It is a simple high res stopwatch for node.js. Stopwatch is useful for determining the amount of time it takes to perform an activity.", "main": "lib/Stopwatch.js", + "types": "Stopwatch.d.ts", "files": [ "lib" ],