From bb536b6bf25336ebe405a0c9774bdc0c3ffaa810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Vince?= Date: Thu, 11 May 2017 13:22:34 +0200 Subject: [PATCH] Type definitions for microtime@2.1 --- types/microtime/index.d.ts | 14 ++++++++++++++ types/microtime/microtime-tests.ts | 7 +++++++ types/microtime/tsconfig.json | 22 ++++++++++++++++++++++ types/microtime/tslint.json | 1 + 4 files changed, 44 insertions(+) create mode 100644 types/microtime/index.d.ts create mode 100644 types/microtime/microtime-tests.ts create mode 100644 types/microtime/tsconfig.json create mode 100644 types/microtime/tslint.json diff --git a/types/microtime/index.d.ts b/types/microtime/index.d.ts new file mode 100644 index 0000000000..bb2ac3e675 --- /dev/null +++ b/types/microtime/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for microtime 2.1 +// Project: https://github.com/wadey/node-microtime +// Definitions by: Kovács Vince +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace microtime { + function now (): number + + function nowDouble (): number + + function nowStruct (): number[] +} + +export = microtime; \ No newline at end of file diff --git a/types/microtime/microtime-tests.ts b/types/microtime/microtime-tests.ts new file mode 100644 index 0000000000..6793171d36 --- /dev/null +++ b/types/microtime/microtime-tests.ts @@ -0,0 +1,7 @@ +import * as microtime from "microtime" + +const nowInteger: number = microtime.now() + +const nowDouble: number = microtime.nowDouble() + +const nowStruct: number[] = microtime.nowStruct() \ No newline at end of file diff --git a/types/microtime/tsconfig.json b/types/microtime/tsconfig.json new file mode 100644 index 0000000000..3bcc951906 --- /dev/null +++ b/types/microtime/tsconfig.json @@ -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", + "microtime-tests.ts" + ] +} diff --git a/types/microtime/tslint.json b/types/microtime/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/microtime/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }