/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type ValueTypeOf } from "@elaraai/east"; import { Plan } from "@elaraai/e3-ui/internal"; import type { PlanScale } from "./scale.js"; import type { PlanEvent } from "./plan-state.js"; import { type PlanGeometry } from "./geometry.js"; /** One decoded element ref — the generalized resolvers' subject. */ export type PlanElementRefValue = ValueTypeOf; /** A decoded element resolver (the root's `popover` / `hover` some-value). */ export type PlanElementResolver = Extract["popover"], { type: "some"; }>["value"]; /** * What an element reports its clicks to. Popovers and hover cards are not an * element's business: the canvas's one overlay layer opens them from the * element's DOM identity (#816), running the LATEST root's resolvers with the * element's ref — a `none` result opens no surface (`Plan Data Interface.md` * §3.3). */ export interface PlanResolvers { /** * The element-click funnel — the root's ONE `onElementClick` (#824), called * with the clicked element's ref: a run, a tile, a mark, a chip, a cell or * a link ribbon. `undefined` when the root declares none. */ onElementClick?: ((ref: PlanElementRefValue) => void) | undefined; } /** The shared scale, provided once by the canvas. */ export declare const PlanScaleContext: import("react").Context; /** The interaction dispatch channel (the canvas controller's `dispatch`). */ export declare const PlanDispatchContext: import("react").Context<(e: PlanEvent) => void>; /** * The hover-cursor controller (#609) — display-only chrome, written straight * to the DOM: `move` sets ONE CSS variable on the canvas body (every row's * hairline positions from it) and writes the ruler chip's label/position; * `leave` hides both. Never React state: routing a pointermove through the * reducer re-rendered every mounted row once per event. */ export interface PlanCursor { /** The pointer is at a window fraction over a row plot. */ move(frac: number): void; /** The pointer left a row plot. */ leave(): void; /** * Follow the hovered BUCKET (#743) — the listener hears the bucket index * each time the pointer crosses into another one (`-1` once it is over no * bucket, or gone), and at once with the current one. A chart row's * crosshair readout writes the DOM from it, so a hover still renders * nothing. * * @param listener - Called with the hovered bucket index * @returns Stop listening */ subscribe(listener: (bucket: number) => void): () => void; } /** The cursor channel (inert by default — chrome simply never shows). */ export declare const PlanCursorContext: import("react").Context; /** The element-click channel (no funnel when the root declares no `onElementClick`). */ export declare const PlanResolversContext: import("react").Context; /** The canvas's geometry — the one height table for its density (#817). */ export declare const PlanGeometryContext: import("react").Context>; /** * The canvas's geometry — every row and slot height, for its density. * * @returns The table (the default density outside a Plan) */ export declare function usePlanGeometry(): Readonly; /** * The shared scale — throws when mounted outside a Plan (row components are * canvas-internal; there is no standalone mounting). * * @returns The canvas's scale */ export declare function usePlanScale(): PlanScale; /** * The interaction dispatch channel. * * @returns The canvas's `dispatch` */ export declare function usePlanDispatch(): (e: PlanEvent) => void; /** * The hover-cursor controller. * * @returns The canvas's cursor channel (a no-op outside a Plan) */ export declare function usePlanCursor(): PlanCursor; /** * What an element reports its clicks to. * * @returns The click funnel, when the root declares `onElementClick` */ export declare function usePlanResolvers(): PlanResolvers; //# sourceMappingURL=context.d.ts.map