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 - } -}