/**
 * @file puppetShowTypes.ts
 * @description Puppet Show format - animated episodes compatible with NicePresentations
 *
 * Puppet Shows are essentially animated presentations with:
 * - Animated characters (puppets) with sprite-based animations
 * - Scene-based timeline with keyframes
 * - Audio/voice tracks synchronized to animations
 * - Limited playback interaction (play, pause, speed control)
 * - Full compatibility with NicePresentations for editing
 */
export interface NicePuppetShowDocument {
    /** Format version */
    version: '1.0';
    /** Unique document ID */
    id: string;
    /** Show title */
    title: string;
    /** Author/creator */
    author?: string;
    /** Stage dimensions */
    stageSize: StageSize;
    /** All scenes in order */
    scenes: PuppetScene[];
    /** Character library */
    characters: PuppetCharacterDef[];
    /** Prop/asset library */
    props: PuppetPropDef[];
    /** Audio tracks library */
    audioTracks: AudioTrackDef[];
    /** Global settings */
    settings: PuppetShowSettings;
    /** Metadata */
    metadata: PuppetShowMetadata;
}
export interface StageSize {
    width: number;
    height: number;
    aspectRatio?: '16:9' | '4:3' | '21:9' | 'custom';
}
export interface PuppetShowSettings {
    /** Default animation FPS */
    defaultFps: number;
    /** Allow viewer speed control */
    allowSpeedControl: boolean;
    /** Allow skip/seek */
    allowSeek: boolean;
    /** Auto-play on load */
    autoPlay: boolean;
    /** Show playback controls */
    showControls: boolean;
    /** Loop entire show */
    loop: boolean;
    /** Theme/style preset */
    theme?: 'classic' | 'modern' | 'cartoon' | 'realistic' | 'custom';
}
export interface PuppetShowMetadata {
    createdAt: string;
    updatedAt: string;
    duration: number;
    sceneCount: number;
    characterCount: number;
    tags?: string[];
    description?: string;
    thumbnail?: string;
    author?: string;
    /** Link to source NiceGameEngine project */
    gameEngineProjectId?: string;
    /** Source presentation ID (when converted from slides) */
    sourcePresentation?: string;
    /** IDs of shows that were merged into this one */
    mergedFrom?: string[];
    /** When merged/converted */
    mergedAt?: string;
    convertedAt?: string;
}
export interface PuppetCharacterDef {
    /** Unique character ID */
    id: string;
    /** Display name */
    name: string;
    /** Character type */
    type: CharacterType;
    /** Sprite sheet or vector definition */
    visual: CharacterVisual;
    /** Available animations */
    animations: CharacterAnimation[];
    /** Available expressions/emotions */
    expressions: CharacterExpression[];
    /** Voice settings */
    voice?: CharacterVoice;
    /** Default scale */
    defaultScale: number;
    /** Anchor point for positioning */
    anchor: {
        x: number;
        y: number;
    };
}
export type CharacterType = 'sprite' | 'vector' | 'skeletal' | 'live2d' | 'cutout';
export interface CharacterVisual {
    type: CharacterType;
    /** For sprites: sprite sheet URL */
    spriteSheet?: string;
    /** For sprites: atlas JSON */
    atlas?: SpriteAtlas;
    /** For vector: SVG content or URL */
    svg?: string;
    /** For skeletal: skeleton data URL */
    skeletonData?: string;
    /** Base dimensions */
    width: number;
    height: number;
}
export interface SpriteAtlas {
    frames: Record<string, SpriteFrame>;
    meta: {
        image: string;
        size: {
            w: number;
            h: number;
        };
        scale: number;
    };
}
export interface SpriteFrame {
    frame: {
        x: number;
        y: number;
        w: number;
        h: number;
    };
    rotated: boolean;
    trimmed: boolean;
    spriteSourceSize: {
        x: number;
        y: number;
        w: number;
        h: number;
    };
    sourceSize: {
        w: number;
        h: number;
    };
}
export interface CharacterAnimation {
    /** Animation ID */
    id: string;
    /** Display name */
    name: string;
    /** Animation category */
    category: AnimationCategory;
    /** Frames */
    frames: AnimationFrameDef[];
    /** FPS for this animation */
    fps: number;
    /** Loop this animation */
    loop: boolean;
    /** Duration in ms (calculated) */
    duration: number;
}
export type AnimationCategory = 'idle' | 'walk' | 'run' | 'talk' | 'gesture' | 'emotion' | 'action' | 'entrance' | 'exit' | 'custom';
export interface AnimationFrameDef {
    /** Frame identifier (sprite name or index) */
    frameId: string;
    /** Duration override in ms (optional) */
    duration?: number;
    /** Transform offset for this frame */
    offset?: {
        x: number;
        y: number;
    };
    /** Trigger event at this frame */
    event?: string;
}
export interface CharacterExpression {
    id: string;
    name: string;
    /** Emotion category */
    emotion: EmotionType;
    /** Frame or overlay to use */
    frameId?: string;
    /** Facial overlay image */
    overlay?: string;
    /** Blend mode for overlay */
    blendMode?: 'normal' | 'multiply' | 'overlay';
}
export type EmotionType = 'neutral' | 'happy' | 'sad' | 'angry' | 'surprised' | 'scared' | 'confused' | 'thinking' | 'laughing' | 'crying' | 'custom';
export interface CharacterVoice {
    /** Voice synthesizer preset */
    synthesizer?: 'tts' | 'custom';
    /** Voice pitch */
    pitch?: number;
    /** Voice speed */
    rate?: number;
    /** Voice ID for TTS */
    voiceId?: string;
    /** Pre-recorded audio clips */
    audioClips?: Record<string, string>;
}
export interface PuppetPropDef {
    id: string;
    name: string;
    type: 'image' | 'sprite' | 'vector' | 'text' | 'shape';
    /** Asset URL or content */
    asset: string;
    /** Dimensions */
    width: number;
    height: number;
    /** Anchor point */
    anchor: {
        x: number;
        y: number;
    };
    /** Available animations */
    animations?: CharacterAnimation[];
    /** Is this a background? */
    isBackground?: boolean;
    /** Z-layer hint */
    layer?: number;
}
export interface SceneBackground {
    type: 'solid' | 'gradient' | 'image' | 'video' | 'parallax';
    color?: string;
    gradient?: GradientDef;
    image?: string;
    video?: string;
    parallaxLayers?: ParallaxLayer[];
    /** Transition effect when entering scene */
    transition?: BackgroundTransition;
}
export interface GradientDef {
    type: 'linear' | 'radial';
    stops: Array<{
        color: string;
        position: number;
    }>;
    angle?: number;
}
export interface ParallaxLayer {
    image: string;
    speed: number;
    repeat?: boolean;
    offset?: {
        x: number;
        y: number;
    };
}
export interface BackgroundTransition {
    type: 'fade' | 'slide' | 'zoom' | 'dissolve' | 'none';
    duration: number;
    easing?: string;
}
export interface AudioTrackDef {
    id: string;
    name: string;
    type: AudioTrackType;
    /** Audio file URL */
    src: string;
    /** Duration in ms */
    duration: number;
    /** Default volume 0-1 */
    volume: number;
    /** Is this music or sfx? */
    category: 'music' | 'sfx' | 'voice' | 'ambient';
}
export type AudioTrackType = 'mp3' | 'ogg' | 'wav' | 'webm';
export interface PuppetScene {
    id: string;
    /** Scene title */
    title: string;
    /** Scene duration in ms */
    duration: number;
    /** Background settings */
    background: SceneBackground;
    /** Characters on stage */
    cast: SceneCastMember[];
    /** Props on stage */
    scenery: SceneProps[];
    /** Timeline of actions */
    timeline: TimelineTrack[];
    /** Scene-level audio */
    audio?: SceneAudio;
    /** Transition to next scene */
    transition?: SceneTransition;
    /** Camera settings */
    camera?: SceneCamera;
}
export interface SceneCastMember {
    /** Reference to character def */
    characterId: string;
    /** Instance ID for this scene */
    instanceId: string;
    /** Starting position */
    position: {
        x: number;
        y: number;
    };
    /** Starting scale */
    scale: number;
    /** Starting rotation */
    rotation: number;
    /** Starting opacity */
    opacity: number;
    /** Facing direction */
    flipX: boolean;
    /** Initial animation */
    initialAnimation?: string;
    /** Initial expression */
    initialExpression?: string;
    /** Z-order */
    zIndex: number;
    /** Enter/appear delay (ms from scene start) */
    enterDelay?: number;
    /** Exit time (ms from scene start) */
    exitTime?: number;
}
export interface SceneProps {
    /** Reference to prop def */
    propId: string;
    /** Instance ID */
    instanceId: string;
    position: {
        x: number;
        y: number;
    };
    scale: number;
    rotation: number;
    opacity: number;
    zIndex: number;
}
export interface SceneAudio {
    /** Background music track ID */
    music?: string;
    /** Music volume override */
    musicVolume?: number;
    /** Ambient sound track ID */
    ambient?: string;
    /** Ambient volume */
    ambientVolume?: number;
}
export interface SceneTransition {
    type: 'cut' | 'fade' | 'slideLeft' | 'slideRight' | 'slideUp' | 'slideDown' | 'zoom' | 'dissolve' | 'wipe';
    duration: number;
    easing?: string;
}
export interface SceneCamera {
    /** Camera position (center point) */
    position: {
        x: number;
        y: number;
    };
    /** Zoom level (1 = 100%) */
    zoom: number;
    /** Camera rotation */
    rotation: number;
}
export interface TimelineTrack {
    /** Track ID */
    id: string;
    /** Track type */
    type: TimelineTrackType;
    /** Target instance ID (character or prop) */
    targetId: string;
    /** Keyframes on this track */
    keyframes: Keyframe[];
    /** Track is muted/disabled */
    muted?: boolean;
    /** Track label */
    label?: string;
}
export type TimelineTrackType = 'animation' | 'transform' | 'expression' | 'dialogue' | 'audio' | 'camera' | 'effect';
export interface Keyframe {
    /** Time position in ms from scene start */
    time: number;
    /** Keyframe data based on track type */
    value: KeyframeValue;
    /** Easing to next keyframe */
    easing?: EasingType;
    /** Duration (for non-instant actions) */
    duration?: number;
}
export type KeyframeValue = AnimationKeyframe | TransformKeyframe | ExpressionKeyframe | DialogueKeyframe | AudioKeyframe | CameraKeyframe | EffectKeyframe;
export interface AnimationKeyframe {
    type: 'animation';
    animationId: string;
    /** Start from specific frame */
    startFrame?: number;
    /** Play speed multiplier */
    speed?: number;
}
export interface TransformKeyframe {
    type: 'transform';
    position?: {
        x: number;
        y: number;
    };
    scale?: number;
    rotation?: number;
    opacity?: number;
    flipX?: boolean;
}
export interface ExpressionKeyframe {
    type: 'expression';
    expressionId: string;
    /** Blend intensity 0-1 */
    intensity?: number;
}
export interface DialogueKeyframe {
    type: 'dialogue';
    /** Text to display */
    text: string;
    /** Dialogue display style */
    style?: DialogueStyle;
    /** Voice audio clip ID */
    audioClip?: string;
    /** Auto-advance after audio */
    autoAdvance?: boolean;
}
export interface DialogueStyle {
    position: 'bubble' | 'bottom' | 'top' | 'side' | 'center';
    backgroundColor?: string;
    textColor?: string;
    fontSize?: number;
    fontFamily?: string;
    bubbleTail?: 'left' | 'right' | 'bottom' | 'none';
    maxWidth?: number;
    animation?: 'typewriter' | 'fade' | 'pop' | 'none';
}
export interface AudioKeyframe {
    type: 'audio';
    trackId: string;
    action: 'play' | 'stop' | 'pause' | 'fadeIn' | 'fadeOut' | 'setVolume';
    volume?: number;
    fadeDuration?: number;
}
export interface CameraKeyframe {
    type: 'camera';
    position?: {
        x: number;
        y: number;
    };
    zoom?: number;
    rotation?: number;
    /** Shake effect */
    shake?: {
        intensity: number;
        duration: number;
    };
    /** Follow target */
    followTarget?: string;
}
export interface EffectKeyframe {
    type: 'effect';
    effectType: VisualEffectType;
    params: Record<string, unknown>;
    duration?: number;
}
export type VisualEffectType = 'flash' | 'shake' | 'blur' | 'vignette' | 'colorFilter' | 'particles' | 'rain' | 'snow' | 'fog' | 'lightning' | 'spotlight';
export type EasingType = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | 'easeInQuad' | 'easeOutQuad' | 'easeInOutQuad' | 'easeInCubic' | 'easeOutCubic' | 'easeInOutCubic' | 'easeInElastic' | 'easeOutElastic' | 'easeInOutElastic' | 'easeInBounce' | 'easeOutBounce' | 'easeInOutBounce' | 'step';
export interface PresentationConversionOptions {
    /** Convert scenes to slides */
    scenesAsSlides?: boolean;
    /** Include animation preview frames */
    includeAnimationPreviews?: boolean;
    /** Flatten timeline to simple animations */
    flattenTimeline?: boolean;
    /** Export dialogue as text elements */
    exportDialogue?: boolean;
    /** Include speaker notes from dialogue */
    dialogueAsNotes?: boolean;
    /** Flatten scenes into multiple slides per scene */
    flattenScenes?: boolean;
    /** Include character sprite images */
    includeCharacterSprites?: boolean;
    /** Include dialogue text */
    includeDialogue?: boolean;
    /** Default slide duration in ms */
    slideDuration?: number;
}
export interface GameEngineImportOptions {
    /** Import sprite sheets */
    importSprites: boolean;
    /** Import animations */
    importAnimations: boolean;
    /** Character entity filter */
    characterFilter?: (entityId: string) => boolean;
    /** Scene/level to import from */
    sourceScene?: string;
}
export interface PuppetShowPlayerState {
    isPlaying: boolean;
    isPaused: boolean;
    currentSceneIndex: number;
    currentTime: number;
    totalDuration: number;
    playbackSpeed: number;
    volume: number;
    isMuted: boolean;
    characterStates: Map<string, CharacterRuntimeState>;
    activeEffects: ActiveEffect[];
    loop: boolean;
}
export interface CharacterRuntimeState {
    instanceId: string;
    characterId: string;
    position: {
        x: number;
        y: number;
    };
    scale: number;
    rotation: number;
    opacity: number;
    flipX: boolean;
    currentAnimation: string;
    animationFrame: number;
    animationStartTime: number;
    currentExpression: string;
    visible: boolean;
}
export interface ActiveEffect {
    effectId: string;
    type: VisualEffectType;
    startTime: number;
    duration: number;
    params: Record<string, unknown>;
    progress: number;
}
//# sourceMappingURL=puppetShowTypes.d.ts.map