import type { RuntimeTimelineLike } from "./types";
/**
 * Shared volume-automation utilities used by both the renderer (offline PCM
 * baking in audioVolumeEnvelope.ts) and the preview runtime (per-tick gain
 * applied in syncRuntimeMedia).
 *
 * Keeping the two concerns in one place ensures preview and render derive the
 * envelope from the same logic and the same probe samples.
 */
export interface VolumeKeyframe {
    time: number;
    volume: number;
}
/**
 * Normalise raw keyframes to track-relative seconds: subtract `trackStart`,
 * clamp to [0,1], sort, de-duplicate, and prepend a `baseVolume` anchor at
 * t=0 when the first keyframe starts after the clip's begin.
 *
 * Returns an empty array when all keyframes are invalid — the caller should
 * treat an empty envelope as "no automation, use static volume."
 */
export declare function normaliseEnvelope(keyframes: VolumeKeyframe[], trackStart: number, baseVolume: number): VolumeKeyframe[];
/**
 * Linearly interpolate the gain at time `t` (track-relative seconds) from a
 * normalised envelope produced by `normaliseEnvelope`. Returns 1 when the
 * envelope is empty.
 */
export declare function interpolateVolumeGain(envelope: VolumeKeyframe[], t: number): number;
/**
 * Probe a single media element's volume automation by seeking a GSAP timeline
 * through the element's active window.
 *
 * Runs synchronously in the browser. The timeline is left at its current
 * position after the probe (the next transport tick re-seeks it to `t`).
 *
 * Returns null when the element has no detectable automation (volume never
 * changes from its initial `data-volume` value).
 */
export declare function probeElementVolumeKeyframes(el: HTMLAudioElement | HTMLVideoElement, seekTimeline: (t: number) => void, compositionDuration: number, sampleFps: number): VolumeKeyframe[] | null;
export type RuntimeTimelineRef = Partial<Pick<RuntimeTimelineLike, "totalTime" | "seek">>;
export interface VolumeProbeOptions {
    /**
     * Render/probe pages must not sample the live visual timeline during runtime
     * initialization. The producer discovers audio automation in its own
     * isolated pass and bakes it before frame capture, so seeking here is both
     * redundant and capable of materializing future zero-duration GSAP state.
     *
     * Preview callers omit this option and retain live automation discovery.
     */
    allowLiveTimelineSeek?: boolean;
}
/**
 * Probe a media element and, if volume automation is detected, store a
 * NORMALISED envelope in `cache`. Safe to call with a null timeline — returns
 * early.
 *
 * `probeElementVolumeKeyframes` stamps each keyframe with the timeline seek
 * time it was sampled at. Everything downstream of this cache — like the
 * renderer's PCM baker — indexes an envelope by track-relative seconds, so the
 * rebase belongs here, at the one point that fills the cache, rather than at
 * each read.
 */
export declare function probeAndCacheElementVolume(mediaEl: HTMLMediaElement, timeline: RuntimeTimelineRef | null | undefined, compositionDuration: number, cache: WeakMap<HTMLMediaElement, VolumeKeyframe[]>, options?: VolumeProbeOptions): void;
//# sourceMappingURL=mediaVolumeEnvelope.d.ts.map