Skip to content

Commit

Permalink
fix: explicitly add imported kitsu types to plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickcate committed Sep 23, 2023
1 parent 5149e72 commit 1b809d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -10,7 +11,9 @@ export default defineNuxtPlugin(nuxtApp => {

return {
provide: {
jsonApi,
jsonApi: <KitsuTypes>jsonApi,
},
}
})

export default plugin

0 comments on commit 1b809d9

Please sign in to comment.