import type { TargetResolver } from "../types"; export declare function ownerWindow(element?: Node | null): (Window & typeof globalThis) | null; export declare function ownerDocument(element?: Node | null): Document | null; export declare function isHTMLElement(value: unknown, context?: Node | null): value is HTMLElement; export declare function isElement(value: unknown, context?: Node | null): value is Element; export declare function isNode(value: unknown, context?: Node | null): value is Node; /** * The layout viewport, in CSS pixels — the box every `position: fixed` tour * element is sized and positioned against, and the frame that * `getBoundingClientRect()` reports coordinates in. * * Deliberately not `innerWidth`/`innerHeight`: those measure the *visual* * viewport on some engines, which on mobile shrinks and grows with the * browser's URL bar and pinch zoom, and on desktop includes the classic * scrollbar. Either gap skews the overlay's `viewBox` against its own * `100%`-sized box, and the default `preserveAspectRatio` then scales and * centres the backdrop — leaving undimmed bands and a cutout that no longer * lines up with its target. */ export declare function viewportDimensions(context?: Node | null): { height: number; width: number; }; /** * The box the overlay `` is actually painted into, in CSS pixels. * * The overlay is `position: fixed` and sized to `100%`, and its `viewBox` has * to match that box exactly. Any mismatch makes the SVG scale its contents, and * `preserveAspectRatio` then either letterboxes the backdrop — the undimmed * bands mobile browsers show once a retracting URL bar moves the layout * viewport out of step with the initial containing block, which is what sizes * the element — or slices the cutout away from its target. * * Measuring the element sidesteps the question of which of the two each engine * resizes: whatever box it gave the overlay is the box the overlay draws in. * {@link viewportDimensions} stays the fallback for an element that has no box * yet — detached nodes, server-rendered markup, test doubles. */ export declare function paintedBoxDimensions(element?: Element | null): { height: number; width: number; }; export declare function isInViewport(rect: { left: number; top: number; right: number; bottom: number; }, context?: Node | null): boolean; export declare function roundByDPR(value: number, context?: Node | null): number; /** The only part of a `DOMRect` the cutout geometry reads. */ export type RectGeometry = Pick; export declare function roundedRectPath(rect: RectGeometry, viewport: { width: number; height: number; }, options: { padding: number; radius: number; }, context?: Node | null): string; /** Whether a target resolution is still pending, i.e. the resolver returned a promise. */ export declare function isPendingTarget(value: HTMLElement | null | Promise): value is Promise; /** * Resolves a step's target. Deliberately not `async`: a selector or an element target settles * synchronously, and only a resolver that returns a promise hands back something to wait on. * Callers use {@link isPendingTarget} to tell the two apart, and a tour that has to wait says so. */ export declare function resolveTargetElement(target: TargetResolver, options: { readonly document?: Document; readonly signal: AbortSignal; }, path?: string): HTMLElement | null | Promise;