jetcrab\api/mod.rs
1//! # JetCrab API Module
2//!
3//! Provides the public API for the JetCrab JavaScript engine, including
4//! high-level interfaces for code execution, compilation, debugging,
5//! and module management.
6//!
7//! ## Overview
8//!
9//! The API module exposes the following main components:
10//!
11//! - **Engine**: Main execution engine for JavaScript code
12//! - **Interpreter**: Bytecode interpreter with execution context
13//! - **Compiler**: Source code to bytecode compilation
14//! - **Debug**: Debugging and profiling tools
15//! - **Events**: Event system for execution monitoring
16//! - **Modules**: Module loading and management system
17//! - **Config**: Engine configuration and settings
18//! - **Error**: API error handling and types
19//!
20//! ## Usage
21//!
22//! ```rust
23//! use jetcrab::api::{Engine, Interpreter, Compiler};
24//!
25//! // Create and use the main engine
26//! let mut engine = Engine::new();
27//! let result = engine.evaluate("2 + 2")?;
28//!
29//! // Use the interpreter directly
30//! let interpreter = Interpreter::new(vec![], vec![]);
31//! let result = interpreter.execute()?;
32//! ```
33
34pub mod compiler;
35pub mod config;
36pub mod debug;
37pub mod engine;
38pub mod error;
39pub mod events;
40pub mod interpreter;
41pub mod modules;
42
43pub use compiler::Compiler;
44pub use config::{EngineConfig, MemoryConfig, ModuleSystem, OptimizationLevel, SecurityLevel};
45pub use debug::{Breakpoint, CallFrame, DebugInfo, Debugger, Inspector, Profiler, ProfilingMetrics};
46pub use engine::Engine;
47pub use error::ApiError;
48pub use events::{CallbackRegistry, EventData, EventEmitter, EventManager, EventChain};
49pub use interpreter::Interpreter;
50pub use modules::{ModuleInfo, ModuleLoader, ModuleProvider, ModuleRegistry, FileSystemModuleProvider};