@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
47 lines • 1.64 kB
TypeScript
import type { VideoProps, VideoRenderResult, EnhancedVideoProps, TsVideosConfig, ProcessedVideoResult, } from '../types';
/**
* Render a video component
*
* Supports both standard VideoProps and EnhancedVideoProps with ts-videos integration.
*
* @example
* ```typescript
* // Native HTML5 video
* const result = await renderVideoComponent({
* src: '/videos/intro.mp4',
* poster: '/images/poster.jpg',
* controls: true,
* lazy: true,
* })
*
* // With ts-video-player for advanced features
* const result = await renderVideoComponent({
* src: 'https://youtube.com/watch?v=xxx',
* player: 'ts-video',
* lazy: true,
* })
*
* // With ts-videos processing
* const result = await renderVideoComponent({
* src: '/videos/raw.mov',
* process: true,
* quality: 'high',
* generatePoster: { timestamp: 5 },
* streaming: { format: 'hls' },
* }, { tsVideosConfig: { enabled: true, outputDir: 'dist/videos' } })
* ```
*/
export declare function renderVideoComponent(props: VideoProps | EnhancedVideoProps, context?: { isDev?: boolean } | ExtendedVideoRenderContext): Promise<VideoRenderResult>;
/**
* Parse @video directive options (legacy - use videoDirective instead)
*/
export declare function parseVideoDirectiveOptions(content: string, params: Record<string, unknown>, context: Record<string, unknown>): VideoProps;
/**
* Extended video render context with ts-videos config
*/
export declare interface ExtendedVideoRenderContext {
isDev?: boolean
tsVideosConfig?: TsVideosConfig
processedResult?: ProcessedVideoResult
}
export { createVideoDirective, videoDirective } from './directive';