dynamicCSS.d.ts 758 B

1234567891011121314151617181920
  1. export declare function canUseDom(): boolean;
  2. export declare type ContainerType = Element | ShadowRoot;
  3. export declare type Prepend = boolean | 'queue';
  4. export declare type AppendType = 'prependQueue' | 'append' | 'prepend';
  5. interface Options {
  6. attachTo?: ContainerType;
  7. csp?: {
  8. nonce?: string;
  9. };
  10. prepend?: Prepend;
  11. mark?: string;
  12. }
  13. export declare function injectCSS(css: string, option?: Options): HTMLStyleElement;
  14. export declare function removeCSS(key: string, option?: Options): void;
  15. /**
  16. * manually clear container cache to avoid global cache in unit testes
  17. */
  18. export declare function clearContainerCache(): void;
  19. export declare function updateCSS(css: string, key: string, option?: Options): HTMLStyleElement;
  20. export {};