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
This commit is contained in:
Sondre Nilsen 2020-12-18 00:35:46 +01:00 committed by GitHub
parent c959e51b4e
commit cf956e74df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

2
nodejs/index.d.ts vendored
View File

@ -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.

View File

@ -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",