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
readonlystaticEMPTY_V1:" "=' '
Defined in: src/sdk/navigation/IcaoUtils.ts:18
An empty ICAO string (V1).
EMPTY_V2
readonlystaticEMPTY_V2:" "=' '
Defined in: src/sdk/navigation/IcaoUtils.ts:21
An empty ICAO string (V2).
emptyIcao
readonlystaticemptyIcao:" "=ICAO.EMPTY_V1
Defined in: src/sdk/navigation/IcaoUtils.ts:27
An empty ICAO string (V1).
Deprecated
Please use ICAO.EMPTY_V1 instead.
getAssociatedAirportIdent()
staticgetAssociatedAirportIdent: (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
| Parameter | Type | Description |
|---|---|---|
icao | string | An 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()
staticgetFacilityType: (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
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V1). |
Returns
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()
staticgetIdent: (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
| Parameter | Type | Description |
|---|---|---|
icao | string | An 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()
staticgetRegionCode: (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
| Parameter | Type | Description |
|---|---|---|
icao | string | An 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()
staticisFacility: (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
| Parameter | Type | Description |
|---|---|---|
icao | string | The ICAO string (V1) to check. |
facilityType? | FacilityType | The 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()
staticcopyValue(value):IcaoValue
Defined in: src/sdk/navigation/IcaoUtils.ts:84
Copies an ICAO value.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | IcaoValue | The value to copy. |
Returns
A new copy of the specified ICAO value.
emptyValue()
staticemptyValue():IcaoValue
Defined in: src/sdk/navigation/IcaoUtils.ts:63
Gets an empty ICAO value.
Returns
An empty ICAO value.
getAirportIdentFromStringV1()
staticgetAirportIdentFromStringV1(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:253
Gets the ident of the associated airport defined by an ICAO string (V1).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V1). |
Returns
string
The ident of the associated airport defined by the specified ICAO string (V1).
getAirportIdentFromStringV2()
staticgetAirportIdentFromStringV2(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:262
Gets the ident of the associated airport defined by an ICAO string (V2).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V2). |
Returns
string
The ident of the associated airport defined by the specified ICAO string (V2).
getFacilityTypeFromIcaoType()
staticgetFacilityTypeFromIcaoType(icaoType):FacilityType
Defined in: src/sdk/navigation/IcaoUtils.ts:392
Gets the facility type defined by an ICAO facility type string.
Parameters
| Parameter | Type | Description |
|---|---|---|
icaoType | string | An ICAO facility type string. |
Returns
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()
staticgetFacilityTypeFromStringV1(icao):FacilityType
Defined in: src/sdk/navigation/IcaoUtils.ts:429
Gets the facility type defined by an ICAO string (V1).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V1). |
Returns
The facility type defined by the specified ICAO string (V1).
Throws
Error if the ICAO string does not define a valid facility type.
getFacilityTypeFromStringV2()
staticgetFacilityTypeFromStringV2(icao):FacilityType
Defined in: src/sdk/navigation/IcaoUtils.ts:439
Gets the facility type defined by an ICAO string (V2).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V2). |
Returns
The facility type defined by the specified ICAO string (V2).
Throws
Error if the ICAO string does not define a valid facility type.
getFacilityTypeFromValue()
staticgetFacilityTypeFromValue(icao):FacilityType
Defined in: src/sdk/navigation/IcaoUtils.ts:419
Gets the facility type defined by an ICAO value.
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | An ICAO value. |
Returns
The facility type defined by the specified ICAO value.
Throws
Error if the ICAO value does not define a valid facility type.
getIdentFromStringV1()
staticgetIdentFromStringV1(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:279
Gets the ident string defined by an ICAO string (V1).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V1). |
Returns
string
The ident string defined by the specified ICAO string (V1).
getIdentFromStringV2()
staticgetIdentFromStringV2(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:288
Gets the ident string defined by an ICAO string (V2).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V2). |
Returns
string
The ident string defined by the specified ICAO string (V2).
getRegionCodeFromStringV1()
staticgetRegionCodeFromStringV1(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:227
Gets the region code defined by an ICAO string (V1).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V1). |
Returns
string
The region code defined by the specified ICAO string (V1).
getRegionCodeFromStringV2()
staticgetRegionCodeFromStringV2(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:236
Gets the region code defined by an ICAO string (V2).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | An ICAO string (V2). |
Returns
string
The region code defined by the specified ICAO string (V2).
getUid()
staticgetUid(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
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | The value for which to get a unique ID. |
Returns
string
A unique ID string for the specified ICAO value.
isIcaoTypeFacility()
Call Signature
staticisIcaoTypeFacility(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
| Parameter | Type | Description |
|---|---|---|
icaoType | string | The 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
staticisIcaoTypeFacility<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
| Parameter | Type | Description |
|---|---|---|
icaoType | string | The ICAO facility type string to check. |
facilityType | T | The 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
staticisIcaoTypeFacility(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
| Parameter | Type | Description |
|---|---|---|
icaoType | string | The ICAO facility type string to check. |
facilityType? | FacilityType | The 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()
staticisStringV1Facility(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
| Parameter | Type | Description |
|---|---|---|
icao | string | The ICAO string (V1) to check. |
facilityType? | FacilityType | The 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()
staticisStringV2Facility(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
| Parameter | Type | Description |
|---|---|---|
icao | string | The ICAO string (V2) to check. |
facilityType? | FacilityType | The 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()
staticisValue(query):query is IcaoValue
Defined in: src/sdk/navigation/IcaoUtils.ts:36
Checks whether a query is an ICAO value object.
Parameters
| Parameter | Type | Description |
|---|---|---|
query | unknown | A query. |
Returns
query is IcaoValue
Whether the specified query is an ICAO value object.
isValueEmpty()
staticisValueEmpty(value):boolean
Defined in: src/sdk/navigation/IcaoUtils.ts:72
Checks whether an ICAO value is empty.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | IcaoValue | The value to check. |
Returns
boolean
Whether the specified ICAO value is empty.
isValueFacility()
staticisValueFacility(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
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | The ICAO value to check. |
facilityType? | FacilityType | 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
boolean
Whether the specified ICAO value defines a facility of the specified type.
stringV1ToValue()
staticstringV1ToValue(icao):IcaoValue
Defined in: src/sdk/navigation/IcaoUtils.ts:93
Converts an ICAO string (V1) to an ICAO value.
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | The ICAO string (V1) to convert. |
Returns
The ICAO value converted from the specified string (V1).
stringV2ToValue()
staticstringV2ToValue(icao):IcaoValue
Defined in: src/sdk/navigation/IcaoUtils.ts:107
Converts an ICAO string (V2) to an ICAO value.
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | string | The ICAO string (V2) to convert. |
Returns
The ICAO value converted from the specified string (V2).
tryValueToStringV1()
statictryValueToStringV1(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:149
Attempts to convert an ICAO value to an ICAO string (V1).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | The 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()
statictryValueToStringV2(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:195
Attempts to convert an ICAO value to an ICAO string (V2).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | The 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()
staticvalue(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
| Parameter | Type | Description |
|---|---|---|
type | string | The ICAO's facility type. |
region | string | The ICAO's region code. |
airport | string | The ICAO's associated airport ident. |
ident | string | The ICAO's ident. |
Returns
A new ICAO value with the specified properties.
valueEquals()
staticvalueEquals(a,b):boolean
Defined in: src/sdk/navigation/IcaoUtils.ts:214
Checks whether two ICAO values are equal.
Parameters
| Parameter | Type | Description |
|---|---|---|
a | IcaoValue | The first value. |
b | IcaoValue | The second value. |
Returns
boolean
Whether the two specified ICAO values are equal.
valueToStringV1()
staticvalueToStringV1(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:122
Converts an ICAO value to an ICAO string (V1).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | The 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()
staticvalueToStringV2(icao):string
Defined in: src/sdk/navigation/IcaoUtils.ts:169
Converts an ICAO value to an ICAO string (V2).
Parameters
| Parameter | Type | Description |
|---|---|---|
icao | IcaoValue | The 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).