// THE aggregation point. Every public global the SDK provides is re-exported here under the exact
// name user code uses it as. The bundler passes this file to esbuild's `inject:` option, so user
// code references `Scene`, `Sprite`, `toast`, … with no imports; esbuild tree-shakes away whatever
// a given project does not use (so a pure-2D project drops all 3D classes, and vice versa).
//
// Rule: this is the ONLY file that `export`s public names. Everything else is internal and imported
// by it. Host-provided globals (setLoop, console, setTimeout, DEG2RAD, asset, …) are NOT here —
// they live in src/host.d.ts as declarations and stay as free references at runtime.

// ---- math ----
export { Mathf } from "./math/Mathf"
export { Vec2, Vec3 } from "./math/vec"
export { Quat } from "./math/quat"
export { Mat4 } from "./math/mat4"
export { Color } from "./core/color"

// ---- aspects (attachable node capabilities) ----
export { Aspect, type With } from "./core/Aspect"

// ---- reactivity (signals; UI text/style props also accept `() => value` bindings) ----
export { signal, computed, effect, type Signal, type Computed } from "./core/signals"

// ---- canvas (core 2D drawing that bakes to a texture; shared by 2D/3D/UI) ----
export { Canvas, Bitmap } from "./canvas/Canvas"

// ---- platform runtime (injected globals; the host provides the lower-level _creator* bridges) ----
export { toast, SvgSource } from "./runtime/misc"
export { fetch, fetchLocal, FormData, File } from "./runtime/fetch"
export { localStorage } from "./runtime/storage"
export { device } from "./runtime/device"
export { Input } from "./runtime/input"
export { WebSocket } from "./runtime/net"
export { AudioPlayer, VideoPlayer } from "./runtime/media"
export { CameraViewer } from "./runtime/camera"
export { openFilePicker } from "./runtime/files"
export { share } from "./runtime/share"
export { ClickEvent, TouchStartEvent } from "./runtime/touch"

// ---- 2D engine (creator-2d) ----
export { Scene2D } from "./g2/Scene2D"
export { Node2D } from "./g2/Node2D"
export { Camera2D } from "./g2/Camera2D"
export { Sprite } from "./g2/Sprite"
export { SpriteAnimation } from "./g2/SpriteAnimation"
export { Shape2D } from "./g2/Shape2D"
export { Physics2D } from "./g2/Physics2D"
export { Trigger2D } from "./g2/Trigger2D"
export { CharacterController2D } from "./g2/CharacterController2D"
export { Tilemap } from "./g2/Tilemap"
export { Texture2D } from "./g2/Texture2D"

// ---- UI (creator-ui) ----
export {
  UIScreen, type UIScreenStyle,
  UIRow, UIColumn, UIBox, type UIContainerStyle,
  UIText, type UITextStyle,
  UIButton, type UIButtonStyle,
  UIImage, type UIImageStyle,
  UIVideo, type UIVideoStyle,
  UIInput, UITextArea, type UIInputStyle,
  UIScrollable, type UIScrollableStyle,
  UIWidget, type UIWidgetStyle,
  UISpacer, type UISpacerStyle,
  UIVirtualizedList,
  Router,
  registerFont,
  __uiMap,
} from "./ui/UI"
// The base node type + the union a container accepts as children — documented as the signature of
// UIColumn/UIRow/append/etc., so they must be global (type-only; erased at runtime).
export type { UINode, UINodeChild } from "./ui/UINode"

// ---- animate ----
export { animate, animateMat4, stopAnimation, pauseAnimation, resumeAnimation } from "./animate/animate"
export { cubicBezier } from "./animate/bezier"
export { easeIn, easeOut, easeInOut } from "./animate/easings"

// ---- plugins (optional, host-provided capabilities — see src/plugins/) ----
export { QRScanner } from "./plugins/qr"

// ---- 3D engine (creator-gl) ----
export { Scene, ARScene, VRScene } from "./gl/Scene"
export { Node } from "./gl/Node"
export { Mesh } from "./gl/Mesh"
export { Model } from "./gl/Model"
export { Shape } from "./gl/Shape"
export { Physics } from "./gl/Physics"
export { Trigger } from "./gl/Trigger"
export { CharacterController } from "./gl/CharacterController"
export { ModelAnimation } from "./gl/ModelAnimation"
export { Light } from "./gl/Light"
export { Material } from "./gl/Material"
export { Geometry } from "./gl/Geometry"
export { Texture } from "./gl/Texture"
export { Camera } from "./gl/Camera"
export { Ray } from "./gl/Ray"
export { Plane } from "./gl/Plane"
export { Noise } from "./gl/Noise"
export { Particles, dynamic, dynamicColor } from "./gl/Particles"
