@@ -4,7 +4,7 @@ import type { $Fetch } from 'nitropack'
44import type { ClientFunctions , ServerFunctions } from '../../src/rpc-types'
55import { onDevtoolsClientConnected } from '@nuxt/devtools-kit/iframe-client'
66import { ref , watchEffect } from 'vue'
7- import { globalRefreshTime , path , query , refreshSources } from '~ /util/logic'
7+ import { globalRefreshTime , path , query , refreshSources } from '.. /util/logic'
88
99export const appFetch = ref < $Fetch > ( )
1010
@@ -17,23 +17,26 @@ export const colorMode = ref<'dark' | 'light'>('dark')
1717export const ogImageRpc = ref < BirpcReturn < ServerFunctions > > ( )
1818
1919onDevtoolsClientConnected ( async ( client ) => {
20+ // @ts -expect-error untyped
2021 appFetch . value = client . host . app . $fetch
2122 watchEffect ( ( ) => {
2223 colorMode . value = client . host . app . colorMode . value
2324 } )
2425 const $route = client . host . nuxt . vueApp . config . globalProperties ?. $route
2526 query . value = $route . query
2627 path . value = $route . path || '/'
27- client . host . nuxt . $router . afterEach ( ( route ) => {
28+ client . host . nuxt . $router . afterEach ( ( route : any ) => {
2829 query . value = route . query
2930 path . value = route . path
3031 refreshSources ( )
3132 } )
3233 devtools . value = client . devtools
3334 devtoolsClient . value = client
35+ // @ts -expect-error untyped
3436 ogImageRpc . value = client . devtools . extendClientRpc < ServerFunctions , ClientFunctions > ( 'nuxt-og-image' , {
3537 refreshRouteData ( path ) {
3638 // if path matches
39+ // @ts -expect-error untyped
3740 if ( devtoolsClient . value ?. host . nuxt . vueApp . config ?. globalProperties ?. $route . matched [ 0 ] . components ?. default . __file . includes ( path ) || path . endsWith ( '.md' ) )
3841 refreshSources ( )
3942 } ,
0 commit comments