|
1 | 1 | import type {
|
2 |
| - ActiveHeadEntry, |
3 |
| - AsAsyncFunctionValues, |
4 | 2 | DataKeys,
|
5 | 3 | SchemaAugmentations,
|
6 |
| - ScriptBase, |
7 |
| -} from '@unhead/schema' |
| 4 | + ScriptWithoutEvents, |
| 5 | +} from 'unhead/types' |
8 | 6 | import type { UseScriptInput, VueScriptInstance, UseScriptOptions } from '@unhead/vue'
|
9 | 7 | import type { ComputedRef, Ref } from 'vue'
|
10 | 8 | import type { InferInput, ObjectSchema } from 'valibot'
|
@@ -35,17 +33,7 @@ import { object } from '#nuxt-scripts-validator'
|
35 | 33 |
|
36 | 34 | export type WarmupStrategy = false | 'preload' | 'preconnect' | 'dns-prefetch'
|
37 | 35 |
|
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> |
49 | 37 |
|
50 | 38 | export type NuxtUseScriptOptions<T extends Record<symbol | string, any> = {}> = Omit<UseScriptOptions<T>, 'trigger'> & {
|
51 | 39 | /**
|
@@ -176,7 +164,7 @@ const _emptyOptions = object({})
|
176 | 164 |
|
177 | 165 | export type EmptyOptionsSchema = typeof _emptyOptions
|
178 | 166 |
|
179 |
| -type ScriptInput = ScriptBase & DataKeys & SchemaAugmentations['script'] |
| 167 | +type ScriptInput = ScriptWithoutEvents & DataKeys & SchemaAugmentations['script'] |
180 | 168 |
|
181 | 169 | export type InferIfSchema<T> = T extends ObjectSchema<any, any> ? InferInput<T> : T
|
182 | 170 | export type RegistryScriptInput<
|
|
0 commit comments