import type { GPUVegaCanvasContext } from '../types/context.js'; import type { PathGeometry } from '../types/geometry.js'; /** What a contour about to be dashed is flattened at. See geometryForPath. */ export declare const DASH_FLATNESS = 1; /** * Triangulates an SVG path string into fill triangles and outline contours. * Results are cached on the context, keyed by the path string. * * `scale` is how finely a bezier is flattened. The default follows the curve * closely, which is what every consumer wants but one: `arc-shapes` goes from * 0.211% of pixels to 0.058%, `gradient-strokes` 0.161% to 0.054%, * `path-shapes` 0.034% to 0.005% and `trail` 0.016% to 0.009%. * * Four rather than more. It is where the gain flattens out, and past it the * extra vertices start costing: at 8 a nearly straight run picks up enough * near-collinear joints that one of them loses a pixel, which took `line-shapes` * at dpr 2 from worst channel 71 to 134 while its pixel count did not move. * * A dash is the exception and takes DASH_FLATNESS instead. Its runs are * measured along this polyline, so its length has to be the one canvas measures * rather than the curve's, and canvas is not measuring the curve: at the * default here `mark-dashes` goes 0.037% to 0.055% and worst channel 115 to * 206, and a dashed rounded border 0.010% to 0.034%. */ export default function geometryForPath(context: GPUVegaCanvasContext, path: string | null | undefined, scale?: number, scaleX?: number, scaleY?: number): PathGeometry;