/**
 * Generation Types
 * 
 * Type definitions for generation-related data structures
 */

/**
 * Video input configuration for generation
 */
export interface VideoInput {
  /** Input image URL or base64 */
  image?: string;
  /** Video URL for video-to-video generation */
  video?: string;
  /** Start time for video input (seconds) */
  startTime?: number;
  /** End time for video input (seconds) */
  endTime?: number;
  /** Frame rate for video processing */
  frameRate?: number;
}

/**
 * Generation history item
 */
export interface GenerationHistoryItem {
  /** Unique identifier */
  id: string;
  /** Generation type */
  type: 'image' | 'video' | 'audio';
  /** Generated content URL */
  src: string;
  /** Item title/name */
  title?: string;
  /** Thumbnail URL (for videos) */
  thumbnail?: string;
  /** Generation prompt */
  prompt?: string;
  /** Model used for generation */
  model?: string;
  /** Generation timestamp */
  timestamp: number;
  /** Generation context (for regeneration) */
  context?: GenerationContext;
  /** Generation metadata */
  metadata?: GenerationMetadata;
}

/**
 * Generation context for regeneration
 */
export interface GenerationContext {
  /** Node ID that triggered generation */
  nodeId?: string;
  /** Canvas ID */
  canvasId?: string;
  /** Project ID */
  projectId?: string;
  /** Asset ID (for asset-related generation) */
  assetId?: string | null;
  /** Storyboard ID (for storyboard-related generation) */
  storyboardId?: string | null;
  /** Input image (for image-to-image/image-to-video) */
  inputImage?: string;
  /** Reference images */
  referenceImages?: string[];
  /** Video input configuration */
  videoInput?: VideoInput;
  /** Audio URL */
  audioUrl?: string;
  /** Additional parameters */
  params?: Record<string, unknown>;
}

/**
 * Generation metadata
 */
export interface GenerationMetadata {
  /** Generation duration (ms) */
  duration?: number;
  /** Generation status */
  status?: 'pending' | 'processing' | 'success' | 'failed';
  /** Error message (if failed) */
  error?: string;
  /** Number of retry attempts */
  retryCount?: number;
  /** Generation mode */
  mode?: 'DEFAULT' | 'CONTINUE' | 'FIRST_LAST_FRAME' | 'CUT' | 'CHARACTER_REF';
  /** Video duration (for video generation) */
  videoDuration?: string;
  /** Resolution */
  resolution?: string;
  /** Aspect ratio */
  aspectRatio?: string;
}

/**
 * Asset information
 */
export interface AssetInfo {
  /** Asset ID */
  id: string;
  /** Asset type */
  type: 'character' | 'scene' | 'prop';
  /** Asset name */
  name: string;
  /** Asset description */
  description?: string;
  /** Asset image URL */
  imageUrl?: string;
  /** Asset tags */
  tags?: string[];
  /** Asset metadata */
  metadata?: Record<string, unknown>;
}

/**
 * Persona configuration for audio generation
 */
export interface PersonaConfig {
  /** Persona ID */
  id: string;
  /** Persona name */
  name: string;
  /** Voice characteristics */
  voice?: {
    /** Pitch */
    pitch?: number;
    /** Speed */
    speed?: number;
    /** Volume */
    volume?: number;
  };
  /** Additional parameters */
  params?: Record<string, unknown>;
}

/**
 * Emotion configuration for audio generation
 */
export interface EmotionConfig {
  /** Emotion type */
  type: 'neutral' | 'happy' | 'sad' | 'angry' | 'surprised' | 'fearful';
  /** Emotion intensity (0-1) */
  intensity?: number;
  /** Additional parameters */
  params?: Record<string, unknown>;
}
