UNPKG

710 BTypeScriptView Raw
1interface ShadyCSS {
2 styleElement(host: Element, overrideProps?: {[key: string]: string}): void;
3 getComputedStyleValue(element: Element, property: string): string;
4 ScopingShim: {prepareAdoptedCssText(cssText: string[], name: string): void;};
5 nativeShadow: boolean;
6}
7
8interface ShadyDOM {
9 inUse: boolean;
10}
11
12interface Window {
13 ShadyCSS?: ShadyCSS;
14 ShadyDOM?: ShadyDOM;
15 ShadowRoot: typeof ShadowRoot;
16}
17
18// Augment existing types with styling API
19interface ShadowRoot {
20 adoptedStyleSheets: CSSStyleSheet[];
21}
22
23declare var ShadowRoot: {prototype: ShadowRoot; new () : ShadowRoot;}
24
25interface CSSStyleSheet {
26 replaceSync(cssText: string): void;
27 replace(cssText: string): Promise<unknown>;
28}