mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-01 12:42:58 +08:00
[convert-hrtime] add typings (#18812)
This commit is contained in:
committed by
Mohamed Hegazy
parent
963cd2108f
commit
68575400ca
9
types/convert-hrtime/convert-hrtime-tests.ts
Normal file
9
types/convert-hrtime/convert-hrtime-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import convertHrtime = require('convert-hrtime');
|
||||
|
||||
const time = convertHrtime(process.hrtime(process.hrtime()));
|
||||
let num: number;
|
||||
num = time.seconds;
|
||||
num = time.milliseconds;
|
||||
num = time.nanoseconds;
|
||||
16
types/convert-hrtime/index.d.ts
vendored
Normal file
16
types/convert-hrtime/index.d.ts
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// Type definitions for convert-hrtime 2.0
|
||||
// Project: https://github.com/sindresorhus/convert-hrtime#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = convertHrtime;
|
||||
|
||||
declare function convertHrtime(hrtime: [number, number]): convertHrtime.HRTime;
|
||||
|
||||
declare namespace convertHrtime {
|
||||
interface HRTime {
|
||||
seconds: number;
|
||||
milliseconds: number;
|
||||
nanoseconds: number;
|
||||
}
|
||||
}
|
||||
22
types/convert-hrtime/tsconfig.json
Normal file
22
types/convert-hrtime/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"convert-hrtime-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/convert-hrtime/tslint.json
Normal file
1
types/convert-hrtime/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user