File tree Expand file tree Collapse file tree 3 files changed +57
-8
lines changed Expand file tree Collapse file tree 3 files changed +57
-8
lines changed Original file line number Diff line number Diff line change 1+ import type { ImageConfiguration } from '../types'
2+
13export default defineAppConfig ( {
24 attributeContent : {
35 name : 'Nuxt Attribute Content (overwritten)' ,
6+ images : ( ) : ImageConfiguration => {
7+ const images = {
8+ formats : [
9+ {
10+ format : 'avif' ,
11+ quality : 70 ,
12+ } ,
13+ {
14+ format : 'webp' ,
15+ quality : 85 ,
16+ } ,
17+ ] ,
18+ }
19+ return images
20+ } ,
421 } ,
522} )
Original file line number Diff line number Diff line change 11export default defineAppConfig ( {
22 attributeContent : {
33 name : 'Nuxt Attribute Content' ,
4+ images : {
5+ formats : [
6+ {
7+ format : 'avif' ,
8+ quality : 60 ,
9+ } ,
10+ {
11+ format : 'webp' ,
12+ quality : 75 ,
13+ } ,
14+ ] ,
15+ } ,
416 } ,
517} )
6-
7- declare module '@nuxt/schema' {
8- interface AppConfigInput {
9- attributeContent ?: {
10- name ?: string
11- }
12- }
13- }
Original file line number Diff line number Diff line change 1+ export interface ImageFormat {
2+ format : string
3+ quality : number
4+ }
5+
6+ export interface ImageConfiguration {
7+ formats : ImageFormat [ ]
8+ }
9+
10+ export type ImageConfigValue = ImageConfiguration | ( ( ) => ImageConfiguration )
11+
12+ declare module '@nuxt/schema' {
13+ interface AppConfigInput {
14+ attributeContent ?: {
15+ name ?: string
16+ images ?: ImageConfigValue
17+ }
18+ }
19+ interface AppConfig {
20+ attributeContent : {
21+ name : string
22+ images : ImageConfiguration
23+ }
24+ }
25+ }
26+
27+ // It is always important to ensure you import/export something when augmenting a type
28+ export { }
You can’t perform that action at this time.
0 commit comments