/**
 * Timing Compiler
 *
 * Shared, pure HTML compilation that normalizes timing attributes.
 * Works in both Node.js and browser (no dependencies, regex-based).
 *
 * Guarantees every timed element gets:
 * - id on media elements when missing
 * - data-end (computed from data-start + data-duration when possible)
 * - data-has-audio on <video> elements (false for muted visual-only videos)
 *
 * For elements without data-duration (e.g. videos relying on source duration),
 * this compiler identifies them as "unresolved" so the caller can provide
 * durations via an environment-specific resolver (ffprobe, el.duration, etc.)
 * and call injectDurations() to complete the compilation.
 */
export interface UnresolvedElement {
    id: string;
    tagName: string;
    src?: string;
    start: number;
    end?: number;
    duration?: number;
    mediaStart: number;
    compositionSrc?: string;
}
export interface ResolvedDuration {
    id: string;
    duration: number;
}
export interface ResolvedMediaElement {
    id: string;
    tagName: string;
    src?: string;
    start: number;
    duration: number;
    mediaStart: number;
    loop: boolean;
}
export interface CompilationResult {
    html: string;
    unresolved: UnresolvedElement[];
}
export declare const MEDIA_DURATION_CLAMP_EPSILON_SECONDS = 0.05;
export declare function shouldClampMediaDuration(declaredDuration: number, maxDuration: number): boolean;
/**
 * Whether compilation should shorten an authored media slot to its source.
 *
 * Non-looping video intentionally keeps an explicit longer slot: browsers and
 * the render frame injector hold its final frame until that authored slot ends.
 * Audio has no frame to hold, so its slot remains bounded by playable source.
 */
export declare function shouldClampResolvedMediaDuration(tagName: ResolvedMediaElement["tagName"], declaredDuration: number, maxDuration: number): boolean;
/**
 * Compile timing attributes in HTML.
 *
 * Phase 1 (static): Adds data-end where data-duration exists,
 * adds data-has-audio on videos.
 *
 * Returns the compiled HTML and a list of elements that could not be
 * resolved statically (missing data-duration). The caller should resolve
 * these via ffprobe / el.duration and call injectDurations().
 */
export declare function compileTimingAttrs(html: string): CompilationResult;
/**
 * Inject resolved durations into compiled HTML.
 *
 * For each resolved element, adds data-duration and data-end attributes.
 * Call this after resolving durations via ffprobe, el.duration, or
 * GSAP timeline queries.
 */
export declare function injectDurations(html: string, resolutions: ResolvedDuration[]): string;
/**
 * Extract video/audio elements that already have data-duration set.
 * Used by callers to validate declared durations against actual source durations.
 */
export declare function extractResolvedMedia(html: string): ResolvedMediaElement[];
/**
 * Clamp existing data-duration and data-end on media elements.
 * For each resolution, replaces the declared duration with the clamped value
 * and recomputes data-end accordingly.
 */
export declare function clampDurations(html: string, clamps: ResolvedDuration[]): string;
//# sourceMappingURL=timingCompiler.d.ts.map