@lxlib/util
Version:
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.
23 lines (22 loc) • 625 B
TypeScript
import { Observable } from 'rxjs';
export interface LazyResult {
path: string;
loaded: boolean;
status: 'ok' | 'error';
error?: {};
}
/**
* 延迟加载资源(js 或 css)服务
*/
export declare class LazyService {
private doc;
private list;
private cached;
private _notify;
constructor(doc: any);
get change(): Observable<LazyResult[]>;
clear(): void;
load(paths: string | string[]): Promise<LazyResult[]>;
loadScript(path: string, innerContent?: string): Promise<LazyResult>;
loadStyle(path: string, rel?: string, innerContent?: string): Promise<LazyResult>;
}