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 1/2] 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" } From be9f4c36c05f83d57b2cf07f0f142edd8141d8f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20Vince?= Date: Thu, 11 May 2017 13:46:16 +0200 Subject: [PATCH 2/2] Fixed tslint errors --- types/microtime/index.d.ts | 10 ++++------ types/microtime/microtime-tests.ts | 8 ++++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/types/microtime/index.d.ts b/types/microtime/index.d.ts index bb2ac3e675..72c1d09d63 100644 --- a/types/microtime/index.d.ts +++ b/types/microtime/index.d.ts @@ -3,12 +3,10 @@ // Definitions by: Kovács Vince // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace microtime { - function now (): number +export as namespace microtime; - function nowDouble (): number +export function now(): number; - function nowStruct (): number[] -} +export function nowDouble(): number; -export = microtime; \ No newline at end of file +export function nowStruct(): number[]; diff --git a/types/microtime/microtime-tests.ts b/types/microtime/microtime-tests.ts index 6793171d36..81bce7c3a3 100644 --- a/types/microtime/microtime-tests.ts +++ b/types/microtime/microtime-tests.ts @@ -1,7 +1,7 @@ -import * as microtime from "microtime" +import * as microtime from "microtime"; -const nowInteger: number = microtime.now() +const nowInteger: number = microtime.now(); -const nowDouble: number = microtime.nowDouble() +const nowDouble: number = microtime.nowDouble(); -const nowStruct: number[] = microtime.nowStruct() \ No newline at end of file +const nowStruct: number[] = microtime.nowStruct();