import type { Point } from '../types/geometry.js'; /** * What a segment does at one of its ends: a kind, plus the direction and length * that kind needs. * * `m` is a unit direction and `cut` a length along it, and which of the two a * kind uses is in the table below. Both were once inferred from whether `m` was * zero and what sign `cut` had, which ran out of combinations at six, so the * kind is its own field now. * * Two segments meeting at a vertex carry the same bisector and each keeps its * own side of it, so their union is the joined outline and neither draws over * the other. Where one of them is too short to reach that far, the other keeps * the rest. See `reach` in marks/util.ts. */ export type JoinEnd = readonly [mx: number, my: number, cut: number, kind: number]; /** Flat at the end point, which is canvas's default cap. */ export declare const KIND_BUTT = 0; /** A half disc of the stroke's own width, for `strokeCap: 'round'`. */ export declare const KIND_ROUND_CAP = 1; /** Cut against the bisector and rounded off at the end point. */ export declare const KIND_ROUND_JOIN = 2; /** Cut against the bisector, with the axis running on to the corner's own apex. */ export declare const KIND_MITER = 3; /** The same, clipped at `cut` along the bisector where the limit bites. */ export declare const KIND_BEVEL = 4; /** Rounded off and cut back toward the end it faces, `cut` being half the way. */ export declare const KIND_CAP_MEET = 5; export declare const BUTT_END: JoinEnd; export declare const ROUND_END: JoinEnd; /** What canvas uses when the item sets neither. */ export declare const DEFAULT_MITER_LIMIT = 10; /** The join and limit of an item, defaulted the way vega's canvas renderer does. */ export declare function joinStyleOf(item: { strokeJoin?: string; strokeMiterLimit?: number; }): { style: string; miterLimit: number; }; /** * The join at `at`, between the segment arriving from `prev` and the one * leaving towards `next`, written as four floats at `out[i]`. * * Writing in place rather than returning: a stroked choropleth joins hundreds * of thousands of vertices a frame, and a tuple each would be that many * allocations. * */ export declare function writeJoin(out: Float32Array, i: number, prev: Point, at: Point, next: Point, halfWidth: number, style: string, miterLimit: number): void; /** Writes a fixed end, for a cap or a vertex with no join. */ export declare function writeEnd(out: Float32Array, i: number, end: JoinEnd): void; /** The cap style of an item, as the end both outer ends of its runs take. */ export declare function capEnd(strokeCap: string | undefined): JoinEnd; /** True when a run returns to where it started, so its seam is a join. */ export declare function isLoop(run: readonly Point[]): boolean;