import * as React from 'react'; export { getWindow, getNodeScroll, isHTMLElement, isElement, getParentNode, } from '@vkontakte/vkui-floating-ui/utils/dom'; export { canUseDOM, canUseEventListeners, onDOMLoaded } from '@vkontakte/vkjs'; export interface DOMContextInterface { /** * @ignore */ window?: Window; /** * @ignore */ document?: Document; } export type DOMProps = DOMContextInterface; export declare const DOMContext: React.Context; export declare const useDOM: () => DOMContextInterface; /** * В случае, если используется DOMContext, при проверке 'node instanceOf Window' – Window может быть * другим объектом. */ export declare const isWindow: (node: Element | Window | VisualViewport | undefined | null) => node is Window; export declare const isBody: (node: Element | Window | VisualViewport | undefined | null) => node is HTMLBodyElement; export declare const isDocumentElement: (node: Element | Window | VisualViewport | undefined | null) => node is HTMLHtmlElement; export declare function withDOM(Component: React.ComponentType): React.ComponentType; export declare function blurActiveElement(document: Document | undefined): void; export declare const TRANSFORM_DEFAULT_VALUES: string[]; export declare const WILL_CHANGE_DEFAULT_VALUES: string[]; export declare function getTransformedParentCoords(element: Element): { x: number; y: number; }; export declare const getBoundingClientRect: (node: Element | Window, isFixedStrategy?: boolean) => DOMRect; export declare const getRelativeBoundingClientRect: (parent: Element, child: Element) => DOMRect; /** * Переписанный `getNearestOverflowAncestor` из @floating-ui/utils/dom. * * [1] добавляем ноду, на которой нужно остановить рекурсию * [2] document.body подменяем на window, т.к. на document.body нельзя применить скролл. * * @link https://github.com/floating-ui/floating-ui/blob/%40floating-ui/dom%401.6.3/packages/utils/src/dom.ts#L143 */ export declare function getNearestOverflowAncestor(node: Node): HTMLElement | Window | null; export declare function getNearestOverflowAncestor(node: Node, terminalNode: Node): HTMLElement | null; export declare const getScrollHeight: (node: Element | Window) => number; export declare const getScrollRect: (node: Element | Window) => { relative: DOMRect; edges: { y: [number, number]; }; }; export declare const getDocumentBody: (node?: any) => HTMLElement; export declare const getActiveElementByAnotherElement: (el: Element | null) => Element | null; export declare const contains: (parent?: Element | null, child?: Element | null) => boolean; export declare const getFirstTouchEventData: (event: UIEvent | React.UIEvent) => { screenX: number; screenY: number; clientX: number; clientY: number; pageX: number; pageY: number; }; /** * ⚠️ В частности, необходимо для iOS 15. Начиная с этой версии в Safari добавили * pull-to-refresh. CSS св-во `overflow-behavior` появился только с iOS 16. * * Во вторую очередь, полезна блокированием скролла, чтобы пользователь дождался обновления * данных. */ export declare const initializeBrowserGesturePreventionEffect: (window: Window) => VoidFunction; export declare const isHTMLContentEditableElement: (el: Element | null) => el is HTMLInputElement | HTMLTextAreaElement | HTMLElement; export type VisualViewport = { offsetTop: number; offsetLeft: number; width: number; height: number; }; /** * Фоллбек `visualViewport` для **Safari 12**. */ export declare function getVisualViewport(win: Window): VisualViewport; export declare const hasSelectionWithRangeType: (node: unknown) => boolean; export declare function isSVGElement(value: unknown): value is SVGElement; //# sourceMappingURL=dom.d.ts.map