import React from 'react'; import { VirtualElement } from './popoverInstance'; export interface GetBoundingClientRect { (dom: HTMLElement): Promise; } export interface Client { innerHeight: number; innerWidth: number; } export interface GetClient { (): Client; } export interface GetElementsByClassName { (dom: Element, className: string): HTMLCollectionOf; } export interface GetBody { (): HTMLElement; } export interface AppendChild { (parentNode: Node, childNode: Node): void; } export interface RemoveChild { (parentNode: Node, childNode: Node): void; } export interface RenderRoot { (child: React.ReactNode, container: HTMLElement): void; } export interface GetClientFromMouseEvent { (e: React.MouseEvent): { clientX: number; clientY: number; }; } export declare type Platform = 'web' | 'weapp'; interface CompatibleRegister { getBoundingClientRect: GetBoundingClientRect; getClient: GetClient; getElementsByClassName: GetElementsByClassName; getBody: GetBody; appendChild: AppendChild; removeChild: RemoveChild; renderRoot: RenderRoot; getClientFromMouseEvent: GetClientFromMouseEvent; } declare class Compatible implements CompatibleRegister { private platform; getBoundingClientRect(dom: HTMLElement | VirtualElement): Promise; getElementsByClassName(dom: Element, className: string): HTMLCollectionOf; getClient(): { innerHeight: number; innerWidth: number; }; getBody(): HTMLElement; appendChild(parentNode: Node, childNode: Node): void; removeChild(parentNode: Node, childNode: Node): void; renderRoot(child: React.ReactNode, container: HTMLElement): void; getClientFromMouseEvent(e: React.MouseEvent): { clientX: number; clientY: number; }; register(key: K, fn: V): void; setPlatform(platform: Platform): void; getPlatform(): Platform; } declare const compatible: Compatible; export default compatible;