export type UseScriptStatus = 'idle' | 'loading' | 'ready' | 'error'; export type UseScriptAttributes = { [key in keyof HTMLScriptElement | string]: string; }; /** Configuration options for the script loading behavior. */ export type UseScriptConfig = { /** Whether the script should be loaded as an ES6 module. */ module?: boolean; /** Flag to bypass the cache by appending a timestamp to the script URL. */ cache?: boolean; /** Additional HTML attributes to set on the script element. */ attrs?: UseScriptAttributes; /** Whether to enable or disable script injection. */ enabled?: boolean; }; /** Represents the state of a script element. */ export type UseScriptItem = { /** The source URL of the script. */ src: string; /** The current status of the script ('idle', 'loading', 'ready', 'error'). */ status: UseScriptStatus; }; /** * Custom hook to load external scripts and monitor their statuses. * * @param {string | string[]} sources - The source URL(s) of the script(s) to load. * @param {UseScriptConfig} config - Optional configuration options. * @returns {UseScriptStatus | UseScriptStatus[]} The status of the loaded script(s). */ export declare function useScript(sources: T, config?: UseScriptConfig): T extends string ? UseScriptStatus : UseScriptStatus[]; //# sourceMappingURL=useScript.d.ts.map