/** * Annotation geometry types. * * All coordinates are NORMALIZED to the 0–1 range relative to the media's * intrinsic size, so annotations scale automatically on resize/zoom. */ /** A normalized point (0–1) relative to media width/height. */ export interface NormPoint { x: number; y: number; } /** Drawable shape kinds (excludes the pin tool, which produces a Pin). */ export type ShapeType = 'rectangle' | 'ellipse' | 'line' | 'arrow' | 'freehand'; /** Measurement tool kinds. Each produces a measurement annotation. */ export type MeasureType = 'measure-distance' | 'measure-font' | 'measure-color'; /** Tools selectable in the toolbar. */ export type ToolType = 'select' | 'pin' | ShapeType | MeasureType; /** Visual styling for a drawn shape. */ export interface ShapeStyle { /** Stroke color (any CSS color string). */ color: string; /** Stroke width in CSS pixels (rendered at 1x zoom). */ strokeWidth: number; /** Opacity in the 0–1 range. Defaults to 1 (fully opaque) when omitted. */ opacity?: number; /** Fill the interior with `color` (rectangle / ellipse). Defaults to outline-only. */ fill?: boolean; /** Render arrowheads at both ends (arrow tool). Defaults to a single head. */ doubleArrow?: boolean; } /** Base fields shared by every shape. */ interface ShapeBase { id: string; type: ShapeType | MeasureType; style: ShapeStyle; /** Optional video timestamp (seconds) this shape is anchored to. */ startTime?: number; /** Optional end of a video time range (seconds). */ endTime?: number; } /** Axis-aligned rectangle, defined by its top-left corner + size (normalized). */ export interface RectangleShape extends ShapeBase { type: 'rectangle'; x: number; y: number; width: number; height: number; } /** Ellipse defined by its bounding box (normalized). */ export interface EllipseShape extends ShapeBase { type: 'ellipse'; x: number; y: number; width: number; height: number; } /** Straight line from one point to another (normalized). */ export interface LineShape extends ShapeBase { type: 'line'; from: NormPoint; to: NormPoint; } /** Directional arrow from one point to another (normalized). */ export interface ArrowShape extends ShapeBase { type: 'arrow'; from: NormPoint; to: NormPoint; } /** Freehand path as a list of normalized points. */ export interface FreehandShape extends ShapeBase { type: 'freehand'; points: NormPoint[]; } /** Distance measurement values, in intrinsic media pixels. */ export interface DistanceMeasure { kind: 'distance'; /** Straight-line length between the two points (px). */ lengthPx: number; /** Horizontal extent (px). */ dxPx: number; /** Vertical extent (px). */ dyPx: number; } /** Font/text-height measurement values, in intrinsic media pixels. */ export interface FontMeasure { kind: 'font'; /** Vertical extent of the measured span (px). */ heightPx: number; } /** Sampled pixel-colour measurement. */ export interface ColorMeasure { kind: 'color'; /** Hex string, e.g. `#A7926D`. */ hex: string; /** sRGB triple, 0–255. */ rgb: [number, number, number]; } /** A distance measurement between two normalized points. */ export interface MeasureDistanceShape extends ShapeBase { type: 'measure-distance'; from: NormPoint; to: NormPoint; measure: DistanceMeasure; } /** A vertical text-height measurement between two normalized points. */ export interface MeasureFontShape extends ShapeBase { type: 'measure-font'; from: NormPoint; to: NormPoint; measure: FontMeasure; } /** A pixel-colour sample at a normalized point. */ export interface MeasureColorShape extends ShapeBase { type: 'measure-color'; at: NormPoint; measure: ColorMeasure; } export type MeasureShape = MeasureDistanceShape | MeasureFontShape | MeasureColorShape; export type Shape = RectangleShape | EllipseShape | LineShape | ArrowShape | FreehandShape | MeasureShape; /** Easing curve applied between two keyframes. */ export type Easing = 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out'; /** Interpolation mode for a keyframed path. */ export type InterpolationMode = 'linear' | 'catmull-rom'; /** A pin position sampled at a specific video time (motion tracking). */ export interface PinKeyframe { /** Video time in seconds. */ time: number; /** Normalized position (0–1) at that time. */ position: NormPoint; } /** A DOM pin marker anchored at a normalized position on the media. */ export interface Pin { id: string; /** Normalized position (0–1). With keyframes, this is the fallback/start. */ position: NormPoint; /** Sequential label shown inside the marker (1, 2, 3…). */ label?: number; /** Id of the comment this pin belongs to, if any. */ commentId?: string; /** Optional video timestamp (seconds) this pin is anchored to. */ startTime?: number; endTime?: number; /** Keyframes for motion tracking across video frames. */ keyframes?: PinKeyframe[]; easing?: Easing; interpolation?: InterpolationMode; } export {}; //# sourceMappingURL=annotation.types.d.ts.map