import type { MarkShape } from "./layers.types.ts"; /** A place, `[x, y]`, in the drawing's frame. */ export type P = readonly [number, number]; /** * A colour a fraction `t` (0 to 1) of the way through `stops`, as a hex colour, or the nearest stop when one cannot be read without a * browser (`var(--x)`, a name that is not a common one). Stops that are not colours are ignored; with none left, `undefined`. */ export declare function rampColour(stops: readonly string[], t: number): string | undefined; /** * The path of a polygon shape of width `width` centred on `(cx, cy)`. When the surface is turned a quarter, the corners are turned * back so that the shape stands upright as the eye sees it. */ export declare function shapePath(shape: Exclude, cx: number, cy: number, width: number, turned: boolean): string; /** True for a shape drawn as a polygon, not a circle. */ export declare const isPolygon: (shape: string) => shape is Exclude; /** A line from one place to another, straight or bowed, that can be walked by distance. */ export interface Curve { from: P; to: P; /** The control point of the bow, or `undefined` for a straight line. */ control?: P; /** The length of the line. */ length: number; /** The place a distance `s` along the line. */ at(s: number): P; /** The unit direction of the line a distance `s` along it. */ tangent(s: number): P; /** The same line with its last `by` cut off (so that an arrowhead's tip can stand where the line was to end). */ trim(by: number): Curve; } /** A line from `from` to `to` bowed by `bow` times its length (zero for straight). Positive bows to the right of the way it goes as the surface is drawn wide. */ export declare function curveBetween(from: P, to: P, bow: number): Curve; /** The path of a straight or bowed line. */ export declare function curvePath(curve: Curve): string; /** * A wave along a line: a chain of quadratic curves, each half a wavelength long, that leans to one side and then the other, so * that it starts and ends on the line. The wavelength is stretched a little so that a whole number of waves fits. */ export declare function wavePath(curve: Curve, amplitude: number, wavelength: number): string; /** The path of a head at `tip`, pointing along the unit direction `u`: a filled triangle (closed) or an open chevron. */ export declare function headPath(tip: P, u: P, headLength: number, halfWidth: number, open: boolean): string; /** The outline of a comet along a line: a shape that grows from a point at the start to `widest` wide at the end. */ export declare function taperPath(curve: Curve, widest: number, steps?: number): string; /** A polyline's path. */ export declare const polylinePath: (points: readonly P[], last?: P) => string;