UNPKG

887 BTypeScriptView Raw
1export type ContainerType = Element | ShadowRoot;
2export type Prepend = boolean | 'queue';
3export type AppendType = 'prependQueue' | 'append' | 'prepend';
4interface Options {
5 attachTo?: ContainerType;
6 csp?: {
7 nonce?: string;
8 };
9 prepend?: Prepend;
10 /**
11 * Config the `priority` of `prependQueue`. Default is `0`.
12 * It's useful if you need to insert style before other style.
13 */
14 priority?: number;
15 mark?: string;
16 styles?: HTMLElement[];
17}
18export declare function injectCSS(css: string, option?: Options): HTMLStyleElement;
19export declare function removeCSS(key: string, option?: Options): void;
20/**
21 * manually clear container cache to avoid global cache in unit testes
22 */
23export declare function clearContainerCache(): void;
24export declare function updateCSS(css: string, key: string, originOption?: Options): HTMLElement;
25export {};