import * as solid_js from 'solid-js'; import { MaybeAccessor } from '@solidjs-use/shared'; import { ConfigurableDocument } from '../_configurable.js'; interface UseScriptTagOptions extends ConfigurableDocument { /** * Load the script immediately * * @default true */ immediate?: boolean; /** * Add `async` attribute to the script tag * * @default true */ async?: boolean; /** * Script type * * @default 'text/javascript' */ type?: string; /** * Manual controls the timing of loading and unloading * * @default false */ manual?: boolean; crossOrigin?: 'anonymous' | 'use-credentials'; referrerPolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; noModule?: boolean; /** * script attribute */ defer?: boolean; /** * Add custom attribute to the script tag * */ attrs?: Record; } /** * Async script tag loading. * * @see https://solidjs-use.github.io/solidjs-use/core/useScriptTag */ declare function useScriptTag(src: MaybeAccessor, onLoaded?: (el: HTMLScriptElement) => void, options?: UseScriptTagOptions): { scriptTag: solid_js.Accessor; load: (waitForScriptLoad?: boolean) => Promise; unload: () => void; }; type UseScriptTagReturn = ReturnType; export { UseScriptTagOptions, UseScriptTagReturn, useScriptTag };