-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathindex.ts
More file actions
112 lines (109 loc) · 2.51 KB
/
Copy pathindex.ts
File metadata and controls
112 lines (109 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
* Static registry of all sentence-encoder factories.
*
* Hand-written barrel rather than a runtime `readdirSync + require`
* loop. TypeScript proves at compile time that every factory conforms
* to `SentenceEncoderFactory`; the plugin also boots without a
* filesystem scan. Before 2.x the plugin discovered encoders by
* scanning the directory at startup — dropping a file into
* `src/sentences/` was enough. **That is no longer the case**: an
* encoder is registered only if it is imported here.
*
* When adding a new sentence:
* 1. Create `./<SENTENCE>.ts` exporting the factory as the default:
* `export default function (app, plugin?) { return { ... } }`.
* 2. Add the import + key below, preserving alphabetical order.
* 3. Add tests under `test/<SENTENCE>.ts`. `test/registry.ts`
* asserts barrel/directory parity so a missing import fails CI.
*/
import type { SentenceEncoderFactory } from '../types/plugin'
import APB from './APB'
import APBtrue from './APB-true'
import BWC from './BWC'
import DBK from './DBK'
import DBS from './DBS'
import DBT from './DBT'
import DPT from './DPT'
import DPTsurface from './DPT-surface'
import GGA from './GGA'
import GLL from './GLL'
import HDG from './HDG'
import HDM from './HDM'
import HDMC from './HDMC'
import HDT from './HDT'
import HDTC from './HDTC'
import MMB from './MMB'
import MTA from './MTA'
import MTW from './MTW'
import MWD from './MWD'
import MWVR from './MWVR'
import MWVT from './MWVT'
import PNKEP01 from './PNKEP01'
import PNKEP02 from './PNKEP02'
import PNKEP03 from './PNKEP03'
import PNKEP99 from './PNKEP99'
import PSILCD1 from './PSILCD1'
import PSILTBS from './PSILTBS'
import RMB from './RMB'
import RMC from './RMC'
import ROT from './ROT'
import RSA from './RSA'
import VHW from './VHW'
import VLW from './VLW'
import VPW from './VPW'
import VTG from './VTG'
import VWR from './VWR'
import VWT from './VWT'
import XDRBaro from './XDRBaro'
import XDRNA from './XDRNA'
import XDRTemp from './XDRTemp'
import XTE from './XTE'
import XTEGC from './XTE-GC'
import ZDA from './ZDA'
export const sentenceFactories: Readonly<
Record<string, SentenceEncoderFactory>
> = {
APB,
'APB-true': APBtrue,
BWC,
DBK,
DBS,
DBT,
DPT,
'DPT-surface': DPTsurface,
GGA,
GLL,
HDG,
HDM,
HDMC,
HDT,
HDTC,
MMB,
MTA,
MTW,
MWD,
MWVR,
MWVT,
PNKEP01,
PNKEP02,
PNKEP03,
PNKEP99,
PSILCD1,
PSILTBS,
RMB,
RMC,
ROT,
RSA,
VHW,
VLW,
VPW,
VTG,
VWR,
VWT,
XDRBaro,
XDRNA,
XDRTemp,
XTE,
'XTE-GC': XTEGC,
ZDA
}