export interface SubtitleStyle {
  fontSize?: number;
  color?: string;
  highlightColor?: string;
  bold?: boolean;
  hasShadow?: boolean;
  shadowColor?: string;
  shadowAlpha?: number;
  transformY?: number;
  alignment?: number;
  inAnimation?: string;
  outAnimation?: string;
}

export interface KeywordStyle {
  textEffect?: string;
  fontSize?: number;
  color?: string;
  bold?: boolean;
  transformY?: number;
  inAnimation?: string;
  outAnimation?: string;
  inAnimDuration?: number;
  outAnimDuration?: number;
}

export interface TransitionConfig {
  name: string;
  duration: number;
}

export interface TransitionsConfig {
  strategy?: string;
  default?: TransitionConfig;
  byPosition?: Record<string, TransitionConfig>;
  byDirector?: Record<string, TransitionConfig>;
}

export interface KenBurnsParams {
  startScale?: number;
  scaleRate?: number;
  panXRate?: number;
  panYRate?: number;
}

export interface KenBurnsConfig {
  enabled?: boolean;
  default?: KenBurnsParams;
  byDirector?: Record<string, KenBurnsParams>;
}

export interface CapCutConfig {
  effects?: string[];
  filter?: string;
  subtitleStyle?: SubtitleStyle;
  keywordStyle?: KeywordStyle;
  transitions?: TransitionsConfig;
  kenBurns?: KenBurnsConfig;
  defaultBGM?: string;
}

export interface ReferenceItem {
  file: string;
  url?: string;
}

export interface Account {
  id: string;
  name: string;
  description: string;
  pipeline?: string;
  defaultFormat: string;
  imageModel: string;
  videoModel: string;
  batchSize: number;
  styles?: Record<string, { references: ReferenceItem[] }>;
  ttsVoice: string;
  ttsInstruction: string;
  storyboardPrompt: string;
  imageStylePrompt: string;
  videoStylePrompt: string;
  references: ReferenceItem[];
  capcut: CapCutConfig;
}

export interface Conversation {
  id: string;
  title: string;
  account_id: string | null;
  pinned: number;
  created_at: string;
  updated_at: string;
}

export interface Message {
  id: string;
  conversation_id: string;
  role: 'user' | 'assistant' | 'system' | 'tool';
  content: string;
  reasoningContent?: string;
  tool_calls?: unknown;
  created_at: string;
}

export interface Asset {
  id: string;
  account_id: string | null;
  manifest_path: string | null;
  type: 'image' | 'video';
  file_path: string;
  url: string | null;
  shot_index: number | null;
  created_at: string;
}

export interface ConfigItem {
  id: string;
  key: string;
  value: Record<string, unknown> | string;
  updated_at: string;
}
