import { ScriptInstance, UseScriptStatus, UseScriptOptions as UseScriptOptions$1, UseFunctionType, ScriptScope, UseScriptLoaderInput, UseScriptContextOptions } from 'unhead/scripts'; export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptContextOptions, UseScriptLoader, UseScriptLoaderInput, UseScriptResolvedInput, UseScriptResolver, UseScriptStatus, UseScriptTrigger, WarmupStrategy, createSpyProxy } from 'unhead/scripts'; import { GenericScript, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types'; import { Ref } from 'vue'; import { VueHeadClient } from './client.mjs'; import { ResolvableProperties } from './index.mjs'; interface VueScriptInstance> extends Omit, 'status'> { status: Ref; } interface VueScriptScope> extends Omit, 'status'> { status: Ref; } type VueScriptSrcInput = string | (ResolvableProperties> & { src: string; }); type UseScriptInput = VueScriptSrcInput; interface UseScriptOptions = Record> extends Omit, Partial, 'use' | 'resolve' | 'eventContext' | 'beforeInit' | 'scope'>> { /** * The trigger to load the script: * - `undefined` | `client` - (Default) Load the script on the client when this js is loaded. * - `manual` - Load the script manually by calling `$script.load()`, exists only on the client. * - `Promise` - Load the script when the promise resolves, exists only on the client. * - `Function` - Register a callback function to load the script, exists only on the client. * - `server` - Have the script injected on the server. * - `Ref` - Load the script when the ref becomes true. * - `() => boolean` - Getter function, load the script when return value becomes true. */ trigger?: UseScriptOptions$1['trigger'] | Ref | (() => boolean); /** * Unhead instance. */ head?: VueHeadClient; } type UseScriptLoaderOptions> = Omit, 'resolve' | 'use'> & { resolve?: never; use?: never; }; type UseScriptContext> = VueScriptInstance; type UseScriptReturn> = UseScriptContext, T>>; type UseScriptScopeReturn> = VueScriptScope, T>>; type ScriptApi = Record; type ResolveScriptOptions = Omit, 'resolve' | 'use'> & { resolve: (ctx: UseScriptContextOptions) => R; use?: never; }; type ResolvedScriptApi = Extract>, ScriptApi>; declare function useScript>(_input: UseScriptLoaderInput, _options: UseScriptLoaderOptions & { scope: true; }): VueScriptScope; declare function useScript>(_input: UseScriptLoaderInput, _options?: UseScriptLoaderOptions & { scope?: false; }): VueScriptInstance; declare function useScript>(_input: UseScriptLoaderInput, _options?: UseScriptLoaderOptions): VueScriptInstance | VueScriptScope; declare function useScript(_input: UseScriptInput, _options: ResolveScriptOptions & { scope: true; }): VueScriptScope>; declare function useScript(_input: UseScriptInput, _options: ResolveScriptOptions & { scope?: false; }): VueScriptInstance>; declare function useScript(_input: UseScriptInput, _options: ResolveScriptOptions): VueScriptInstance> | VueScriptScope>; declare function useScript = Record>(_input: UseScriptInput, _options: UseScriptOptions & { scope: true; }): UseScriptScopeReturn; declare function useScript = Record>(_input: UseScriptInput, _options?: UseScriptOptions & { scope?: false; }): UseScriptReturn; declare function useScript = Record>(_input: UseScriptInput, _options?: UseScriptOptions): UseScriptReturn | UseScriptScopeReturn; export { useScript }; export type { UseScriptContext, UseScriptInput, UseScriptLoaderOptions, UseScriptOptions, UseScriptReturn, UseScriptScopeReturn, VueScriptInstance, VueScriptScope };