Skip to content

Commit 3f79fb5

Browse files
authored
fix: typecheck error (#429)
1 parent 01f93e4 commit 3f79fb5

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/runtime/types.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import type {
2-
ActiveHeadEntry,
3-
AsAsyncFunctionValues,
42
DataKeys,
53
SchemaAugmentations,
6-
ScriptBase,
7-
} from '@unhead/schema'
4+
ScriptWithoutEvents,
5+
} from 'unhead/types'
86
import type { UseScriptInput, VueScriptInstance, UseScriptOptions } from '@unhead/vue'
97
import type { ComputedRef, Ref } from 'vue'
108
import type { InferInput, ObjectSchema } from 'valibot'
@@ -35,17 +33,7 @@ import { object } from '#nuxt-scripts-validator'
3533

3634
export type WarmupStrategy = false | 'preload' | 'preconnect' | 'dns-prefetch'
3735

38-
export type UseScriptContext<T extends Record<symbol | string, any>> =
39-
(Promise<T> & VueScriptInstance<T>)
40-
& AsAsyncFunctionValues<T>
41-
& {
42-
/**
43-
* @deprecated Use top-level functions instead.
44-
*/
45-
$script: Promise<T> & VueScriptInstance<T>
46-
warmup: (rel: WarmupStrategy) => void
47-
_warmupEl?: void | ActiveHeadEntry<any>
48-
}
36+
export type UseScriptContext<T extends Record<symbol | string, any>> = VueScriptInstance<T>
4937

5038
export type NuxtUseScriptOptions<T extends Record<symbol | string, any> = {}> = Omit<UseScriptOptions<T>, 'trigger'> & {
5139
/**
@@ -176,7 +164,7 @@ const _emptyOptions = object({})
176164

177165
export type EmptyOptionsSchema = typeof _emptyOptions
178166

179-
type ScriptInput = ScriptBase & DataKeys & SchemaAugmentations['script']
167+
type ScriptInput = ScriptWithoutEvents & DataKeys & SchemaAugmentations['script']
180168

181169
export type InferIfSchema<T> = T extends ObjectSchema<any, any> ? InferInput<T> : T
182170
export type RegistryScriptInput<

0 commit comments

Comments
 (0)