From af4debb9a8118af84a5a279aae6d5ee223d03c04 Mon Sep 17 00:00:00 2001 From: Giovane Cardoso Date: Sat, 7 May 2022 01:29:19 -0300 Subject: [PATCH] feat: set declarations --- README.md | 2 ++ build.config.ts | 4 +--- package.json | 1 + src/env.d.ts | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 src/env.d.ts diff --git a/README.md b/README.md index 2d76f4a..05a2a1f 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,5 @@ app.mount('#app'); }); ``` + +> WARNING: Depending on how the instance was initialized, use `const pdf = usePDF().default` instead `const pdf = usePDF()` \ No newline at end of file diff --git a/build.config.ts b/build.config.ts index 7778700..fc47783 100644 --- a/build.config.ts +++ b/build.config.ts @@ -17,9 +17,7 @@ export default { ], rollup: { emitCJS: true, - resolve: { - dedupe: ['pdfmake'] - } }, + declaration: true, externals: ['pdfmake'], } \ No newline at end of file diff --git a/package.json b/package.json index 411a53b..81b6aca 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "description": "A pdfmake plugin for Vue 3", "main": "dist/index.cjs", "module": "dist/index.mjs", + "types": "dist/index.d.ts", "repository": { "type": "git", "url": "https://github.com/betterwrite/vue-pdfmake" diff --git a/src/env.d.ts b/src/env.d.ts new file mode 100644 index 0000000..119638c --- /dev/null +++ b/src/env.d.ts @@ -0,0 +1 @@ +declare module 'pdfmake/build/pdfmake' \ No newline at end of file