Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kit): addTypeTemplate helper with auto-registration #21331

Merged
merged 12 commits into from
Jun 9, 2023
Prev Previous commit
chore: capitalise headings to match style
  • Loading branch information
danielroe committed Jun 8, 2023
commit 33f22e086671df9b008aaa8b4c64de0e7e798c6c
6 changes: 3 additions & 3 deletions docs/2.guide/3.going-further/3.modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 443,7 @@ export default defineNuxtModule({

::

#### Adding templates/virtual files
#### Adding Templates/Virtual Files

If you need to add a virtual file that can be imported into the user's app, you can use the `addTemplate` utility.

Expand All @@ -461,7 461,7 @@ export default defineNuxtModule({
})
```

#### Adding type declarations
#### Adding Type Declarations

You might also want to add a type declaration to the user's project (for example, to augment an Nuxt interface
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to augment an Nuxt interface => to augment a Nuxt interface

or provide a global type of your own). For this, Nuxt provides the `addTypeTemplate` utility that both
Expand Down Expand Up @@ -499,7 499,7 @@ nuxt.hook('prepare:types', ({ references }) => {
})
```

##### Updating templates
##### Updating Templates

If you need to update your templates/virtual files, you can leverage the `updateTemplates` utility like this :

Expand Down