From a540db143d95acf32c68cdf54cda3b0095543241 Mon Sep 17 00:00:00 2001 From: Maksim Sinik Date: Mon, 14 Sep 2020 14:55:20 +0200 Subject: [PATCH 1/3] Removes esModuleInterop from tsd and adds star import for helmet --- index.d.ts | 6 +++--- package.json | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/index.d.ts b/index.d.ts index 8efd19a..7becece 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,8 +1,8 @@ -import { FastifyPlugin } from "fastify"; -import helmet from "helmet"; +import { FastifyPluginCallback } from "fastify/types/plugin"; +import * as helmet from "helmet"; type FastifyHelmetOptions = Parameters[0]; -export const fastifyHelmet: FastifyPlugin>; +export const fastifyHelmet: FastifyPluginCallback>; export default fastifyHelmet; diff --git a/package.json b/package.json index a77ed68..cfc0935 100644 --- a/package.json +++ b/package.json @@ -40,10 +40,5 @@ "dependencies": { "fastify-plugin": "^2.1.1", "helmet": "^4.0.0" - }, - "tsd": { - "compilerOptions": { - "esModuleInterop": true - } } } From 8b80e42bf759a69355fd4330351c060c4b8546d1 Mon Sep 17 00:00:00 2001 From: Maksim Sinik Date: Mon, 14 Sep 2020 15:02:51 +0200 Subject: [PATCH 2/3] Uses FastifyPluginCallback exported from fastify top level exports --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 7becece..f40d745 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,4 @@ -import { FastifyPluginCallback } from "fastify/types/plugin"; +import { FastifyPluginCallback } from "fastify"; import * as helmet from "helmet"; type FastifyHelmetOptions = Parameters[0]; From d24327d3f7289ee0ef3bc6af8c906ece9738723a Mon Sep 17 00:00:00 2001 From: Maksim Sinik Date: Tue, 15 Sep 2020 09:51:30 +0200 Subject: [PATCH 3/3] Uses import require to get helmet types --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index f40d745..672d69f 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,5 @@ import { FastifyPluginCallback } from "fastify"; -import * as helmet from "helmet"; +import helmet = require("helmet"); type FastifyHelmetOptions = Parameters[0];