/**
 * Runtime Types
 *
 * Shared types for runtime presentation (runtime.tsx, RuntimePresentation.tsx).
 * These extend the minimal preload types with additional runtime-specific fields.
 */

import type { PreloadPage, PreloadPageLink, PreloadElement } from './preload';

/**
 * Runtime project data
 */
export interface RuntimeProject {
  id: string;
  name?: string;
  slug?: string;
  description?: string;
  logo_url?: string;
  favicon_url?: string;
  og_image_url?: string;
}

/**
 * Runtime page - extends PreloadPage with display/navigation fields
 */
export interface RuntimePage extends PreloadPage {
  slug?: string;
  name?: string;
  sort_order?: number;
  ui_schema_json?: string;
  environment?: 'dev' | 'stage' | 'production';
}

/**
 * Runtime page link - extends PreloadPageLink with navigation fields
 */
export interface RuntimePageLink extends PreloadPageLink {
  transitionId?: string;
  direction?: string;
  external_url?: string;
  trigger_selector?: string;
}

/**
 * Runtime element - extends PreloadElement with positioning/visibility
 */
export interface RuntimeElement extends PreloadElement {
  name?: string;
  sort_order?: number;
  is_visible?: boolean;
  x_percent?: number;
  y_percent?: number;
  width_percent?: number;
  height_percent?: number;
  rotation_deg?: number;
  style_json?: string;
}

/**
 * Runtime transition data
 */
export interface RuntimeTransition {
  id: string;
  name?: string;
  slug?: string;
  video_url?: string;
  duration_sec?: number;
  supports_reverse?: boolean;
}

/**
 * State for transition overlay during page navigation
 */
export interface TransitionOverlayState {
  targetPageId: string;
  transitionName: string;
  videoUrl: string;
  isReverse: boolean;
  durationSec?: number;
}
