@airframes/acars-decoder 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +64 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +5327 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5289 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
declare class IcaoDecoder {
|
|
2
|
+
name: string;
|
|
3
|
+
icao: string;
|
|
4
|
+
constructor(icao: string);
|
|
5
|
+
isMilitary(): true | RegExpMatchArray | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Representation of a Message
|
|
10
|
+
*/
|
|
11
|
+
interface Message {
|
|
12
|
+
label?: string;
|
|
13
|
+
sublabel?: string;
|
|
14
|
+
text: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Decoder Options
|
|
18
|
+
*/
|
|
19
|
+
interface Options {
|
|
20
|
+
debug?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Results from decoding a message
|
|
24
|
+
*/
|
|
25
|
+
interface DecodeResult {
|
|
26
|
+
decoded: boolean;
|
|
27
|
+
decoder: {
|
|
28
|
+
name: string;
|
|
29
|
+
type: 'pattern-match' | 'none';
|
|
30
|
+
decodeLevel: 'none' | 'partial' | 'full';
|
|
31
|
+
};
|
|
32
|
+
error?: string;
|
|
33
|
+
formatted: {
|
|
34
|
+
description: string;
|
|
35
|
+
items: {
|
|
36
|
+
type: string;
|
|
37
|
+
code: string;
|
|
38
|
+
label: string;
|
|
39
|
+
value: string;
|
|
40
|
+
}[];
|
|
41
|
+
};
|
|
42
|
+
message?: any;
|
|
43
|
+
raw: any;
|
|
44
|
+
remaining: {
|
|
45
|
+
text?: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
interface DecoderPluginInterface {
|
|
49
|
+
decode(message: Message): DecodeResult;
|
|
50
|
+
meetsStateRequirements(): boolean;
|
|
51
|
+
qualifiers(): any;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare class MessageDecoder {
|
|
55
|
+
name: string;
|
|
56
|
+
plugins: Array<DecoderPluginInterface>;
|
|
57
|
+
debug: boolean;
|
|
58
|
+
constructor();
|
|
59
|
+
registerPlugin(plugin: DecoderPluginInterface): boolean;
|
|
60
|
+
decode(message: Message, options?: Options): DecodeResult;
|
|
61
|
+
lookupAirportByIata(iata: string): any;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { IcaoDecoder, MessageDecoder };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
declare class IcaoDecoder {
|
|
2
|
+
name: string;
|
|
3
|
+
icao: string;
|
|
4
|
+
constructor(icao: string);
|
|
5
|
+
isMilitary(): true | RegExpMatchArray | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Representation of a Message
|
|
10
|
+
*/
|
|
11
|
+
interface Message {
|
|
12
|
+
label?: string;
|
|
13
|
+
sublabel?: string;
|
|
14
|
+
text: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Decoder Options
|
|
18
|
+
*/
|
|
19
|
+
interface Options {
|
|
20
|
+
debug?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Results from decoding a message
|
|
24
|
+
*/
|
|
25
|
+
interface DecodeResult {
|
|
26
|
+
decoded: boolean;
|
|
27
|
+
decoder: {
|
|
28
|
+
name: string;
|
|
29
|
+
type: 'pattern-match' | 'none';
|
|
30
|
+
decodeLevel: 'none' | 'partial' | 'full';
|
|
31
|
+
};
|
|
32
|
+
error?: string;
|
|
33
|
+
formatted: {
|
|
34
|
+
description: string;
|
|
35
|
+
items: {
|
|
36
|
+
type: string;
|
|
37
|
+
code: string;
|
|
38
|
+
label: string;
|
|
39
|
+
value: string;
|
|
40
|
+
}[];
|
|
41
|
+
};
|
|
42
|
+
message?: any;
|
|
43
|
+
raw: any;
|
|
44
|
+
remaining: {
|
|
45
|
+
text?: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
interface DecoderPluginInterface {
|
|
49
|
+
decode(message: Message): DecodeResult;
|
|
50
|
+
meetsStateRequirements(): boolean;
|
|
51
|
+
qualifiers(): any;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare class MessageDecoder {
|
|
55
|
+
name: string;
|
|
56
|
+
plugins: Array<DecoderPluginInterface>;
|
|
57
|
+
debug: boolean;
|
|
58
|
+
constructor();
|
|
59
|
+
registerPlugin(plugin: DecoderPluginInterface): boolean;
|
|
60
|
+
decode(message: Message, options?: Options): DecodeResult;
|
|
61
|
+
lookupAirportByIata(iata: string): any;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { IcaoDecoder, MessageDecoder };
|