@mornya/dynamic-load-libs
Version:
The project of Dynamic Loadable script and style library.
26 lines (25 loc) • 1.01 kB
TypeScript
type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
type PreloadAs = 'audio' | 'document' | 'embed' | 'fetch' | 'font' | 'image' | 'object' | 'script' | 'style' | 'track' | 'video' | 'worker';
type Attributes = {
id: string;
src?: string;
text?: string;
type?: string;
crossOrigin?: null | '' | 'anonymous' | 'use-credentials';
integrity?: string;
referrerPolicy?: ReferrerPolicy;
nonce?: string;
isReload?: boolean;
};
export interface IScriptAttributes extends Attributes {
noModule?: boolean;
}
export interface IStyleAttributes extends Attributes {
media?: string;
isAlternate?: boolean;
imageSizes?: string;
preloadAs?: PreloadAs;
}
export declare function script(attributes: IScriptAttributes): Promise<boolean>;
export declare function style(attributes: IStyleAttributes): Promise<boolean>;
export {};