/** * Context that a WaveformAnnotation can use to draw into the waveform display. */ export interface AnnotationContext { /** * Width of the canvas in pixels. */ width: number; /** * Height of the canvas in pixels. */ height: number; /** * Convert a frame number to a pixel X coordinate. */ frameToX(frame: number): number; /** * Convert an audio value to a pixel Y coordinate. */ valueToY(value: number): number; /** * Graphics context to draw into. */ context: CanvasRenderingContext2D; /** * Color for foreground elements, such as text. */ foregroundColor: string; /** * Color for secondary elements, like arrows and braces. */ secondaryForegroundColor: string; /** * Color to use for highlighting something brightly. */ highlightColor: string; } /** * Interface of annotations of the raw waveform. */ export interface WaveformAnnotation { /** * Draw the annotation. */ draw(ctx: AnnotationContext): void; } /** * Annotation to draw a point. */ export declare class PointAnnotation implements WaveformAnnotation { readonly frame: number; readonly value: number; readonly solid: boolean; constructor(frame: number, value: number, solid: boolean); draw(ctx: AnnotationContext): void; } /** * Annotation to draw a horizontal line. */ export declare class HorizontalLineAnnotation implements WaveformAnnotation { readonly value: number; readonly x1: number; readonly x2: number; constructor(value: number, x1: number, x2: number); draw(ctx: AnnotationContext): void; } /** * Annotation to draw a vertical line. */ export declare class VerticalLineAnnotation implements WaveformAnnotation { readonly frame: number; constructor(frame: number); draw(ctx: AnnotationContext): void; } /** * Label with braces. */ export declare class LabelAnnotation implements WaveformAnnotation { readonly label: string; readonly left: number; readonly right: number; readonly onTop: boolean; constructor(label: string, left: number, right: number, onTop: boolean); draw(ctx: AnnotationContext): void; } /** * Draw a brace with specified label. */ export declare function drawBraceAndLabel(ctx: CanvasRenderingContext2D, height: number, left: number, right: number, braceColor: string, label: string, labelColor: string, drawOnTop: boolean): void; /** * Draw a horizontal brace. */ export declare function drawBrace(ctx: CanvasRenderingContext2D, left: number, middle: number, right: number, top: number, bottom: number, drawOnTop: boolean): void; //# sourceMappingURL=Annotations.d.ts.map