/** * Stream persistence layer — overlay layout and visual/voice settings I/O. * * Extracted from stream-routes.ts to keep that file focused on route handling. * All functions here deal with reading/writing JSON files under the * `data/stream/` directory. * * @module api/stream-persistence */ import type { StreamingDestination } from "./streaming-types"; export interface StreamVoiceSettings { enabled: boolean; provider?: string; autoSpeak?: boolean; } export interface StreamVisualSettings { theme?: string; avatarIndex?: number; voice?: StreamVoiceSettings; } /** Sanitize destination ID for use as a filename segment. */ export declare function safeDestId(id: string): string; /** Extract `?destination=` from the raw request URL. */ export declare function parseDestinationQuery(url?: string): string | undefined; /** * Read overlay layout for a destination. * Falls back: destination-specific -> global -> plugin default -> null. */ export declare function readOverlayLayout(destinationId?: string | null, destination?: StreamingDestination): unknown; /** Write overlay layout (to destination-specific or global file). */ export declare function writeOverlayLayout(layout: unknown, destinationId?: string | null): void; /** * Seed the plugin's default overlay layout on first stream start. * Only writes if no destination-specific layout file exists yet. */ export declare function seedOverlayDefaults(destination: StreamingDestination): void; /** * Validate and sanitize a raw settings object into a safe StreamVisualSettings. * Only allows known keys with expected types — rejects everything else. * Returns null with an error message if validation fails. */ export declare function validateStreamSettings(raw: unknown): { settings: StreamVisualSettings; error?: undefined; } | { settings?: undefined; error: string; }; export declare function readStreamSettings(): StreamVisualSettings; export declare function writeStreamSettings(settings: StreamVisualSettings): void; /** * Build the visual config for browser-capture by merging: * 1. Server-side stream-settings.json (authoritative) * 2. Environment variables (STREAM_THEME, STREAM_AVATAR_INDEX) as fallback * * Reads the active destination's overlay layout when available. */ export declare function getHeadlessCaptureConfig(destinationId?: string | null): { overlayLayout?: string; theme?: string; avatarIndex?: number; destinationId?: string; }; //# sourceMappingURL=stream-persistence.d.ts.map