From 2ccdb0fbe9544326289fb5cece4125eb111d41da Mon Sep 17 00:00:00 2001 From: Yuri Drabik Date: Mon, 21 Oct 2019 17:25:23 +0200 Subject: [PATCH] Added TypeScript definitions --- index.d.ts | 13 +++++++++++++ package.json | 1 + 2 files changed, 14 insertions(+) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..d5e096e --- /dev/null +++ b/index.d.ts @@ -0,0 +1,13 @@ +declare module 'pdf-puppeteer' { + import { PDFOptions, LaunchOptions } from 'puppeteer'; + + function convertHTMLToPDF( + html: string, + callback: (data: Buffer) => void, + options?: PDFOptions, + puppeteerArgs?: LaunchOptions, + remoteContent?: boolean, + ): Promise; + + export = convertHTMLToPDF; + } diff --git a/package.json b/package.json index d7b8c97..0a99f2a 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.1.8", "description": "A simple NPM package to convert html to pdf for Node applications by using Puppeteer", "main": "index.js", + "types": "index.d.ts", "scripts": { "test": "jest" },