fix(docs): add return type to template functions

This commit is contained in:
Andrey Yolkin 2023-09-03 19:31:10 +03:00
parent 9e64b26cac
commit daf3a8ae2d
No known key found for this signature in database
GPG Key ID: 4A2899263001EA49

View File

@ -1821,7 +1821,7 @@ Renders given template using [lodash template](https://lodash.com/docs/4.17.15#t
#### Type
```ts
function addTemplate (template: NuxtTemplate | string): NuxtTemplate
function addTemplate (template: NuxtTemplate | string): ResolvedNuxtTemplate
interface NuxtTemplate {
src?: string
@ -1831,6 +1831,17 @@ interface NuxtTemplate {
getContents?: (data: Record<string, any>) => string | Promise<string>
write?: boolean
}
interface ResolvedNuxtTemplate {
src: string
filename: string
dst: string
options: Record<string, any>
getContents: (data: Record<string, any>) => string | Promise<string>
write: boolean
filename: string
dst: string
}
```
#### Parameters
@ -1886,7 +1897,7 @@ Renders given template using [lodash template](https://lodash.com/docs/4.17.15#t
#### Type
```ts
function addTypeTemplate (template: NuxtTypeTemplate | string): NuxtTemplate
function addTypeTemplate (template: NuxtTypeTemplate | string): ResolvedNuxtTemplate
interface NuxtTemplate {
src?: string
@ -1895,6 +1906,17 @@ interface NuxtTemplate {
options?: Record<string, any>
getContents?: (data: Record<string, any>) => string | Promise<string>
}
interface ResolvedNuxtTemplate {
src: string
filename: string
dst: string
options: Record<string, any>
getContents: (data: Record<string, any>) => string | Promise<string>
write: boolean
filename: string
dst: string
}
```