Skip to main content

Class: ICAO

Defined in: src/sdk/navigation/IcaoUtils.ts:15

A utility class for working with ICAO values.

Constructors​

Constructor​

new ICAO(): ICAO

Returns​

ICAO

Properties​

EMPTY_V1​

readonly static EMPTY_V1: " " = ' '

Defined in: src/sdk/navigation/IcaoUtils.ts:18

An empty ICAO string (V1).


EMPTY_V2​

readonly static EMPTY_V2: " " = ' '

Defined in: src/sdk/navigation/IcaoUtils.ts:21

An empty ICAO string (V2).


emptyIcao​

readonly static emptyIcao: " " = ICAO.EMPTY_V1

Defined in: src/sdk/navigation/IcaoUtils.ts:27

An empty ICAO string (V1).

Deprecated​

Please use ICAO.EMPTY_V1 instead.


getAssociatedAirportIdent()​

static getAssociatedAirportIdent: (icao) => string = ICAO.getAirportIdentFromStringV1

Defined in: src/sdk/navigation/IcaoUtils.ts:272

Gets the ident of the associated airport defined by an ICAO string (V1).

Gets the ident of the associated airport defined by an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V1).

Returns​

string

The ident of the associated airport defined by the specified ICAO string (V1).

Param​

An ICAO string (V1).

Returns​

The ident of the associated airport defined by the specified ICAO string (V1).

Deprecated​

Please use ICAO.getAirportIdentFromStringV1() instead.


getFacilityType()​

static getFacilityType: (icao) => FacilityType = ICAO.getFacilityTypeFromStringV1

Defined in: src/sdk/navigation/IcaoUtils.ts:450

Gets the facility type defined by an ICAO string (V1 or V2).

Gets the facility type defined by an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V1).

Returns​

FacilityType

The facility type defined by the specified ICAO string (V1).

Throws​

Error if the ICAO string does not define a valid facility type.

Param​

An ICAO string.

Returns​

The facility type defined by the specified ICAO string.

Throws​

Error if the ICAO string does not define a valid facility type.

Deprecated​

Please use ICAO.getFacilityTypeFromStringV1() instead.


getIdent()​

static getIdent: (icao) => string = ICAO.getIdentFromStringV1

Defined in: src/sdk/navigation/IcaoUtils.ts:298

Gets the ident string defined by an ICAO string (V1).

Gets the ident string defined by an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V1).

Returns​

string

The ident string defined by the specified ICAO string (V1).

Param​

An ICAO string (V1).

Returns​

The ident string defined by the specified ICAO string (V1).

Deprecated​

Please use ICAO.getIdentFromStringV1() instead.


getRegionCode()​

static getRegionCode: (icao) => string = ICAO.getRegionCodeFromStringV1

Defined in: src/sdk/navigation/IcaoUtils.ts:246

Gets the region code defined by an ICAO string (V1).

Gets the region code defined by an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V1).

Returns​

string

The region code defined by the specified ICAO string (V1).

Param​

An ICAO string (V1).

Returns​

The region code defined by the specified ICAO string (V1).

Deprecated​

Please use ICAO.getRegionCodeFromStringV1() instead.


isFacility()​

static isFacility: (icao, facilityType?) => boolean = ICAO.isStringV1Facility

Defined in: src/sdk/navigation/IcaoUtils.ts:384

Checks whether an ICAO string (V1 or V2) defines a valid facility type (optionally of a specific type).

Checks whether an ICAO string (V1) defines a valid facility type (optionally of a specific type).

Parameters​

ParameterTypeDescription
icaostringThe ICAO string (V1) to check.
facilityType?FacilityTypeThe facility type to check against. If not defined, then this method will return true as long as the ICAO string defines any valid facility type.

Returns​

boolean

Whether the specified ICAO string (V1) defines a facility of the specified type.

Param​

The ICAO string to check.

Param​

The facility type to check against. If not defined, then this method will return true as long as the ICAO value defines any valid facility type.

Returns​

Whether the specified ICAO string defines a facility of the specified type.

Deprecated​

Please use ICAO.isStringV1Facility() instead.

Methods​

copyValue()​

static copyValue(value): IcaoValue

Defined in: src/sdk/navigation/IcaoUtils.ts:84

Copies an ICAO value.

Parameters​

ParameterTypeDescription
valueIcaoValueThe value to copy.

Returns​

IcaoValue

A new copy of the specified ICAO value.


emptyValue()​

static emptyValue(): IcaoValue

Defined in: src/sdk/navigation/IcaoUtils.ts:63

Gets an empty ICAO value.

Returns​

IcaoValue

An empty ICAO value.


getAirportIdentFromStringV1()​

static getAirportIdentFromStringV1(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:253

Gets the ident of the associated airport defined by an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V1).

Returns​

string

The ident of the associated airport defined by the specified ICAO string (V1).


getAirportIdentFromStringV2()​

static getAirportIdentFromStringV2(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:262

Gets the ident of the associated airport defined by an ICAO string (V2).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V2).

Returns​

string

The ident of the associated airport defined by the specified ICAO string (V2).


getFacilityTypeFromIcaoType()​

static getFacilityTypeFromIcaoType(icaoType): FacilityType

Defined in: src/sdk/navigation/IcaoUtils.ts:392

Gets the facility type defined by an ICAO facility type string.

Parameters​

ParameterTypeDescription
icaoTypestringAn ICAO facility type string.

Returns​

FacilityType

The facility type defined by the specified ICAO facility type string.

Throws​

Error if the ICAO facility type string does not define a valid facility type.


getFacilityTypeFromStringV1()​

static getFacilityTypeFromStringV1(icao): FacilityType

Defined in: src/sdk/navigation/IcaoUtils.ts:429

Gets the facility type defined by an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V1).

Returns​

FacilityType

The facility type defined by the specified ICAO string (V1).

Throws​

Error if the ICAO string does not define a valid facility type.


getFacilityTypeFromStringV2()​

static getFacilityTypeFromStringV2(icao): FacilityType

Defined in: src/sdk/navigation/IcaoUtils.ts:439

Gets the facility type defined by an ICAO string (V2).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V2).

Returns​

FacilityType

The facility type defined by the specified ICAO string (V2).

Throws​

Error if the ICAO string does not define a valid facility type.


getFacilityTypeFromValue()​

static getFacilityTypeFromValue(icao): FacilityType

Defined in: src/sdk/navigation/IcaoUtils.ts:419

Gets the facility type defined by an ICAO value.

Parameters​

ParameterTypeDescription
icaoIcaoValueAn ICAO value.

Returns​

FacilityType

The facility type defined by the specified ICAO value.

Throws​

Error if the ICAO value does not define a valid facility type.


getIdentFromStringV1()​

static getIdentFromStringV1(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:279

Gets the ident string defined by an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V1).

Returns​

string

The ident string defined by the specified ICAO string (V1).


getIdentFromStringV2()​

static getIdentFromStringV2(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:288

Gets the ident string defined by an ICAO string (V2).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V2).

Returns​

string

The ident string defined by the specified ICAO string (V2).


getRegionCodeFromStringV1()​

static getRegionCodeFromStringV1(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:227

Gets the region code defined by an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V1).

Returns​

string

The region code defined by the specified ICAO string (V1).


getRegionCodeFromStringV2()​

static getRegionCodeFromStringV2(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:236

Gets the region code defined by an ICAO string (V2).

Parameters​

ParameterTypeDescription
icaostringAn ICAO string (V2).

Returns​

string

The region code defined by the specified ICAO string (V2).


getUid()​

static getUid(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:458

Gets a unique ID string for an ICAO value. For any two ICAO values, their unique ID strings are equal if and only if the ICAO values are equal to each other.

Parameters​

ParameterTypeDescription
icaoIcaoValueThe value for which to get a unique ID.

Returns​

string

A unique ID string for the specified ICAO value.


isIcaoTypeFacility()​

Call Signature​

static isIcaoTypeFacility(icaoType): icaoType is "N" | "S" | "W" | "A" | "V" | "R" | "U"

Defined in: src/sdk/navigation/IcaoUtils.ts:305

Checks whether an ICAO facility type string defines a valid facility type.

Parameters​
ParameterTypeDescription
icaoTypestringThe ICAO facility type string to check.
Returns​

icaoType is "N" | "S" | "W" | "A" | "V" | "R" | "U"

Whether the specified ICAO facility type string defines a valid facility type.

Call Signature​

static isIcaoTypeFacility<T>(icaoType, facilityType): icaoType is FacilityTypeIcaoMap[T]

Defined in: src/sdk/navigation/IcaoUtils.ts:312

Checks whether an ICAO facility type string defines a given facility type.

Type Parameters​
Type Parameter
T extends FacilityType
Parameters​
ParameterTypeDescription
icaoTypestringThe ICAO facility type string to check.
facilityTypeTThe facility type to check against.
Returns​

icaoType is FacilityTypeIcaoMap[T]

Whether the specified ICAO facility type string defines a facility of the specified type.

Call Signature​

static isIcaoTypeFacility(icaoType, facilityType?): icaoType is "N" | "S" | "W" | "A" | "V" | "R" | "U"

Defined in: src/sdk/navigation/IcaoUtils.ts:320

Checks whether an ICAO facility type string defines a valid facility type (optionally of a specific type).

Parameters​
ParameterTypeDescription
icaoTypestringThe ICAO facility type string to check.
facilityType?FacilityTypeThe facility type to check against. If not defined, then this method will return true as long as the ICAO facility type string defines any valid facility type.
Returns​

icaoType is "N" | "S" | "W" | "A" | "V" | "R" | "U"

Whether the specified ICAO facility type string defines a facility of the specified type.


isStringV1Facility()​

static isStringV1Facility(icao, facilityType?): boolean

Defined in: src/sdk/navigation/IcaoUtils.ts:361

Checks whether an ICAO string (V1) defines a valid facility type (optionally of a specific type).

Parameters​

ParameterTypeDescription
icaostringThe ICAO string (V1) to check.
facilityType?FacilityTypeThe facility type to check against. If not defined, then this method will return true as long as the ICAO string defines any valid facility type.

Returns​

boolean

Whether the specified ICAO string (V1) defines a facility of the specified type.


isStringV2Facility()​

static isStringV2Facility(icao, facilityType?): boolean

Defined in: src/sdk/navigation/IcaoUtils.ts:372

Checks whether an ICAO string (V2) defines a valid facility type (optionally of a specific type).

Parameters​

ParameterTypeDescription
icaostringThe ICAO string (V2) to check.
facilityType?FacilityTypeThe facility type to check against. If not defined, then this method will return true as long as the ICAO string defines any valid facility type.

Returns​

boolean

Whether the specified ICAO string (V2) defines a facility of the specified type.


isValue()​

static isValue(query): query is IcaoValue

Defined in: src/sdk/navigation/IcaoUtils.ts:36

Checks whether a query is an ICAO value object.

Parameters​

ParameterTypeDescription
queryunknownA query.

Returns​

query is IcaoValue

Whether the specified query is an ICAO value object.


isValueEmpty()​

static isValueEmpty(value): boolean

Defined in: src/sdk/navigation/IcaoUtils.ts:72

Checks whether an ICAO value is empty.

Parameters​

ParameterTypeDescription
valueIcaoValueThe value to check.

Returns​

boolean

Whether the specified ICAO value is empty.


isValueFacility()​

static isValueFacility(icao, facilityType?): boolean

Defined in: src/sdk/navigation/IcaoUtils.ts:350

Checks whether an ICAO value defines a valid facility type (optionally of a specific type).

Parameters​

ParameterTypeDescription
icaoIcaoValueThe ICAO value to check.
facilityType?FacilityTypeThe facility type to check against. If not defined, then this method will return true as long as the ICAO value defines any valid facility type.

Returns​

boolean

Whether the specified ICAO value defines a facility of the specified type.


stringV1ToValue()​

static stringV1ToValue(icao): IcaoValue

Defined in: src/sdk/navigation/IcaoUtils.ts:93

Converts an ICAO string (V1) to an ICAO value.

Parameters​

ParameterTypeDescription
icaostringThe ICAO string (V1) to convert.

Returns​

IcaoValue

The ICAO value converted from the specified string (V1).


stringV2ToValue()​

static stringV2ToValue(icao): IcaoValue

Defined in: src/sdk/navigation/IcaoUtils.ts:107

Converts an ICAO string (V2) to an ICAO value.

Parameters​

ParameterTypeDescription
icaostringThe ICAO string (V2) to convert.

Returns​

IcaoValue

The ICAO value converted from the specified string (V2).


tryValueToStringV1()​

static tryValueToStringV1(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:149

Attempts to convert an ICAO value to an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaoIcaoValueThe ICAO value to convert.

Returns​

string

The ICAO string (V1) converted from the specified value, or the empty ICAO string (V1) if the ICAO value is malformed or cannot be converted to a string (V1).


tryValueToStringV2()​

static tryValueToStringV2(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:195

Attempts to convert an ICAO value to an ICAO string (V2).

Parameters​

ParameterTypeDescription
icaoIcaoValueThe ICAO value to convert.

Returns​

string

The ICAO string (V2) converted from the specified value, or the empty ICAO string (V2) if the ICAO value is malformed or cannot be converted to a string (V2).


value()​

static value(type, region, airport, ident): IcaoValue

Defined in: src/sdk/navigation/IcaoUtils.ts:49

Creates a new ICAO value. All of the fields must not have any leading or trailing spaces that would be removed by String.trim().

Parameters​

ParameterTypeDescription
typestringThe ICAO's facility type.
regionstringThe ICAO's region code.
airportstringThe ICAO's associated airport ident.
identstringThe ICAO's ident.

Returns​

IcaoValue

A new ICAO value with the specified properties.


valueEquals()​

static valueEquals(a, b): boolean

Defined in: src/sdk/navigation/IcaoUtils.ts:214

Checks whether two ICAO values are equal.

Parameters​

ParameterTypeDescription
aIcaoValueThe first value.
bIcaoValueThe second value.

Returns​

boolean

Whether the two specified ICAO values are equal.


valueToStringV1()​

static valueToStringV1(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:122

Converts an ICAO value to an ICAO string (V1).

Parameters​

ParameterTypeDescription
icaoIcaoValueThe ICAO value to convert.

Returns​

string

The ICAO string (V1) converted from the specified value.

Throws​

Error if the ICAO value is malformed or cannot be converted to a string (V1).


valueToStringV2()​

static valueToStringV2(icao): string

Defined in: src/sdk/navigation/IcaoUtils.ts:169

Converts an ICAO value to an ICAO string (V2).

Parameters​

ParameterTypeDescription
icaoIcaoValueThe ICAO value to convert.

Returns​

string

The ICAO string (V2) converted from the specified value.

Throws​

Error if the ICAO value is malformed or cannot be converted to a string (V2).