/**
 * Публичный API движка. Игры импортируют ТОЛЬКО отсюда.
 */

// re-export PixiJS-типов, чтобы игре не нужен был прямой импорт pixi.js
export { Container, Graphics, Text, Sprite, Texture } from 'pixi.js';

// core
export { Engine, type EngineOptions } from './core/Engine';
export { GameLoop } from './core/GameLoop';
export { EventBus } from './core/EventBus';
export { TweenManager, type TweenOptions, type TweenHandle } from './core/Tween';
export {
    linear,
    quadIn,
    quadOut,
    cubicIn,
    cubicOut,
    sineInOut,
    type EaseFn
} from './core/easing';

// state (см. core)
export { GameState, type GameStateData } from './core/GameState';
export { StateMachine, type StateDef } from './core/StateMachine';
export { Cooldown } from './core/Cooldown';
export { Settings, type SettingsData } from './core/Settings';

// inventory
export { Inventory, inventoryFromData, type InventoryData } from './inventory/Inventory';
// cutscene
export { CutsceneRunner, type CutsceneStep } from './cutscene/CutsceneRunner';

// scene
export { SceneManager, type Scene, type SceneTransition } from './scene/SceneManager';

// ecs
export { World, type Entity, type System } from './ecs/ecs';

// math
export { vec2, add, sub, len, dist, moveTo, type Vec2 } from './math/Vec2';
export {
    isoToScreen,
    screenToIso,
    screenToIsoExact,
    worldToScreen,
    screenToWorld,
    unitsToPx,
    pxToUnits,
    worldLen,
    worldNorm,
    worldDist,
    moveTowardsW,
    tileToWorld,
    worldToTile,
    worldRectToScreen,
    DEFAULT_ISO,
    type IsoLayout
} from './math/iso';
export { createRng, type Rng } from './math/rng';
export {
    inCircle,
    inCircleW,
    inCone,
    inConeW,
    angleBetween,
    nearest
} from './math/shapes';

// map
export { IsometricTileMap, type TileMapData, type TallSpec } from './map/IsometricTileMap';
export { findPath, findPathToNeighbor, type Grid } from './map/pathfinding';
export {
    encodeMap,
    parseMap,
    type MapFile,
    type MapFileV1
} from './map/mapFormat';
export { fromTiledIso, type TiledMap } from './map/tiled';

// render
export { Renderer, type RendererOptions } from './render/Renderer';
export { Camera } from './render/Camera';
export { IsoDepthLayer } from './render/IsoDepthLayer';
export { computeScale } from './render/scale';
export { ParticleEmitter, type EmitterOptions } from './render/Particles';
export { Shake } from './render/shake';
export { SpriteFlash } from './render/spriteFx';
export {
    stepParticle,
    sampleSpawn,
    sampleBurst,
    type ParticleState
} from './render/particleSim';

// input
export { InputManager, type PointerState } from './input/InputManager';
export { VirtualJoystick, type VirtualJoystickOptions } from './input/VirtualJoystick';

// anim
export { FrameAnimation } from './anim/FrameAnimation';
export { TintFlash, lerpColor } from './anim/flash';

// dialogue
export {
    DialogueRunner,
    type DialogueGraph,
    type DialogueNode,
    type DialogueChoice,
    type DialogueView
} from './dialogue/DialogueRunner';

// ui
export { DialogueBox, type DialogueLine, type DialogueBoxOptions } from './ui/DialogueBox';
export { PixelText, type PixelTextOptions, ensurePixelFont, setPixelTextResolution } from './ui/PixelText';
export { Panel, type PanelOptions } from './ui/Panel';
export { Button, type ButtonOptions } from './ui/Button';
export { MenuList, type MenuListOptions } from './ui/MenuList';

// audio
export { AudioManager, type AudioBuses } from './audio/AudioManager';

// assets
export { AssetLoader } from './assets/AssetLoader';

// save
export { SaveManager, type StorageLike } from './save/SaveManager';

// debug
export { DebugOverlay } from './debug/DebugOverlay';
export { SpriteDebugView } from './ui/SpriteDebugView';