hmr-util.d.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. export declare const getHmrHref: (versionId: string, fileName: string, testUrl: string) => string;
  2. export declare const setQueryString: (url: string, qsKey: string, qsValue: string) => string;
  3. export declare const setHmrQueryString: (url: string, versionId: string) => string;
  4. export declare const updateCssUrlValue: (versionId: string, fileName: string, oldCss: string) => string;
  5. /**
  6. * Determine whether a given element is a `<link>` tag pointing to a stylesheet
  7. *
  8. * @param elm the element to check
  9. * @returns whether or not the element is a link stylesheet
  10. */
  11. export declare const isLinkStylesheet: (elm: Element) => boolean;
  12. /**
  13. * Determine whether or not a given element is a template element
  14. *
  15. * @param elm the element to check
  16. * @returns whether or not the element of interest is a template element
  17. */
  18. export declare const isTemplate: (elm: Element) => boolean;
  19. /**
  20. * Set a new hmr version ID into the `data-hmr` attribute on an element.
  21. *
  22. * @param elm the element on which to set the property
  23. * @param versionId a new HMR version id
  24. */
  25. export declare const setHmrAttr: (elm: Element, versionId: string) => void;
  26. /**
  27. * Determine whether or not an element has a shadow root
  28. *
  29. * @param elm the element to check
  30. * @returns whether or not it has a shadow root
  31. */
  32. export declare const hasShadowRoot: (elm: Element) => boolean;
  33. /**
  34. * Determine whether or not an element is an element node
  35. *
  36. * @param elm the element to check
  37. * @returns whether or not it is an element node
  38. */
  39. export declare const isElement: (elm: Element) => boolean;