import { PropsWithChildren } from 'react'; import { Descendant, DescendantsList } from '../Descendants'; import { AbsoluteHighlightSetter, RelativeHighlightSetter } from './reducer'; export type Index = number | undefined; export declare const Direction: { readonly Next: "next"; readonly Prev: "prev"; }; export type Direction = (typeof Direction)[keyof typeof Direction]; export declare const Position: { readonly First: "first"; readonly Last: "last"; }; export type Position = (typeof Position)[keyof typeof Position]; export interface HighlightContextProps { /** The currently highlighted object */ highlight: Descendant | undefined; } export interface HighlightHookReturnType extends HighlightContextProps { /** * An absolute setter function. * Sets the highlight to an explicit `id`, `index`, {@link Position}, or {@link Descendant} value */ setAbsoluteHighlight: AbsoluteHighlightSetter; /** * A relative setter function. * Provide a {@link Direction} or `delta` number * to move the highlight relative to the current value */ setRelativeHighlight: RelativeHighlightSetter; /** * A unique context provider for the given `HighlightContext` */ Provider: React.ComponentType>; } export type HighlightChangeHandler = (nextHighlight: Descendant | undefined) => void; export interface UseHighlightOptions { /** * A callback fired when the highlight changes */ onChange?: HighlightChangeHandler; /** * Filters descendants that are enabled */ filter?: (d: Descendant) => boolean; /** * A callback fired once when the descendants context is initialized */ onInit?: (descendants: DescendantsList) => void; } //# sourceMappingURL=highlight.types.d.ts.map