Skip to content

Commit

Permalink
fix: remove Nuxt module augmentations (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin authored Sep 2, 2024
1 parent 6dab2ea commit abbfd44
Showing 1 changed file with 24 additions and 55 deletions.
79 changes: 24 additions & 55 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,33 @@ import { configureNuxt } from './utils/configure-nuxt'

export * from './types'

export interface ModuleOptions extends VuetifyModuleOptions {}

export interface ModuleHooks {
'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult
}

export interface ModuleRuntimeHooks {
'vuetify:configuration': (options: {
isDev: boolean
vuetifyOptions: VuetifyOptions
}) => HookResult
'vuetify:before-create': (options: {
isDev: boolean
vuetifyOptions: VuetifyOptions
}) => HookResult
'vuetify:ready': (vuetify: ReturnType<typeof createVuetify>) => HookResult
'vuetify:ssr-client-hints': (options: {
vuetifyOptions: VuetifyOptions
ssrClientHints: SSRClientHints
ssrClientHintsConfiguration: SSRClientHintsConfiguration
}) => HookResult
}

const CONFIG_KEY = 'vuetify'
const logger = useLogger(`nuxt:${CONFIG_KEY}`)

export default defineNuxtModule<VuetifyModuleOptions>({
export default defineNuxtModule<ModuleOptions>({
meta: {
name: 'vuetify-nuxt-module',
configKey: 'vuetify',
Expand Down Expand Up @@ -97,57 +120,3 @@ export default defineNuxtModule<VuetifyModuleOptions>({
configureVite(CONFIG_KEY, nuxt, ctx)
},
})

export interface ModuleOptions extends VuetifyModuleOptions {}

export interface ModuleHooks {
'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult
}

export interface ModuleRuntimeHooks {
'vuetify:configuration': (options: {
isDev: boolean
vuetifyOptions: VuetifyOptions
}) => HookResult
'vuetify:before-create': (options: {
isDev: boolean
vuetifyOptions: VuetifyOptions
}) => HookResult
'vuetify:ready': (vuetify: ReturnType<typeof createVuetify>) => HookResult
'vuetify:ssr-client-hints': (options: {
vuetifyOptions: VuetifyOptions
ssrClientHints: SSRClientHints
ssrClientHintsConfiguration: SSRClientHintsConfiguration
}) => HookResult
}

declare module '#app' {
interface ModuleRuntimeHooks {
'vuetify:configuration': (options: {
isDev: boolean
vuetifyOptions: VuetifyOptions
}) => HookResult
'vuetify:before-create': (options: {
isDev: boolean
vuetifyOptions: VuetifyOptions
}) => HookResult
'vuetify:ready': (vuetify: ReturnType<typeof createVuetify>) => HookResult
'vuetify:ssr-client-hints': (options: {
vuetifyOptions: VuetifyOptions
ssrClientHints: SSRClientHints
ssrClientHintsConfiguration: SSRClientHintsConfiguration
}) => HookResult
}
}

declare module '@nuxt/schema' {
interface NuxtConfig {
['vuetify']?: Partial<ModuleOptions>
}
interface NuxtOptions {
['vuetify']?: ModuleOptions
}
interface NuxtHooks {
'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult
}
}

0 comments on commit abbfd44

Please sign in to comment.