dynamicCSS.d.ts 887 B

12345678910111213141516171819202122232425
  1. export type ContainerType = Element | ShadowRoot;
  2. export type Prepend = boolean | 'queue';
  3. export type AppendType = 'prependQueue' | 'append' | 'prepend';
  4. interface 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. }
  18. export declare function injectCSS(css: string, option?: Options): HTMLStyleElement;
  19. export declare function removeCSS(key: string, option?: Options): void;
  20. /**
  21. * manually clear container cache to avoid global cache in unit testes
  22. */
  23. export declare function clearContainerCache(): void;
  24. export declare function updateCSS(css: string, key: string, originOption?: Options): HTMLElement;
  25. export {};