36 lines
1.9 KiB
TypeScript
36 lines
1.9 KiB
TypeScript
export declare const rawHeadAppendChild: <T extends Node>(node: T) => T;
|
|
export declare const styleElementTargetSymbol: unique symbol;
|
|
declare type DynamicDomMutationTarget = 'head' | 'body';
|
|
declare global {
|
|
interface HTMLLinkElement {
|
|
[styleElementTargetSymbol]: DynamicDomMutationTarget;
|
|
}
|
|
interface HTMLStyleElement {
|
|
[styleElementTargetSymbol]: DynamicDomMutationTarget;
|
|
}
|
|
}
|
|
export declare const getAppWrapperHeadElement: (appWrapper: Element | ShadowRoot) => Element;
|
|
export declare function isExecutableScriptType(script: HTMLScriptElement): boolean;
|
|
export declare function isHijackingTag(tagName?: string): boolean;
|
|
/**
|
|
* 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
|
|
*/
|
|
export declare function isStyledComponentsLike(element: HTMLStyleElement): number | false | undefined;
|
|
export declare function recordStyledComponentsCSSRules(styleElements: HTMLStyleElement[]): void;
|
|
export declare function getStyledElementCSSRules(styledElement: HTMLStyleElement): CSSRuleList | undefined;
|
|
export declare type ContainerConfig = {
|
|
appName: string;
|
|
proxy: WindowProxy;
|
|
strictGlobal: boolean;
|
|
dynamicStyleSheetElements: Array<HTMLStyleElement | HTMLLinkElement>;
|
|
appWrapperGetter: CallableFunction;
|
|
scopedCSS: boolean;
|
|
excludeAssetFilter?: CallableFunction;
|
|
};
|
|
export declare function patchHTMLDynamicAppendPrototypeFunctions(isInvokedByMicroApp: (element: HTMLElement) => boolean, containerConfigGetter: (element: HTMLElement) => ContainerConfig): () => void;
|
|
export declare function rebuildCSSRules(styleSheetElements: HTMLStyleElement[], reAppendElement: (stylesheetElement: HTMLStyleElement) => boolean): void;
|
|
export {};
|