import { ViewerPosition, AspectRatio } from '../types/viewer'; import { SlideControlsPosition } from '../types/controls'; import { GatingConfig } from '../gating'; import { ThemeMode, PresentationThemeConfig } from '../styles/theme-overrides'; /** * Viewer configuration options */ export interface ViewerConfig { /** * Viewer position on screen * @default 'fullscreen' */ position?: ViewerPosition; /** * Show loading indicator while initializing * @default true */ showLoading?: boolean; /** * Custom loading message * @default 'Loading presentation...' */ loadingMessage?: string; /** * Aspect ratio for video display * @default 'auto' */ aspectRatio?: AspectRatio; /** * Show manual slide controls * @default true */ showControls?: boolean; /** * Position of slide controls * @default 'bottom-center' */ controlsPosition?: SlideControlsPosition; } /** * Presentation configuration options * * Configures the LiveKit-based presentation with voice agent integration * and slide display. */ export interface PresentationConfig { /** * Client ID (required) - the company embedding the demo * @required */ clientId: string; /** * Deck ID to present * @required */ deckId: string; /** * Supabase project URL * @required */ supabaseUrl: string; /** * Supabase anonymous key * @required */ supabaseKey: string; /** * Backend API base URL * @default 'https://slide-api-production.up.railway.app' */ apiUrl?: string; /** * Viewer configuration */ viewer?: ViewerConfig; /** * Theme mode * @default 'auto' */ theme?: ThemeMode; /** * Custom theme configuration */ themeConfig?: PresentationThemeConfig; /** * Optional gating configuration for lead capture */ gating?: GatingConfig; /** * Customer metadata for session tracking */ customerInfo?: { name?: string; email?: string; [key: string]: unknown; }; /** * Enable debug logging * @default false */ debug?: boolean; /** * Called when presentation starts */ onStart?: () => void; /** * Called when presentation ends */ onEnd?: () => void; /** * Called on presentation errors */ onError?: (error: Error) => void; /** * Called when presentation state changes */ onStateChange?: (state: PresentationState) => void; } /** * Presentation state */ export type PresentationState = 'idle' | 'connecting' | 'connected' | 'disconnected' | 'error'; /** * Presentation instance returned by createPresentation() */ export interface Presentation { /** * Unique session ID for this presentation */ readonly sessionId: string; /** * Start the presentation * * Creates LiveKit session, spawns bots, and joins room. */ start(): Promise; /** * End the presentation * * Disconnects from room and cleans up resources. */ end(): Promise; /** * Get current presentation state */ getState(): PresentationState; /** * Destroy and cleanup all resources */ destroy(): void; } /** * Create a presentation instance * * Initializes a LiveKit-based presentation with voice agent integration * and slide display. The presentation can be started immediately or after * showing a gating form for lead capture. * * @param containerOrId - DOM container element or element ID * @param config - Presentation configuration options * @returns Presentation instance with control methods * * @throws {Error} If container element is not found * @throws {Error} If required config fields are missing * * @example * ```typescript * // Create and start presentation * const presentation = createPresentation('container', { * clientId: 'acme-corp', * deckId: 'deck-123', * supabaseUrl: 'https://project.supabase.co', * supabaseKey: 'your-key', * onStart: () => console.log('Presentation started'), * onEnd: () => console.log('Presentation ended') * }); * * await presentation.start(); * ``` * * @example * ```typescript * // With gating form * const presentation = createPresentation('container', { * clientId: 'acme-corp', * deckId: 'deck-123', * supabaseUrl: 'https://project.supabase.co', * supabaseKey: 'your-key', * gating: { * enabled: true, * fields: ['email', 'name', 'company'] * } * }); * * await presentation.start(); * ``` */ export declare function createPresentation(containerOrId: string | HTMLElement, config: PresentationConfig): Presentation; /** * End an active presentation by session ID * * Disconnects from the LiveKit room and cleans up all resources * for the specified session. * * @param sessionId - Session ID of presentation to end * * @example * ```typescript * const presentation = createPresentation('container', config); * const sessionId = presentation.sessionId; * * // Later... * await endPresentation(sessionId); * ``` */ export declare function endPresentation(sessionId: string): Promise;