import { Hono } from 'hono';
import { S as StudioApiAdapter, M as MediaProcessingJobState } from './mediaProxyPreview-DVTxBkRO.js';
export { L as LintResult, P as PreviewApiAdapter, R as RenderJobState, a as ResolvedProject, b as StudioSelectionResponse, c as StudioSelectionSnapshot, d as StudioSelectionTextField } from './mediaProxyPreview-DVTxBkRO.js';
export { ScreenshotClip, getElementScreenshotClip } from './helpers/screenshotClip.js';
export { STUDIO_MANUAL_EDITS_PATH, StudioManualEditsRenderScriptOptions, createStudioManualEditsRenderBodyScript, createStudioPositionSeekReapplyScript } from './helpers/manualEditsRenderScript.js';
export { STUDIO_MOTION_PATH, StudioMotionRenderScriptOptions, createStudioMotionRenderBodyScript } from './helpers/studioMotionRenderScript.js';
export { isSafePath } from '@hyperframes/core';
import '@hyperframes/parsers';
import './helpers/mediaCodecMap.js';

/**
 * Create a Hono sub-app with all studio API routes.
 *
 * Both the vite dev server and CLI embedded server mount this app
 * under /api, each providing their own adapter for host-specific behavior.
 */
declare function createStudioApi(adapter: StudioApiAdapter): Hono;

/**
 * Creates a stable preview cache-busting signature for project source plus Studio manifests.
 */
declare function createProjectSignature(projectDir: string): string;

/** Recursively walk a directory and return relative file paths. */
declare function walkDir(dir: string, prefix?: string): string[];

declare const MIME_TYPES: Record<string, string>;
declare function getMimeType(path: string): string;

interface FileWriteReceipt {
    path: string;
    version: string;
    writeToken: string;
}
/** Strong content version used as both the JSON version and HTTP ETag. */
declare function fileContentVersion(content: string): string;
/** Attach one API write's identity to the watcher echo for its exact bytes. */
declare function consumeFileWriteReceipt(absPath: string, expectedVersion: string): FileWriteReceipt | null;

/**
 * Build a standalone HTML page for a sub-composition.
 *
 * Uses the project's own index.html `<head>` so all dependencies (GSAP, fonts,
 * Lottie, reset styles, runtime) are preserved — instead of building a minimal
 * page from scratch that would miss important scripts/styles.
 *
 * Three dispatch modes, tried in order:
 *   1. `<template>` wrapper → extract template content (existing compositions)
 *   2. Full HTML document → parse and extract head/body separately (registry blocks)
 *   3. Raw fragment → wrap in a minimal document
 *
 * For full-doc mode, the composition's own `<head>` content (styles, scripts,
 * links, meta) is appended AFTER the project's index.html head. When both
 * declare the same dependency (e.g. GSAP CDN), the composition's copy wins
 * by last-write-wins script execution order — this is intentional so the
 * composition can pin a specific version.
 */
declare function buildSubCompositionHtml(projectDir: string, compPath: string, runtimeUrl: string, baseHref?: string, rawOverride?: string): string | null;

interface ThumbnailOutputDimensions {
    width: number;
    height: number;
    outputWidth: number;
    outputHeight: number;
}
/** Sole adapter rule for capturing authored layout at bounded physical dimensions. */
declare function thumbnailDeviceScaleFactor({ width, height, outputWidth, outputHeight, }: ThumbnailOutputDimensions): number;

type BackgroundRemovalJobOptions = Parameters<NonNullable<StudioApiAdapter["startBackgroundRemoval"]>>[0];
type BackgroundRemovalProgressEvent = {
    kind: "info";
    message: string;
} | {
    kind: "metadata";
    width: number;
    height: number;
    fps: number;
    frameCount: number;
} | {
    kind: "frame";
    index: number;
    total: number;
    avgMsPerFrame: number;
};
type BackgroundRemovalRender = (options: {
    inputPath: string;
    outputPath: string;
    backgroundOutputPath?: string;
    device?: BackgroundRemovalJobOptions["device"];
    quality?: BackgroundRemovalJobOptions["quality"];
    onProgress?: (event: BackgroundRemovalProgressEvent) => void;
}) => Promise<{
    provider: string;
    framesProcessed: number;
    durationSeconds: number;
    avgMsPerFrame: number;
}>;
declare function createBackgroundRemovalJob(opts: BackgroundRemovalJobOptions, render: BackgroundRemovalRender): MediaProcessingJobState;

export { type BackgroundRemovalRender, type FileWriteReceipt, MIME_TYPES, MediaProcessingJobState, StudioApiAdapter, type ThumbnailOutputDimensions, buildSubCompositionHtml, consumeFileWriteReceipt, createBackgroundRemovalJob, createProjectSignature, createStudioApi, fileContentVersion, getMimeType, thumbnailDeviceScaleFactor, walkDir };
