/** * React Hook for text-only lyric rendering * * This hook returns styled text elements without any container styling, * allowing users to fully customize the background and layout. */ import { UseLyricHighlightOptions } from './useLyricHighlight'; import type { LyricLine } from '../../types/components'; export interface LyricWordElement { /** Word index within the line */ wordIndex: number; /** Word text */ text: string; /** Word time */ time: number; /** Is this word currently active/highlighted? */ isActive: boolean; /** Inline styles for the word */ style: React.CSSProperties; /** CSS class names */ className: string; } export interface LyricTextElement { /** Line index */ lineIndex: number; /** Line position */ position: 'prev' | 'current' | 'next'; /** Full line text */ text: string; /** Individual words in this line (word-by-word like v1.0.3) */ words: LyricWordElement[]; /** Inline styles for the line */ style: React.CSSProperties; /** CSS class names */ className: string; } export interface UseLyricTextOptions extends UseLyricHighlightOptions { /** Color for inactive words */ inactiveColor?: string; /** Color for active/highlighted words */ activeColor?: string; /** Color for current line */ currentLineColor?: string; /** Color for prev line */ prevLineColor?: string; /** Color for next line */ nextLineColor?: string; /** Font size for current line */ currentFontSize?: string; /** Font size for prev line */ prevFontSize?: string; /** Font size for next line */ nextFontSize?: string; /** Font weight for current line */ currentFontWeight?: number; /** Font weight for prev line */ prevFontWeight?: number; /** Font weight for next line */ nextFontWeight?: number; /** Text shadow for highlighted words */ highlightTextShadow?: string; /** Custom inline styles for active words */ activeWordStyle?: React.CSSProperties; /** Custom inline styles for inactive words */ inactiveWordStyle?: React.CSSProperties; } export interface UseLyricTextReturn { /** Text elements ready to render */ textElements: LyricTextElement[]; /** Get inline style for a specific word */ getWordStyle: (lineIndex: number, wordIndex: number) => React.CSSProperties; /** Get CSS class for a specific word */ getWordClass: (lineIndex: number, wordIndex: number) => string; /** Get inline style for a specific line */ getLineStyle: (lineIndex: number) => React.CSSProperties; /** Get CSS class for a specific line */ getLineClass: (lineIndex: number) => string; /** Current line index */ currentLineIndex: number; /** Progress through current line (0-1) */ progress: number; } /** * Hook for text-only lyric rendering * Returns styled text elements without container styling * * @example * ```tsx * function CustomLyrics({ lyrics, currentTime }) { * const { textElements } = useLyricText(lyrics, currentTime, { * activeColor: '#ff0000', * inactiveColor: '#666666', * currentFontSize: '3rem' * }); * * return ( *
* {textElements.map((line, i) => ( *
* {line.words.map((word, j) => ( * * {word.text} * * ))} *
* ))} *
* ); * } * ``` */ export declare function useLyricText(lyrics: LyricLine[], currentTime: number, options?: UseLyricTextOptions): UseLyricTextReturn;