import React from "react"; import type { HighlightOverlayProps, OverlayStyle } from "../HighlightOverlay"; export declare type OverlayData = { entering: HighlightOverlayProps["entering"]; exiting: HighlightOverlayProps["exiting"]; onDismiss: HighlightOverlayProps["onDismiss"]; } & Required; export declare type HighlightOffset = { x: number; y: number; }; export declare type HighlightOptions = CommonOptions & (RectangleOptions | CircleOptions | CustomHighlightOptions); export declare type CommonOptions = { /** * If true, allows the user to click elements inside the highlight. Otherwise clicking inside the * highlight will act the same as clicking outside the highlight, calling `onDismiss`. * @default true * @since 1.0 */ clickthroughHighlight?: boolean; /** * If you want your highlight to be offset slightly from its original position you can manually * specify an offset here. Especially useful if your highlight is inside of a scroll view * (see example project). * * @since 1.3 */ offset?: HighlightOffset; }; export declare type RectangleOptions = { mode: "rectangle" | undefined; /** * The border radius of the rectangle. * @default 0 * @since 1.0 */ borderRadius?: number; /** * The padding of the rectangle. * @default 0 * @since 1.0 */ padding?: number; }; export declare type CircleOptions = { mode: "circle"; /** * The padding of the circle. * @default 0 * @since 1.0 */ padding?: number; }; export declare type CustomHighlightOptions = { mode: "custom"; /** * Should return a valid SVG path. * @param bounds the bounds of the element that is being highlighted * @since 1.4 */ createPath: (bounds: Bounds) => string; }; export declare type Bounds = { x: number; y: number; width: number; height: number; }; export declare type ElementsRecord = Record; export declare type AddElement = (id: string, node: React.ReactNode, bounds: Bounds, options?: HighlightOptions) => void; export declare type RemoveElement = (id: string) => void; export declare type RootRefGetter = () => React.Component | null; export declare type SetCurrentActiveOverlay = (data: OverlayData | null) => void; export declare type GetCurrentActiveOverlay = () => OverlayData | null; export declare type HighlightableElementContextType = readonly [ /** * @since 1.0 */ elements: Readonly, actions: { /** * @since 1.0 */ readonly addElement: AddElement; /** * @since 1.0 */ readonly removeElement: RemoveElement; /** * @deprecated since version `1.3`, use `getRootRef()` instead. */ readonly rootRef: React.Component | null; /** * @returns the reference to the root element used to calculate offsets for the highlights. * @since 1.3 */ readonly getRootRef: RootRefGetter; /** * Sets the data for the current active overlay. Set `null` when no overlay is active. * @since 1.3 */ readonly setCurrentActiveOverlay: SetCurrentActiveOverlay; /** * Get the data for the current active overlay, or `null` when no overlay is active. * @since 1.3 */ readonly getCurrentActiveOverlay: GetCurrentActiveOverlay; } ]; declare const HighlightableElementContext: React.Context; export default HighlightableElementContext;