From 3e1b010cae31d16843444ac3b0c83332855d088a Mon Sep 17 00:00:00 2001 From: liushuyu Date: Wed, 14 Sep 2022 02:30:56 -0600 Subject: [PATCH] typings: add shim typing for checkenv --- src/server.ts | 1 - tsconfig.json | 6 +++++- typings/checkenv/index.d.ts | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 typings/checkenv/index.d.ts diff --git a/src/server.ts b/src/server.ts index 28d0e86..62cfb1f 100644 --- a/src/server.ts +++ b/src/server.ts @@ -8,7 +8,6 @@ import modules from './commands/_'; import triggers from './triggers/_'; // Check for environmental variables. -// eslint-disable-next-line import * as checkenv from 'checkenv'; checkenv.setConfig(require('../env.json')); checkenv.check(); diff --git a/tsconfig.json b/tsconfig.json index 336ff72..39310b9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,11 @@ "lib": [ "es2018", "dom" - ] + ], + "typeRoots": [ + "./typings", + "./node_modules/@types/" + ], }, "include": [ "src/**/*" diff --git a/typings/checkenv/index.d.ts b/typings/checkenv/index.d.ts new file mode 100644 index 0000000..db5b770 --- /dev/null +++ b/typings/checkenv/index.d.ts @@ -0,0 +1,5 @@ +declare module 'checkenv'; + +export function load(): string; +export function check(): void; +export function setConfig(config: any): void;