From abbfd444aa7a563a9124f6dd4da777001daf344d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Mon, 2 Sep 2024 22:59:06 +0200 Subject: [PATCH] fix: remove Nuxt module augmentations (#272) --- src/module.ts | 79 ++++++++++++++++----------------------------------- 1 file changed, 24 insertions(+), 55 deletions(-) diff --git a/src/module.ts b/src/module.ts index b40060f..266fee5 100644 --- a/src/module.ts +++ b/src/module.ts @@ -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) => 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({ +export default defineNuxtModule({ meta: { name: 'vuetify-nuxt-module', configKey: 'vuetify', @@ -97,57 +120,3 @@ export default defineNuxtModule({ 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) => 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) => HookResult - 'vuetify:ssr-client-hints': (options: { - vuetifyOptions: VuetifyOptions - ssrClientHints: SSRClientHints - ssrClientHintsConfiguration: SSRClientHintsConfiguration - }) => HookResult - } -} - -declare module '@nuxt/schema' { - interface NuxtConfig { - ['vuetify']?: Partial - } - interface NuxtOptions { - ['vuetify']?: ModuleOptions - } - interface NuxtHooks { - 'vuetify:registerModule': (registerModule: (config: InlineModuleOptions) => void) => HookResult - } -}