/** Derived locations use UTF-16 string offsets; they are never persisted separately. */ export interface ManuscriptKeyframeAnchor { id: string; offsetSeconds: number; startOffset: number; endOffset: number; contentStartOffset: number; contentEndOffset: number; text: string; } /** Detect the reserved prefix, including malformed markers that require an error. */ export declare function hasManuscriptKeyframes(manuscript: string): boolean; /** * Parse authored locations without changing prose or repairing invalid positions. * @param unitId Owner of the inline keyframe IDs. * @param durationSeconds Unit-local duration, excluding the final endpoint. * @param manuscript Formal prose, or a legacy unmarked manuscript. * @param inheritedOpening Whether time zero comes from the preceding video. * @param allowMissingOpening Whether unlinking left an opening awaiting authoring. * @returns Ordered locations and explicit authoring errors; legacy prose has no locations. */ export declare function parseVideoUnitManuscript(unitId: string, durationSeconds: number, manuscript: string, inheritedOpening?: boolean, allowMissingOpening?: boolean): { anchors: ManuscriptKeyframeAnchor[]; issues: string[]; }; /** Remove complete marker lines for density estimates without changing manual Full Prompts. */ export declare function stripManuscriptKeyframeMarkers(manuscript: string): string; /** * Scale inline times at millisecond precision, preserving every non-marker byte. * @param unitId Owner of the manuscript. * @param manuscript Current text, including anchors without generated products. * @param oldDuration Original Unit duration. * @param newDuration Requested Unit duration. * @param inheritedOpening Whether the opening is inherited from the preceding video. * @param allowMissingOpening Whether unlinking left an opening awaiting authoring. * @returns Text with normalized marker times; throws before returning invalid timing. */ export declare function scaleVideoUnitManuscript(unitId: string, manuscript: string, oldDuration: number, newDuration: number, inheritedOpening?: boolean, allowMissingOpening?: boolean): string; /** * Project a duration-only change through both prose and existing keyframe records. * @param unit Saved Unit timing and products. * @param durationSeconds New duration. * @returns Synchronized manuscript and keyframes, retaining unrelated product fields. */ export declare function resizeVideoUnitTiming(unit: { id: string; manuscript: string; durationSeconds: number; keyframes: readonly T[]; dependency?: { unitId: string; }; openingRequired?: boolean; }, durationSeconds: number): { manuscript: string; keyframes: T[]; };