Comparing version 3.0.0 to 3.1.0
@@ -1,28 +0,57 @@ | ||
/** | ||
* @returns Elapsed milliseconds. | ||
*/ | ||
export interface TimeEndFunction { | ||
(): number; | ||
declare namespace timeSpan { | ||
interface TimeEndFunction { | ||
/** | ||
@returns Elapsed milliseconds. | ||
*/ | ||
(): number; | ||
/** | ||
* @returns Elapsed milliseconds rounded. | ||
*/ | ||
rounded(): number; | ||
/** | ||
@returns Elapsed milliseconds rounded. | ||
*/ | ||
rounded(): number; | ||
/** | ||
* @returns Elapsed seconds. | ||
*/ | ||
seconds(): number; | ||
/** | ||
@returns Elapsed seconds. | ||
*/ | ||
seconds(): number; | ||
/** | ||
* @returns Elapsed nanoseconds. | ||
*/ | ||
nanoseconds(): number; | ||
/** | ||
@returns Elapsed nanoseconds. | ||
*/ | ||
nanoseconds(): number; | ||
} | ||
} | ||
/** | ||
* Simplified high resolution timing. | ||
* | ||
* @returns A function that returns the time difference. | ||
*/ | ||
export default function timeSpan(): TimeEndFunction; | ||
declare const timeSpan: { | ||
/** | ||
Simplified high resolution timing. | ||
@returns A function that returns the time difference. | ||
@example | ||
``` | ||
import timeSpan = require('time-span'); | ||
const end = timeSpan(); | ||
timeConsumingFn(); | ||
console.log(end()); | ||
//=> 1745.3186 | ||
console.log(end.rounded()); | ||
//=> 1745 | ||
console.log(end.seconds()); | ||
//=> 1.7453186 | ||
``` | ||
*/ | ||
(): timeSpan.TimeEndFunction; | ||
// TODO: Remove this for the next major release, refactor the whole definition to: | ||
// declare function timeSpan(): timeSpan.TimeEndFunction; | ||
// export = timeSpan; | ||
default: typeof timeSpan; | ||
}; | ||
export = timeSpan; |
@@ -17,2 +17,3 @@ 'use strict'; | ||
module.exports = timeSpan; | ||
// TODO: Remove this for the next major release | ||
module.exports.default = timeSpan; |
{ | ||
"name": "time-span", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Simplified high resolution timing", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
"test": "xo && ava && tsd" | ||
}, | ||
@@ -45,8 +45,8 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "^1.3.1", | ||
"ava": "^1.4.1", | ||
"delay": "^4.1.0", | ||
"in-range": "^1.0.0", | ||
"tsd-check": "^0.3.0", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4167
58