/**
* HTML Compiler for Producer
*
* Two-phase compilation that guarantees every media element has data-end:
* 1. Static pass via core's compileTimingAttrs() (data-start + data-duration → data-end)
* 2. ffprobe resolution for elements without data-duration
*
* Also handles sub-compositions referenced via data-composition-src,
* recursively extracting nested media from sub-sub-compositions.
*/
import { type ResolvedDuration, type UnresolvedElement } from "@hyperframes/core";
import { type VideoElement, type ImageElement, type AudioElement, type AudioVolumeKeyframe } from "@hyperframes/engine";
import type { Page } from "puppeteer-core";
export interface CompiledComposition {
html: string;
subCompositions: Map;
videos: VideoElement[];
audios: AudioElement[];
images: ImageElement[];
unresolvedCompositions: UnresolvedElement[];
/** Assets that resolve outside projectDir. Keys are the path used in HTML, values are absolute filesystem paths. */
externalAssets: Map;
width: number;
height: number;
staticDuration: number;
renderModeHints: RenderModeHints;
hasShaderTransitions: boolean;
}
export type RenderModeHintCode = "iframe" | "requestAnimationFrame" | "htmlInCanvas";
export interface RenderModeHint {
code: RenderModeHintCode;
message: string;
}
export interface RenderModeHints {
recommendScreenshot: boolean;
reasons: RenderModeHint[];
}
export declare function detectRenderModeHints(html: string): RenderModeHints;
export declare function detectShaderTransitionUsage(html: string): boolean;
/**
* Download external CDN scripts and inline them into the HTML so rendering
* works without network access (Docker, CI, restricted environments).
*/
export declare function inlineExternalScripts(html: string): Promise;
/**
* Scan compiled HTML for asset references that resolve outside projectDir.
* For each, map the normalized in-HTML path to the real filesystem path so
* the orchestrator can copy them into the compiled output directory.
*
* Handles: src/href attributes, CSS url(), inline style url().
*/
export declare function collectExternalAssets(html: string, projectDir: string): {
html: string;
externalAssets: Map;
};
/**
* Download any remote `src` URLs on `