/** * Core types for ytranscript */ /** Proxy configuration for HTTP requests */ export interface ProxyConfig { /** HTTP proxy URL (e.g., "http://user:pass@host:port") */ url: string; } /** Represents a single transcript segment with timing information */ export interface TranscriptSegment { /** The text content of this segment */ text: string; /** Start time in seconds */ start: number; /** Duration in seconds */ duration: number; } /** The complete transcript for a video */ export interface Transcript { /** Video ID */ videoId: string; /** Full transcript text (joined segments) */ text: string; /** Individual segments with timestamps */ segments: TranscriptSegment[]; /** Language code (e.g., 'en', 'es') */ language: string; /** Whether this is auto-generated */ isAutoGenerated: boolean; } /** Metadata from Google Takeout watch history */ export interface WatchHistoryMeta { /** Video ID */ videoId: string; /** Video title */ title?: string; /** Full YouTube URL */ url?: string; /** Channel info */ channel?: { name?: string; url?: string; }; /** When the video was watched */ watchedAt?: string; /** Source of this entry */ source: 'history' | 'watch_later' | 'manual'; } /** Result of fetching a transcript */ export interface TranscriptResult { /** Video metadata */ meta: WatchHistoryMeta; /** The transcript (null if failed) */ transcript: Transcript | null; /** Error message if fetch failed */ error?: string; } /** Options for fetching transcripts */ export interface FetchOptions { /** Preferred language codes (in order of preference) */ languages?: string[]; /** Timeout in milliseconds */ timeout?: number; /** Include auto-generated transcripts */ includeAutoGenerated?: boolean; /** Proxy configuration for avoiding rate limits */ proxy?: ProxyConfig; } /** Options for bulk processing */ export interface BulkOptions extends FetchOptions { /** Max concurrent requests */ concurrency?: number; /** Pause duration (ms) after N requests */ pauseAfter?: number; /** Pause duration in ms */ pauseDuration?: number; /** Callback for progress updates */ onProgress?: (completed: number, total: number, result: TranscriptResult) => void; /** Set of already-processed video IDs to skip */ skipIds?: Set; } /** Output format types */ export type OutputFormat = 'json' | 'jsonl' | 'csv' | 'txt' | 'srt' | 'vtt'; /** Options for output writers */ export interface OutputOptions { /** Output file path */ path: string; /** Whether to append to existing file */ append?: boolean; /** Include timestamps in text output */ includeTimestamps?: boolean; } //# sourceMappingURL=types.d.ts.map