Datatypes
APIContext
Object passed to the onTick callback.
{
time: number, // Simulation time (seconds)
dt: number, // Time step (seconds, usually 0.5)
traffic: TrafficView, // Traffic query object
weather: WeatherView, // Weather query object
sectors: SectorsView, // Sector query object
fixes: FixesView, // Fix/waypoint query object
procedures: ProceduresView // Procedure lookup object
}Aircraft
Aircraft snapshot with read-only properties and control methods. See aircraft control for all methods.
{
cs: string, // Callsign (e.g., "AAL123")
type: string, // Aircraft type ("A320", "B738", etc.)
wake: WakeCat, // Wake turbulence category
pos: Vec2, // Position (nautical miles)
hdgDeg: number, // Heading 0-360
iasKts: number, // Indicated airspeed
gsKts: number, // Ground speed (affected by wind)
altFt: number, // Current altitude (feet)
altFL: number, // Current altitude (flight level)
vsFpm: number, // Vertical speed (feet per minute)
plan: {
route: string[], // Waypoint names
cruiseAltFt: number, // Planned cruise altitude (feet)
cruiseFL: number, // Planned cruise altitude (flight level)
exitPoint: string, // Last waypoint (exit)
exitAltitude?: number, // Required altitude at exit (feet)
exitFL?: number // Required altitude at exit (flight level)
},
activeLegIdx: number, // Current leg in route
targetAltFt: number, // Cleared altitude (feet)
targetFL: number, // Cleared altitude (flight level)
targetIASKts: number, // Cleared airspeed
targetHdgDeg?: number, // Cleared heading (if vectoring)
directTo?: string, // Direct-to override
offsetNm: number, // Lateral offset from route
sectorId: string, // Current sector
procedureState?: ProcedureState // SID/STAR state (if applicable)
}ConflictEvent
Object passed to the onConflict callback.
{
a: string, // First aircraft callsign
b: string, // Second aircraft callsign
predMinSepNm: number, // Predicted minimum separation (nm)
timeToCPA: number, // Seconds to closest point of approach
severity: string, // "critical" | "warning" | "caution"
cpaVerticalFt: number, // Vertical separation at CPA (feet)
advisories: ConflictAdvisories // Resolution advisories
}DeviationRequest
Object passed to the onDeviationRequest callback. Return true to approve, false to deny.
{
id: string, // Request ID
callsign: string, // Aircraft callsign
direction: string, // "left" | "right"
deviationNm: number, // Requested deviation distance (nm)
reason: string, // Pilot phraseology
weatherCellId?: string // ID of threatening weather cell
}HandoffRequest
Object passed to the onHandoffRequest callback.
{
cs: string, // Aircraft callsign
nextSector: string // Target sector ID
}WeatherCell
A thunderstorm cell returned by weather.cells().
{
id: string, // Unique cell ID
center: { lat, lon }, // Geographic position
radiusNm: number, // Cell radius (nm)
intensity: string // "light" | "moderate" | "heavy" | "extreme"
}ProcedureState
Procedure tracking on an aircraft (available via aircraft.procedureState).
{
procedureId: string, // "PARCH4"
procedureType: string, // "SID" or "STAR"
viaActive: boolean, // True if descend/climb via is active
constraints: Constraint[] // Array of fix constraints
}Constraint
A single altitude/speed constraint on a SID or STAR.
{
fix: string, // Waypoint name
altType?: string, // "at" | "above" | "below" | "between"
alt1?: number, // Primary altitude (feet)
alt2?: number, // Secondary altitude (for "between")
spdType?: string, // "at" | "atOrBelow"
speed?: number, // Speed (knots)
satisfied: boolean, // Constraint met
busted: boolean // Constraint failed
}ConstraintEvent
Object passed to onConstraintSatisfied and onConstraintBusted callbacks.
{
cs: string, // Aircraft callsign
fix: string, // Waypoint name
procedureId: string, // Procedure name
altFt: number // Altitude at crossing (feet)
}The busted variant also includes:
reason: string- Why it was busted (e.g., "Expected at or below 24000ft, was 26000ft")
ProcedureCompleteEvent
Object passed to onProcedureComplete callback.
{
cs: string, // Aircraft callsign
procedureId: string, // Procedure name
satisfied: number, // Constraints met count
busted: number // Constraints failed count
}SpeechRequest
Object passed to ttsService.speak().
{
type: "atc" | "pilot", // Speaker type
text: string, // Text to speak
callsign?: string, // Pilot callsign (for voice selection)
priority?: "normal" | "high", // Queue priority
onStart?: () => void, // Callback when speech starts
onEnd?: () => void // Callback when speech ends
}TTSSettings
TTS configuration object for ttsService.setSettings().
{
enabled: boolean, // Master on/off (default: false)
volume: number, // Volume 0-1 (default: 0.8)
speechRate: number, // Speed 0.5-2 (default: 1.1)
radioEffects: boolean, // PTT click sounds (default: false)
pilotReadbacks: boolean, // Speak pilot responses (default: true)
atcVoiceName?: string // Preferred ATC voice
}Vec2
Position in nautical miles.
{
x: number, // East-west (positive = east)
y: number // North-south (positive = north)
}WakeCat
Wake turbulence category.
"L" | "M" | "H" | "J"L: Light (< 15,500 lbs)M: Medium (15,500 - 300,000 lbs)H: Heavy (> 300,000 lbs)J: Super (A380, etc.)
ResolutionManeuver
A maneuver to resolve a conflict. One of four types:
// Vertical - climb to target altitude
{ type: "climb", targetAltFt: number }
// Vertical - descend to target altitude
{ type: "descend", targetAltFt: number }
// Lateral - turn left or right
{ type: "turn", direction: "left" | "right", degrees: number, targetHdgDeg: number }
// Speed - adjust speed
{ type: "speed", targetKts: number }ResolutionAdvisory
A suggested maneuver to resolve a conflict.
{
callsign: string, // Aircraft this advisory applies to
resolutionType: string, // "vertical" | "lateral" | "speed"
maneuver: ResolutionManeuver, // The specific maneuver
effectiveness: number, // 0-1 score (1 = fully resolves conflict)
projectedSeparationNm: number, // Lateral separation if followed
projectedSeparationFt: number, // Vertical separation if followed
timeToEffect: number // Seconds until separation improves
}Effectiveness scoring:
- 1.0 = Fully resolves conflict (achieves standard separation)
- 0.7-0.9 = Significantly improves separation
- 0.3-0.7 = Moderate improvement
- < 0.3 = Minimal improvement
Resolution priority:
- Vertical - Preferred; fastest effect, cleaner separation
- Lateral - Used when vertical isn't effective
- Speed - Last resort; takes longest to achieve separation
ConflictAdvisories
Resolution options for a conflict pair.
{
forA: ResolutionAdvisory[], // Advisories for aircraft A
forB: ResolutionAdvisory[], // Advisories for aircraft B
recommended: { // Best overall option
callsign: string,
advisory: ResolutionAdvisory
} | null,
available: boolean // Whether any resolution is possible
}Emergency
An in-flight emergency object. See Emergencies for full documentation.
{
id: string, // Unique emergency ID
type: string, // decompression, engine_failure, medical, fuel, fire
severity: string, // MAYDAY or PAN_PAN
callsign: string, // Aircraft callsign
nature: string, // Human-readable (e.g., "Rapid decompression")
status: string, // declared, acknowledged, descending, resolved
initialAltitude: number, // Altitude when declared (feet)
requestedAction: {
targetAltitude?: number // Target altitude for descent
},
declaredAt: number, // Timestamp when declared
acknowledgedAt?: number, // Timestamp when acknowledged
resolvedAt?: number // Timestamp when resolved
}Procedure
A SID or STAR procedure definition.
{
id: string, // "PARCH4"
type: string, // "SID" or "STAR"
airport: string, // "KATL"
runways: string[], // ["08L", "08R"] or ["ALL"]
waypoints: string[], // ["PARCH", "CCC", "ROBER", "HUULK"]
altitudeConstraints: { // By waypoint name
"CCC": { type: "below", alt1: 24000 },
"ROBER": { type: "at", alt1: 12000 }
},
speedConstraints: { // By waypoint name
"CCC": { type: "atOrBelow", speed: 280 },
"ROBER": { type: "atOrBelow", speed: 250 }
}
}