import { VideoService } from "./service" import { Type, Static, TSchema } from '@sinclair/typebox' export type VideoData = Static>> export const VideoData = (T: T) => Type.Object({ url: Type.String(), videoId: Type.String(), host: T, duration: Type.Optional(Type.Number()), isStream: Type.Optional(Type.Boolean()), title: Type.Optional(Type.String()), localizedTitle: Type.Optional(Type.String()), description: Type.Optional(Type.String()), subtitles: Type.Optional(Type.Array(VideoDataSubtitle)), detectedLanguage: Type.Optional(RequestLang), translationHelp: Type.Optional(Type.Union([ Type.Array(TranslationHelp), Type.Null() ])) }) export type AtLeast = Static>> export const AtLeast = (T: T, K: K) => Type.Intersect([ Type.Partial(T), Type.Pick(T, K) ]) export type MinimalVideoData = Static>> export const MinimalVideoData = (T: T) => AtLeast(VideoData(T), Type.Literal("url"))