import type { SatelliteRef } from "../satellites/types.ts"; import type { SatelliteState } from "./satellite-layer.ts"; import { MAX_PATHS, type PathHit, type PathRequest, type PathStyle } from "./paths.ts"; /** The attributes the paths add to an element. */ export declare const PATH_ATTRIBUTES: readonly ["selected-path", "path-hit", "path-priority"]; /** Which comes first under a pointer: a satellite's `dots` (the default), or `paths` (a path of the page's, unless the dot is of a satellite whose path is listed or that is chosen). Anything else is `dots`. */ export type PathPriority = "dots" | "paths"; export declare const readPathPriority: (value: string | null) => PathPriority; /** What the element hands the paths. */ export interface PathHost { element: HTMLElement; state: SatelliteState; /** Ask for a draw. */ request(): void; /** The path under a point of the view within a radius, from the last draw. */ pathAt(x: number, y: number, radius: number): Omit | null; /** The satellite whose dot is under a point, which a path never takes a press from. */ pick(x: number, y: number): SatelliteRef | null; /** The view is a ride from a satellite: the hit test is off there unless `path-hit` is set. */ riding(): boolean; } export interface PathStats { /** Paths the page asked for. */ requested: number; /** Paths in the one draw (the page's and the chosen satellite's own), as of the last draw. */ drawn: number; /** Asked for beyond {@link MAX_PATHS}, so left out (the earliest). */ dropped: number; /** Asked for but matching no satellite, or with no place. */ unresolved: number; /** The chosen satellite's own orbit is drawn. */ selectedDrawn: boolean; /** Draw calls the paths took at the last draw: 0 or 1. */ draws: number; /** The path the mouse is on, by the id given, or `null`. */ hover: number | string | null; /** `chikyu-path-click` events sent so far. */ hits: number; } export interface PathControls { setPaths(list: readonly PathRequest[]): void; readonly paths: PathRequest[]; setStyles(table: Readonly | null>>, replace?: boolean): void; readonly styles: Record; /** Read `selected-path` and `path-hit` again. */ sync(): void; readonly selectedOn: boolean; readonly hit: number; at(x: number, y: number, radiusPx?: number, pointer?: PathHit["pointer"]): PathHit | null; /** A press that was not a drag, at a point of the element: sends `chikyu-path-click` and answers `true` when a path was under it and no dot was. */ press(x: number, y: number, pointer: PathHit["pointer"]): boolean; stats(): PathStats; stop(): void; } export declare const pointerOf: (event: PointerEvent) => PathHit["pointer"]; export declare function bindPaths(host: PathHost): PathControls; export { MAX_PATHS }; /** The paths' numbers before the element has bound them. */ export declare const emptyPathStats: () => PathStats;