Files
downlink/lib/types.ts
2025-12-21 11:43:22 -06:00

40 lines
800 B
TypeScript

export type VideoFormat = 'mp4' | 'webm' | 'mkv' | 'avi';
export type AudioFormat = 'mp3' | 'wav' | 'm4a' | 'opus';
export type FormatType = 'video' | 'audio';
export interface DownloadRequest {
url: string;
format: VideoFormat | AudioFormat;
formatType: FormatType;
}
export interface DownloadResponse {
success: boolean;
downloadUrl?: string;
filename?: string;
error?: string;
videoInfo?: VideoInfo;
}
export interface VideoInfo {
title: string;
duration: number;
thumbnail?: string;
formats?: FormatOption[];
}
export interface FormatOption {
formatId: string;
ext: string;
resolution?: string;
filesize?: number;
formatNote?: string;
}
export interface TranscodeRequest {
fileId: string;
format: VideoFormat | AudioFormat;
formatType: FormatType;
}