From cf956e74df74e4f43752e6ceaf3e064d912ff189 Mon Sep 17 00:00:00 2001 From: Sondre Nilsen Date: Fri, 18 Dec 2020 00:35:46 +0100 Subject: [PATCH] Fix TS types and include index.d.ts when publishing to NPM (#16) * Include index.d.ts when publishing to NPM * Set correct type for minify in index.d.ts --- nodejs/index.d.ts | 2 +- nodejs/package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nodejs/index.d.ts b/nodejs/index.d.ts index 5597888..4008002 100644 --- a/nodejs/index.d.ts +++ b/nodejs/index.d.ts @@ -22,7 +22,7 @@ export function createConfiguration (options: { * @param cfg - Configuration created by {@link createConfiguration} * @returns Minified HTML code */ -export function minify (src: string, cfg: Cfg): string; +export function minify (src: string, cfg: Cfg): Buffer; /** * Minifies a {@link Buffer} containing UTF-8 HTML code in place. diff --git a/nodejs/package.json b/nodejs/package.json index ae862b0..5741e6f 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -5,7 +5,8 @@ "main": "index.node", "types": "index.d.ts", "files": [ - "postinstall.js" + "postinstall.js", + "index.d.ts" ], "scripts": { "build": "node-gyp build && shx mv build/Release/index.node index.node",