export type User = { nickname: string; avatar_url: string | null };

export type Comment = {
  cid: string;
  text: string;
  digg_count: number;
  created_at: string | Date;
  user: User;
  images?: { url: string; width?: number; height?: number }[];
};

export type VideoData = {
  type: "video";
  aweme_id: string;
  cover_url: string;
  cover_size: {w: number; h: number};
  desc: string;
  created_at: string | Date;
  duration_ms: number | null;
  video_url: string;
  width: number | null;
  height: number | null;
  author: User;
  commentsCount: number;
  likesCount: number;
};

export type ImageData = {
  type: "image";
  aweme_id: string;
  cover_url: string;
  cover_size: {w: number; h: number};
  desc: string;
  created_at: string | Date;
  images: { id: string; url: string; width: number | null; height: number | null; animated: string | null; duration: number | null }[];
  music_url: string | null;
  author: User;
  commentsCount: number;
  likesCount: number;
};

export type AwemeData = VideoData | ImageData;

export type VideoTranscript = {
  speech_detected: boolean;
  language: string | null;
  transcript: string[];
};

export type Neighbors = {
  prev: { aweme_id: string } | null;
  next: { aweme_id: string } | null;
};

export type LoopMode = "loop" | "sequential";
export type ObjectFit = "contain" | "cover";
