From 1b809d9b984573ff134f544f73095b9b8d6e561e Mon Sep 17 00:00:00 2001 From: Patrick Cate Date: Sat, 23 Sep 2023 09:32:13 -0400 Subject: [PATCH] fix: explicitly add imported kitsu types to plugin --- src/runtime/plugin.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/runtime/plugin.ts b/src/runtime/plugin.ts index 7fea4f3..2e40a6d 100644 --- a/src/runtime/plugin.ts +++ b/src/runtime/plugin.ts @@ -1,7 +1,8 @@ import Kitsu from 'kitsu' -import { defineNuxtPlugin, useRuntimeConfig } from '#app' +import type KitsuTypes from 'kitsu' +import { defineNuxtPlugin, useRuntimeConfig, Plugin } from '#app' -export default defineNuxtPlugin(nuxtApp => { +const plugin: Plugin<{ jsonApi: KitsuTypes }> = defineNuxtPlugin(nuxtApp => { const { jsonApi: options } = useRuntimeConfig().public const jsonApi = new Kitsu(options) @@ -10,7 +11,9 @@ export default defineNuxtPlugin(nuxtApp => { return { provide: { - jsonApi, + jsonApi: jsonApi, }, } }) + +export default plugin