import type { Config, Nullable } from "../types/index.js"; /** * A quality preset that sets multiple configuration values at once. */ export interface QualityPreset { description: string; id: string; name: string; values: Record; } /** * Available video quality presets. These presets configure viewport dimensions, video bitrate, and frame rate for common use cases. The presets are ordered from lowest * to highest quality. */ export declare const VIDEO_QUALITY_PRESETS: QualityPreset[]; /** * Returns the list of valid preset IDs. * @returns Array of preset ID strings. */ export declare function getValidPresetIds(): string[]; /** * Returns the viewport dimensions for the currently configured quality preset. This function derives viewport on-demand from the preset rather than storing it in * CONFIG. The CONFIG parameter is passed explicitly to avoid circular dependency issues between presets.ts and config/index.ts. * * WARNING: This function returns the configured preset viewport without considering display limitations. For runtime operations (stream capture, window sizing), use * getEffectiveViewport() instead, which accounts for display size constraints. * @param config - The configuration object containing the quality preset. * @returns The viewport dimensions for the configured preset, or default 720p dimensions if preset not found. */ export declare function getPresetViewport(config: Config): { height: number; width: number; }; /** * Result of effective preset resolution, containing both configured and effective presets along with degradation status. */ export interface EffectivePresetResult { configuredPreset: QualityPreset; degraded: boolean; effectivePreset: QualityPreset; maxViewport: Nullable<{ height: number; width: number; }>; } /** * Finds the largest preset that fits within the given maximum dimensions. Presets are checked from highest to lowest resolution (4K down to 480p). * @param maxWidth - Maximum available viewport width. * @param maxHeight - Maximum available viewport height. * @returns The largest fitting preset, or null if no preset fits (extremely small display). */ export declare function findBestFittingPreset(maxWidth: number, maxHeight: number): Nullable; /** * Resolves the effective preset to use based on the configured preset and display limitations. If the configured preset fits within the display, it is returned * unchanged. Otherwise, the largest fitting preset is selected. * @param config - The configuration object containing the quality preset. * @returns The effective preset result with configured preset, effective preset, and degradation status. */ export declare function getEffectivePreset(config: Config): EffectivePresetResult; /** * Returns the effective viewport dimensions accounting for display limitations. This is the primary function for runtime code paths that need viewport dimensions * for stream capture and window sizing. * @param config - The configuration object containing the quality preset. * @returns The effective viewport dimensions. */ export declare function getEffectiveViewport(config: Config): { height: number; width: number; }; /** * Formats the preset status for display in logs, health endpoint, and UI. Returns a concise string showing the configured preset and any degradation. * @param result - The effective preset result from getEffectivePreset(). * @returns Formatted status string. */ export declare function formatPresetStatus(result: EffectivePresetResult): string; /** * A preset option with degradation information for UI display. */ export interface PresetOption { preset: QualityPreset; degradedTo: Nullable; } /** * Result of preset options with display capability information. */ export interface PresetOptionsResult { maxViewport: Nullable<{ height: number; width: number; }>; options: PresetOption[]; } /** * Returns all preset options with degradation information for UI display. Each preset includes information about what it will degrade to (if anything) based on * current display capabilities. If display detection hasn't completed yet, all presets are returned without degradation information. * @returns Preset options with degradation status and max viewport info. */ export declare function getPresetOptionsWithDegradation(): PresetOptionsResult;