UNPKG

@ioris/core

Version:

This package provides the core functionality for the [@ioris](https://www.npmjs.com/search?q=%40ioris) ecosystem for managing music lyrics with time synchronization.

23 lines (22 loc) 759 B
/** * Editing API - Common helper functions */ import type { ValidationResult } from "../../schemas/result"; import type { LyricIndex, Paragraph, Word } from "../../types"; /** * Rebuild LyricIndex * Build all index maps from Paragraph array */ export declare function rebuildIndex(paragraphs: readonly Paragraph[]): LyricIndex; /** * Validate that Word array has no timeline overlaps using wordTimelinesSchema * Reuses the existing Zod schema from timeline.schema.ts */ export declare function checkOverlaps(words: Word[]): ValidationResult<Word[]>; /** * Reassign position values * Set 1-based position values from array indices */ export declare function reindexPositions<T extends { position: number; }>(items: readonly T[]): readonly T[];