import { Expr, GpuFragmentParams } from '../../gpu/contract'; import { PropRef } from '../values'; import { ArgSpec } from '../invoke'; /** What a generator's `paint:` field takes: a function that returns the color at this pixel. */ export type Paint = (params: GpuFragmentParams) => Expr; /** The inputs to `strokedSegment`. */ export interface StrokedSegmentSlots { /** The two endpoints, position props made with `transformPosition`. */ from: PropRef; to: PropRef; /** Stroke thickness as a fraction of the canvas height (0.01 is a hairline). */ width: ArgSpec; /** Line style as a number: 0 solid, 1 dashed, 2 dotted. */ style: ArgSpec; /** Dash length (caps included) and the gap between dashes or dots, as fractions of the canvas height. */ dashLength: ArgSpec; gapLength: ArgSpec; /** Cap shape at each end as a number: 0 square, 1 rounded. */ capStart: ArgSpec; capEnd: ArgSpec; /** The stroke color prop. */ color: PropRef; } /** * A straight line between two points, solid, dashed or dotted, with square or round ends. * * Dashes and dots are spaced so the pattern lands exactly on both endpoints. The edge stays * antialiased at any thickness. Style and cap inputs are numbers, so give a select prop a * `transform` that maps its labels to them, or pass the number directly. * * @example * ```ts * paint: strokedSegment({from: p('pointA'), to: p('pointB'), width: p('thickness'), style: 1, dashLength: p('dashLength'), gapLength: p('gapLength'), capStart: 1, capEnd: 1, color: p('color')}) * ``` * @see sineStroke */ export declare function strokedSegment(slots: StrokedSegmentSlots): Paint; /** The inputs to `sineStroke`. */ export interface SineStrokeSlots { /** The wave's center, a position prop made with `transformPosition`, and its rotation in degrees. */ position: PropRef; angle: ArgSpec; /** Waves per canvas height along the line, and wave height as a fraction of the canvas height. */ frequency: ArgSpec; amplitude: ArgSpec; /** Band thickness (0–2) and edge softness (0–1). */ thickness: ArgSpec; softness: ArgSpec; /** The stroke color prop. */ color: PropRef; } /** * A wavy line that travels along itself, drawn as a soft band. * * The wave is centered on `position` and turned by `angle`. It moves on the layer's clock, * so declare `animatedTime: {speed: 'speed'}`. * * @example * ```ts * paint: sineStroke({position: p('position'), angle: p('angle'), frequency: p('frequency'), amplitude: p('amplitude'), thickness: p('thickness'), softness: p('softness'), color: p('color')}) * ``` * @see strokedSegment */ export declare function sineStroke(slots: SineStrokeSlots): Paint; //# sourceMappingURL=figures.d.ts.map