Skip to content

ui/ConsoleAutocomplete

Classes

ConsoleAutocomplete

Defined in: ui/ConsoleAutocomplete.ts:98

ConsoleAutocomplete - the ACID and aircraft-type dropdowns attached to the console input, extracted from Console.

Owns three cmddict-aware autocompletes: - ACID: suggests existing aircraft IDs whenever the cursor sits on an acid-parameter slot. For CRE/MCRE it instead warns when the typed ID already exists. - Aircraft type: suggests openap types on the type slot of CRE/MCRE, warning when a non-openap type is being entered. - PAN destination: on PAN's first argument, suggests aircraft first and then airports/waypoints from the navdata index, each labeled with a kind badge (AC/APT/HEL/WPT) since the slot accepts all of them.

Constructors

Constructor
new ConsoleAutocomplete(deps): ConsoleAutocomplete;

Defined in: ui/ConsoleAutocomplete.ts:112

Parameters
deps

ConsoleAutocompleteDeps

Returns

ConsoleAutocomplete

Methods

createElements()
createElements(): void;

Defined in: ui/ConsoleAutocomplete.ts:118

Create the dropdown and warning elements inside the console input container. Call once the DOM is ready.

Returns

void

handleKey()
handleKey(key): boolean;

Defined in: ui/ConsoleAutocomplete.ts:162

Let a visible dropdown consume a keydown (arrows/Enter). The type dropdown gets first refusal, matching the original console order. Returns true when the key was handled.

Parameters
key

string

Returns

boolean

update()
update(): void;

Defined in: ui/ConsoleAutocomplete.ts:169

Refresh all autocompletes for the current input value and cursor.

Returns

void

hideTransient()
hideTransient(): void;

Defined in: ui/ConsoleAutocomplete.ts:180

Hide the dropdowns and the type warning. Used on Escape and blur; intentionally leaves the ACID duplicate warning visible since it reflects the typed value, not transient navigation state.

Returns

void

hideAll()
hideAll(): void;

Defined in: ui/ConsoleAutocomplete.ts:188

Hide every dropdown and warning. Used when the input is cleared.

Returns

void

Interfaces

PanSuggestion

Defined in: ui/ConsoleAutocomplete.ts:18

One entry in the PAN destination dropdown: an aircraft currently in the simulation, or an airport/heliport/waypoint from the navdata index.

Properties

kind
kind: "aircraft" | "airport" | "heliport" | "waypoint";

Defined in: ui/ConsoleAutocomplete.ts:19

ident
ident: string;

Defined in: ui/ConsoleAutocomplete.ts:20

name?
optional name?: string;

Defined in: ui/ConsoleAutocomplete.ts:22

Human-readable name (navdata results only).


ConsoleAutocompleteDeps

Defined in: ui/ConsoleAutocomplete.ts:67

Dependencies the autocomplete needs from the console. Provided as closures so the autocomplete stays decoupled from Console/StateManager construction order.

Properties

getCommandDict
getCommandDict: () => CommandDict | null;

Defined in: ui/ConsoleAutocomplete.ts:69

Current command dictionary from the server, when loaded.

Returns

CommandDict | null

getAircraftIds
getAircraftIds: () => string[];

Defined in: ui/ConsoleAutocomplete.ts:71

Aircraft IDs currently in the simulation.

Returns

string[]

searchNavdata
searchNavdata: (query) => Promise<NavdataSearchResult[]>;

Defined in: ui/ConsoleAutocomplete.ts:76

Search the navdata index (airports/heliports/waypoints) for the PAN dropdown. Should resolve to [] when the index is unavailable.

Parameters
query

string

Returns

Promise\<NavdataSearchResult[]>

onAfterSelect
onAfterSelect: () => void;

Defined in: ui/ConsoleAutocomplete.ts:81

Called after a suggestion is inserted so the console can refresh its ghost suggestion and map picker for the new input value.

Returns

void