Skip to content

Commit

Permalink
chore: change from src for types import to getContents
Browse files Browse the repository at this point in the history
  • Loading branch information
BayBreezy committed Mar 17, 2024
1 parent 953db02 commit f7a2de4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
"postcss-custom-properties": "^13.3.6",
"vitest": "^1.4.0"
}
}
}
15 changes: 14 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,20 @@ export default defineNuxtModule<ModuleOptions>({
// add type template
addTypeTemplate({
filename: "types/pdfmake-module.d.ts",
src: resolver.resolve("./index.d.ts"),
getContents: () => `// Generated by nuxt-pdfmake
declare module "#app" {
interface NuxtApp {
$pdfMake: typeof import("pdfmake/build/pdfmake");
}
}
declare module "vue" {
interface ComponentCustomProperties {
$pdfMake: typeof import("pdfmake/build/pdfmake");
}
}
export {};`,
});
// Add devtools tab
if (!options.enableDevtools) return;
Expand Down

0 comments on commit f7a2de4

Please sign in to comment.