Skip to content

Commit 601bb4b

Browse files
committed
fix(types): extend core email type
1 parent 1e771ef commit 601bb4b

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

playground/nuxt.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ export default defineNuxtConfig({
1111
tagline: 'This is a sample tagline for the pages module.',
1212
},
1313

14+
// Email
15+
email: {
16+
general: '[email protected]',
17+
support: '[email protected]',
18+
},
19+
1420
// Navigation
1521
navigation: {
1622
primary: [

src/types.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
import type { ModuleOptions as CoreModuleOptions } from '@nuxtify/core'
22

3+
// Extend core types
4+
type CoreEmailOptions = NonNullable<CoreModuleOptions['email']>
5+
interface Email extends CoreEmailOptions {
6+
provider?: {
7+
defaultSubmitUrl?: string
8+
}
9+
}
10+
11+
// Link types
312
interface Link {
413
text: string
514
to?: string
615
href?: string
716
icon?: string
817
openInNew?: boolean
918
}
10-
1119
interface FooterLinks {
1220
title: string
1321
links: Link[]
1422
}
1523

24+
// Page interface
1625
interface PageModuleOptions {
1726
/**
1827
* Navigation options
@@ -40,11 +49,7 @@ interface PageModuleOptions {
4049
/**
4150
* Email options
4251
*/
43-
email?: {
44-
provider?: {
45-
defaultSubmitUrl?: string
46-
}
47-
}
52+
email?: Email
4853

4954
/**
5055
* Style options

0 commit comments

Comments
 (0)