From 8e7644b910e05325f2912e301b1950a4b3576437 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Tue, 28 Aug 2018 18:59:48 -0700 Subject: [PATCH] adds typings for the 'prometheus-gc-stats' package --- types/prometheus-gc-stats/index.d.ts | 9 +++++++++ .../prometheus-gc-stats-tests.ts | 5 +++++ types/prometheus-gc-stats/tsconfig.json | 19 +++++++++++++++++++ types/prometheus-gc-stats/tslint.json | 3 +++ 4 files changed, 36 insertions(+) create mode 100644 types/prometheus-gc-stats/index.d.ts create mode 100644 types/prometheus-gc-stats/prometheus-gc-stats-tests.ts create mode 100644 types/prometheus-gc-stats/tsconfig.json create mode 100644 types/prometheus-gc-stats/tslint.json diff --git a/types/prometheus-gc-stats/index.d.ts b/types/prometheus-gc-stats/index.d.ts new file mode 100644 index 0000000000..007cf28bed --- /dev/null +++ b/types/prometheus-gc-stats/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for prometheus-gc-stats 0.6 +// Project: https://github.com/SimenB/node-prometheus-gc-stats +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// register is typeof require('prom-client').Registry which has its own .d.ts +declare function gcStats(register: any): () => void; + +export = gcStats; diff --git a/types/prometheus-gc-stats/prometheus-gc-stats-tests.ts b/types/prometheus-gc-stats/prometheus-gc-stats-tests.ts new file mode 100644 index 0000000000..abc7542aa0 --- /dev/null +++ b/types/prometheus-gc-stats/prometheus-gc-stats-tests.ts @@ -0,0 +1,5 @@ +import gcStats = require('prometheus-gc-stats'); + +const testFunc = gcStats('something'); +// $ExpectType void +testFunc(); diff --git a/types/prometheus-gc-stats/tsconfig.json b/types/prometheus-gc-stats/tsconfig.json new file mode 100644 index 0000000000..1fcdb90ce8 --- /dev/null +++ b/types/prometheus-gc-stats/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prometheus-gc-stats-tests.ts" + ] +} diff --git a/types/prometheus-gc-stats/tslint.json b/types/prometheus-gc-stats/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/prometheus-gc-stats/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}