import { type ReactElement } from "react"; import { type StyleProp, type ViewProps, type ViewStyle } from "react-native"; /** * The handlers a framed node spreads, beside FOCUS_RESET in its style. The key, focus, * pointer and blur handlers are web props absent from React Native's types (the kit's * usual cast). A node that takes a ref of its own composes `ref` with it. */ export type FocusFrameTarget = ViewProps & { ref: (node: unknown) => void; }; export interface FocusFrame { /** Whether the framed node has keyboard focus. */ focused: boolean; target: FocusFrameTarget; /** * The frame's ring, outside it, while the framed node has keyboard focus, null * otherwise. Pass `shape` when the frame node does not carry the visible corners * itself, so the ring follows them. */ ring(shape?: StyleProp): ViewStyle | null; /** * The ring just inside the frame, as the frame's last child, for a frame flush inside * a clipping parent that would cut the outside one. Null while the framed node has no * keyboard focus. `shape` gives it the frame's corners. */ innerRing(shape?: StyleProp): ReactElement | null; } /** The frame side of a node whose ring its frame draws. */ export declare function useFocusFrame(): FocusFrame; /** * The frame's handlers for a framed node that tracks its own focus too (a text field, * whose border follows its focus): the node's focus and blur handlers run after the * frame's. Spread the result in place of `target`, and compose `target.ref` with the * node's own ref. */ export declare function frameHandlers(target: FocusFrameTarget, own: { onFocus: (event: E) => void; onBlur: (event: E) => void; }): { onKeyUp: (event: unknown) => void; onPointerDown: (event: unknown) => void; onFocus(event: E): void; onBlur(event: E): void; }; /** * The frame's `target`, for a framed node that another component renders: an option * list's scrollport inside the overlay card that frames it. Null where nothing frames * the node, which then wears its own ring. */ export declare const FocusFrameContext: import("react").Context; //# sourceMappingURL=focus-frame.d.ts.map