interface ShadyCSSInterface {
  nativeShadow: boolean;
  ApplyShim?: unknown;
  ScopingShim?: {
    prepareAdoptedCssText(cssTextArray: string[], name: string): void;
  };
  prepareTemplateDom(template: HTMLTemplateElement, name: string): void;
  prepareTemplateStyles(template: HTMLTemplateElement, name: string): void;
  styleElement(element: Element): void;
  styleSubtree(element: Element): void;
  getComputedStyleValue(element: Element, property: string): string;
}

interface ShadyDOMInterface {
  inUse: boolean;
  noPatch?: boolean;
  flush?: () => void;
  patchElementProto(proto: object): void;
  wrap<T extends Node>(node: T): T;
}

interface Window {
  ShadyCSS?: ShadyCSSInterface;
  ShadyDOM?: ShadyDOMInterface;
}

declare var ShadyCSS: ShadyCSSInterface | undefined;
declare var ShadyDOM: ShadyDOMInterface | undefined;
