/** * Type definitions for Lyric Highlight Components */ import type { LyricLine } from './index'; /** * Display mode for lyrics */ export type LyricDisplayMode = 'single-line' | 'two-line' | 'three-line' | 'extreme-karaoke' | 'full'; /** * Highlight mode */ export type LyricHighlightMode = 'word' | 'line' | 'progressive' | 'none'; /** * Line position in display */ export type LinePosition = 'prev' | 'current' | 'next'; /** * Options for lyric display */ export interface LyricDisplayOptions { /** Display mode (default: 'three-line') */ displayMode: LyricDisplayMode; /** Highlight mode (default: 'word') */ highlightMode: LyricHighlightMode; /** Auto-scroll to current line (default: true) */ autoScroll: boolean; /** Smooth scroll animation (default: true) */ smoothScroll: boolean; /** Scroll offset in pixels (default: 0) */ scrollOffset: number; /** Text-only mode: no container styling, only text with highlight (default: false) */ textOnly?: boolean; /** Disable background: remove all background styling (default: false) */ disableBackground?: boolean; } /** * Enhanced lyric line with display info */ export interface HighlightedLine extends LyricLine { /** Position in display */ position: LinePosition; /** Original index in lyrics array */ index: number; } /** * Current state of lyric highlighting */ export interface LyricHighlightState { /** Current line index */ currentLineIndex: number; /** Current time in seconds */ currentTime: number; /** Lines to display */ displayLines: HighlightedLine[]; /** Map of word index to highlight state */ highlightedWords: Map; /** Progress through current line (0-1) */ progress: number; /** Total number of lines */ totalLines: number; } /** * Theme configuration */ export interface LyricTheme { /** Theme name */ name: string; /** Colors */ colors: { inactive: string; active: string; current: string; prev: string; next: string; background?: string; }; /** Fonts */ fonts?: { family: string; size: { current: string; prev: string; next: string; }; weight: { current: number; prev: number; next: number; }; }; /** Animations */ animations?: { transition: string; highlightDuration: string; scrollDuration: string; }; /** Spacing */ spacing?: { lineHeight: string; wordSpacing: string; letterSpacing?: string; padding: string; }; } /** * Render options for DOM-based rendering */ export interface LyricRenderOptions extends LyricDisplayOptions { /** Container element */ container: HTMLElement; /** Theme */ theme?: LyricTheme | string; /** Custom CSS classes */ classNames?: { container?: string; line?: string; word?: string; current?: string; prev?: string; next?: string; active?: string; inactive?: string; }; /** Callback when line changes */ onLineChange?: (lineIndex: number, line: LyricLine) => void; /** Callback when word highlights */ onWordHighlight?: (lineIndex: number, wordIndex: number) => void; } /** * Export main types for convenience */ export type { LyricLine, LyricPart } from './index';