UNPKG

@pickstar-2002/video-convert-mcp

Version:
86 lines 2.07 kB
import { VideoFormat } from '../types/index.js'; /** * 视频格式验证服务 */ export declare class ValidatorService { private static instance; private readonly supportedFormats; private readonly videoExtensions; private constructor(); static getInstance(): ValidatorService; /** * 验证文件是否存在 */ validateFileExists(filePath: string): Promise<boolean>; /** * 验证文件是否为视频文件 */ validateVideoFile(filePath: string): Promise<{ isValid: boolean; error?: string; }>; /** * 验证输出格式是否支持 */ validateOutputFormat(format: string): { isValid: boolean; error?: string; }; /** * 验证输出路径 */ validateOutputPath(outputPath: string, overwrite?: boolean): Promise<{ isValid: boolean; error?: string; }>; /** * 验证分辨率字符串格式 */ validateResolution(resolution: string): { isValid: boolean; width?: number; height?: number; error?: string; }; /** * 验证码率值 */ validateBitrate(bitrate: number, type: 'video' | 'audio'): { isValid: boolean; error?: string; }; /** * 验证帧率 */ validateFrameRate(frameRate: number): { isValid: boolean; error?: string; }; /** * 批量验证输入文件 */ validateInputFiles(filePaths: string[]): Promise<{ validFiles: string[]; invalidFiles: Array<{ path: string; error: string; }>; }>; /** * 获取支持的格式列表 */ getSupportedFormats(): VideoFormat[]; /** * 获取格式的MIME类型 */ getFormatMimeTypes(format: VideoFormat): string[]; /** * 检查文件名是否有效 */ private isValidFileName; /** * 清理文件名,移除非法字符 */ sanitizeFileName(fileName: string): string; } //# sourceMappingURL=validator.d.ts.map