import { BoundingBox } from './boundingbox'; import { Element } from './element'; import { Note } from './note'; export interface CurveOptions { /** Stroke the first half of the fitted slur with dashes and the second half solid. */ halfDashed?: boolean; /** Two control points for the bezier curves. */ cps?: { x: number; y: number; }[]; thickness?: number; xShift?: number; yShift?: number; position?: string | number; positionEnd?: string | number; invert?: boolean; openingDirection?: 'up' | 'down' | 'auto'; } type Point = { x: number; y: number; }; interface CurveRenderParams { firstX: number; firstY: number; lastX: number; lastY: number; direction: number; } export declare enum CurvePosition { NEAR_HEAD = 1, NEAR_TOP = 2 } export declare class Curve extends Element { static get CATEGORY(): string; renderOptions: Required; protected from?: Note; protected to?: Note; static get Position(): typeof CurvePosition; static get PositionString(): Record; constructor(from: Note | undefined, to: Note | undefined, options: CurveOptions); private layoutRise; private readonly authoredControls; /** Automatic routing changes only the derived lift, preserving the authored control points. */ setLayoutRise(rise: number): void; hasManualControls(): boolean; getNotes(): { firstNote?: Note; lastNote?: Note; }; /** Subdivided ink of the actual rendered cubic. */ getRouteParts(): BoundingBox[]; setNotes(from: Note | undefined, to: Note | undefined): this; /** * @return {boolean} Returns true if this is a partial bar. */ isPartial(): boolean; /** * Compute the end points and control points of the bezier curve(s) for `renderCurve()`. * The first bezier is the upper edge of the slur, the second one (only drawn for solid lines) goes back * from the last to the first point, at a distance of `thickness`. */ private getBezierPoints; renderCurve(params: CurveRenderParams): void; /** Get the points where the curve starts and ends, and the direction it bulges to. Requires formatted notes. */ private getRenderParams; /** * Get the bounding box of the drawn curve, including its thickness but not the stroke width. * The notes must be formatted. * The box is exact: it is fitted to the extrema of the bezier curves, not to their control points. */ getBoundingBox(): BoundingBox; /** Endpoints on the rendered curve after authored shifts. */ getAnchors(): { start: Point; end: Point; }; draw(): boolean; } export {};