import { execScripts } from 'import-html-entry';
import { isFunction } from 'lodash';
import { checkActivityFunctions } from 'single-spa';
import { Freer } from '../interfaces';
const styledComponentSymbol = Symbol('styled-component');
declare global {
interface HTMLStyleElement {
[styledComponentSymbol]?: CSSRuleList;
}
}
const rawHtmlAppendChild = HTMLHeadElement.prototype.appendChild;
const SCRIPT_TAG_NAME = 'SCRIPT';
const LINK_TAG_NAME = 'LINK';
const STYLE_TAG_NAME = 'STYLE';
/**
* Check if a style element is a styled-component liked.
* A styled-components liked element is which not have textContext but keep the rules in its styleSheet.cssRules.
* Such as the style element generated by styled-components and emotion.
* @param element
*/
function isStyledComponentsLike(element: HTMLStyleElement) {
return !element.textContent