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

fix: remove Nuxt module augmentations #272

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}