UNPKG

mount-script

Version:
25 lines (20 loc) 776 B
export declare interface HTMLScriptElementEX extends HTMLScriptElement { onreadystatechange?: any; readyState?: 'loaded' | 'complete'; } export declare interface JsOptions { attrs?: ScriptAttributes; props?: ScriptAttributes; force?: boolean; } /** * Dynamic loading of js linked resources * * @param src - resource address * @param option - parameters: attrs, props, force * @returns - result */ declare function mountScript(src: string, option?: JsOptions): Promise<boolean>; export default mountScript; export declare type ScriptAttributes = Pick<HTMLScriptElement, 'async' | 'charset' | 'crossOrigin' | 'defer' | 'event' | 'htmlFor' | 'integrity' | 'noModule' | 'referrerPolicy' | 'src' | 'text' | 'type'>; export { }