Skip to content

Commit b8289cd

Browse files
committed
fix: typescript errors in nuxt3 module
1 parent 7a918d1 commit b8289cd

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

nuxt/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { defineNuxtModule, addPlugin, createResolver } from '@nuxt/kit'
2-
import type { IVWavePluginOptions } from '../src/options'
1+
import { addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit'
2+
import { DEFAULT_PLUGIN_OPTIONS, type IVWavePluginOptions } from '../src/options'
33

44
type ModuleOptions = Partial<IVWavePluginOptions>
55

@@ -9,17 +9,17 @@ export default defineNuxtModule<ModuleOptions>({
99
configKey: 'vWave',
1010
compatibility: {
1111
nuxt: '>=3.0.0',
12-
bridge: true
13-
}
12+
bridge: true,
13+
},
1414
},
1515
defaults: {
16-
directive: "wave"
16+
...DEFAULT_PLUGIN_OPTIONS,
1717
},
1818
setup(options, nuxt) {
1919
const { resolve } = createResolver(import.meta.url)
2020

21-
nuxt.options.runtimeConfig.public.vWave = options
21+
nuxt.options.runtimeConfig.public.vWave = options as unknown as typeof nuxt.options.runtimeConfig.public.vWave
2222

2323
addPlugin(resolve('./runtime/plugin.ts'))
24-
}
24+
},
2525
})

nuxt/runtime/plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export default defineNuxtPlugin((app) => {
1010
...vWave,
1111
getSSRProps() {
1212
return {}
13-
}
13+
},
1414
})
1515

1616
app.vueApp.directive(`${options.directive}-trigger`, {
1717
...vWaveTrigger,
1818
getSSRProps() {
1919
return {}
20-
}
20+
},
2121
})
2222
})

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"module": "dist/index.js",
1010
"types": "dist/index.d.ts",
1111
"unpkg": "dist/index.global.js",
12-
"files": ["dist/**/*", "nuxt/**/*"],
12+
"files": ["dist/**/*", "nuxt/**/*", "src/options.ts"],
1313
"exports": {
1414
"./nuxt": {
1515
"import": "./nuxt/index.ts",

0 commit comments

Comments
 (0)