import type { ResolvedSegment } from "../core/resolveSegment"; /** Screen-space x-extent of a segment band, recomputed each frame. */ export interface SegmentBandX { visible: boolean; /** Band left edge (px), clamped into the plot. */ bx1: number; /** Band right edge (px), clamped into the plot. */ bx2: number; } /** * Project a segment's `[from, to]` time range (unix seconds) to a clamped x-pixel * band within the plot `[x1, x2]`. Mirrors the time-band logic in * `useReferenceLine`: an omitted `from` extends to the left edge (window start), * an omitted `to` extends to the live edge (`now = winStart + win`). Swaps a * reversed range, culls a fully off-screen one, and clamps a partial one. */ export declare function segmentBandX(from: number | undefined, to: number | undefined, winStart: number, win: number, x1: number, x2: number): SegmentBandX; /** Horizontal stroke gradient for the recolored line segments. */ export interface SegmentGradient { colors: string[]; positions: number[]; } /** * Build the horizontal gradient applied to the line stroke itself, implementing * "scrub focus" (the Robinhood model): the whole line is its plain `baseColor` * until the user scrubs (or a segment is forced `active`). While focused, the * segment under the scrub — or the `active` one — stays `baseColor` (full), and * every OTHER `recolorLine` segment is de-emphasized with its own `mutedColor` / * `mutedColors` (a different hue and/or a reduced alpha that fades it). Because it * paints the line directly (not a layer on top), an alpha-reduced color genuinely * lowers the line's opacity there. * * Stop positions are fractions of the full canvas width — the same coordinate * space as the gradient's `start`/`end` vectors. Each de-emphasized segment * contributes `base@f1 → color(s) across [f1,f2] → base@f2`, with duplicate * positions at the boundaries producing hard edges. The Skia gradient requires * non-decreasing positions, so stops are emitted in ascending x order and never * allowed to step backwards — overlapping/reversed/clamped segments can therefore * never feed a non-monotonic array. * * Returns `null` when the line should be uniform: not scrubbing and nothing * `active`, or when every segment is the focused one (nothing to de-emphasize). * The caller then strokes the line with its plain solid color. */ export declare function segmentLineGradient(segments: ResolvedSegment[], winStart: number, win: number, canvasWidth: number, plotLeft: number, plotRight: number, baseColor: string, scrubActive: boolean, scrubX: number): SegmentGradient | null; /** Stops {@link segmentLineGradient} can emit for `segments` — no per-frame state. */ export declare function segmentGradientStopCount(segments: ResolvedSegment[]): number; /** Resize `stops` to `count` by repeating its last entry. */ export declare function padGradientStops(stops: T[], count: number): T[]; //# sourceMappingURL=segments.d.ts.map