UNPKG

ngx-script-optimizer

Version:

**A lightweight Angular library designed to supercharge your third-party script handling.**

31 lines (30 loc) 1.68 kB
import { EventEmitter, Injector, OnDestroy, OnInit } from '@angular/core'; import * as i0 from "@angular/core"; type ScriptLoadingStrategy = 'eager' | 'lazy' | 'idle' | 'worker'; type ScriptAppendStrategy = 'body' | 'head'; type ScriptRenderStrategy = 'server' | 'client'; export declare class ScriptOptimizerComponent implements OnInit, OnDestroy { private document; private platformId; private injector; constructor(document: Document, platformId: any, injector: Injector); src?: string; scriptContent?: any; appendTo: ScriptAppendStrategy; loadStrategy: ScriptLoadingStrategy; renderStrategy: ScriptRenderStrategy; contentType: string; integrity?: string | any; origin?: string | any; onLoad: EventEmitter<void>; private worker?; private scriptElem; ngOnInit(): void; private addScriptToHead; private createAndExecuteWorker; private appendScripts; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ScriptOptimizerComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<ScriptOptimizerComponent, "ngx-script-optimizer", never, { "src": { "alias": "src"; "required": false; }; "scriptContent": { "alias": "scriptContent"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "loadStrategy": { "alias": "loadStrategy"; "required": false; }; "renderStrategy": { "alias": "renderStrategy"; "required": false; }; "contentType": { "alias": "contentType"; "required": false; }; "integrity": { "alias": "integrity"; "required": false; }; "origin": { "alias": "origin"; "required": false; }; }, { "onLoad": "onLoad"; }, never, never, true, never>; } export {};