@aircast-4g/mavlink 1.1.5 → 1.1.7

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.ts DELETED
@@ -1,345 +0,0 @@
1
- interface MAVLinkDialectDefinition {
2
- version?: string;
3
- dialect?: number;
4
- includes?: string[];
5
- enums?: EnumDefinition[];
6
- messages?: MessageDefinition$1[];
7
- }
8
- interface EnumDefinition {
9
- name: string;
10
- description?: string;
11
- bitmask?: boolean;
12
- entries: EnumEntry[];
13
- }
14
- interface EnumEntry {
15
- name: string;
16
- value: string;
17
- description?: string;
18
- }
19
- interface MessageDefinition$1 {
20
- id: number;
21
- name: string;
22
- description?: string;
23
- fields: FieldDefinition$1[];
24
- }
25
- interface FieldDefinition$1 {
26
- name: string;
27
- type: string;
28
- enum?: string;
29
- description?: string;
30
- extension?: boolean;
31
- }
32
- interface TypeScriptEnum {
33
- name: string;
34
- description: string[];
35
- values: TypeScriptEnumValue[];
36
- bitmask: boolean;
37
- }
38
- interface TypeScriptEnumValue {
39
- name: string;
40
- value: number;
41
- description: string[];
42
- }
43
- interface TypeScriptField {
44
- name: string;
45
- type: string;
46
- description: string[];
47
- optional: boolean;
48
- }
49
- interface TypeScriptMessage {
50
- name: string;
51
- originalName: string;
52
- description: string[];
53
- fields: TypeScriptField[];
54
- }
55
- interface TypeScriptDialect {
56
- dialectName: string;
57
- enums: TypeScriptEnum[];
58
- messages: TypeScriptMessage[];
59
- }
60
- interface GenerationOptions {
61
- dialectName: string;
62
- outputFormat: 'single' | 'separate';
63
- includeTypeGuards: boolean;
64
- includeEnums: boolean;
65
- }
66
- interface MAVLinkDialect {
67
- version?: string;
68
- dialect?: string;
69
- include?: string | string[];
70
- enums?: {
71
- enum: XMLEnum | XMLEnum[];
72
- };
73
- messages?: {
74
- message: XMLMessage | XMLMessage[];
75
- };
76
- }
77
- interface XMLEnum {
78
- $: {
79
- name: string;
80
- bitmask?: string;
81
- };
82
- description?: string;
83
- entry?: XMLEnumEntry | XMLEnumEntry[];
84
- }
85
- interface XMLEnumEntry {
86
- $: {
87
- name: string;
88
- value: string;
89
- };
90
- description?: string;
91
- _?: string;
92
- }
93
- interface XMLMessage {
94
- $: {
95
- id: string;
96
- name: string;
97
- };
98
- description?: string;
99
- field?: XMLField | XMLField[];
100
- }
101
- interface XMLField {
102
- $: {
103
- name: string;
104
- type: string;
105
- enum?: string;
106
- };
107
- _?: string;
108
- description?: string;
109
- }
110
-
111
- declare class MAVLinkGenerator {
112
- private xmlParser;
113
- private typeConverter;
114
- private templateEngine;
115
- constructor();
116
- generateFromURL(url: string, outputPath: string, options: GenerationOptions): Promise<void>;
117
- generateFromFile(filePath: string, outputPath: string, options: GenerationOptions): Promise<void>;
118
- private generate;
119
- private generateDecoderDefinitions;
120
- reset(): void;
121
- }
122
- declare function generateTypesFromXML(xmlContent: string, options: GenerationOptions): Promise<{
123
- [filename: string]: string;
124
- }>;
125
-
126
- interface BatchProcessorOptions {
127
- outputDir: string;
128
- dialectFormat: 'single' | 'separate';
129
- includeEnums: boolean;
130
- includeTypeGuards: boolean;
131
- }
132
- declare class BatchProcessor {
133
- private generator;
134
- private static readonly MAVLINK_DIALECTS_URL;
135
- private static readonly MAVLINK_RAW_BASE_URL;
136
- constructor();
137
- processAllDialects(options: BatchProcessorOptions): Promise<void>;
138
- processSpecificDialects(dialectNames: string[], options: BatchProcessorOptions): Promise<void>;
139
- private generateMainIndex;
140
- generatePackageJson(outputDir: string, version?: string): Promise<void>;
141
- }
142
-
143
- declare class XMLParser {
144
- private processedUrls;
145
- parseFromURL(url: string): Promise<MAVLinkDialectDefinition>;
146
- parseFromFile(filePath: string): Promise<MAVLinkDialectDefinition>;
147
- private parseXML;
148
- private processDefinition;
149
- private resolveIncludeUrl;
150
- private processEnum;
151
- private processMessage;
152
- reset(): void;
153
- }
154
-
155
- declare class TypeConverter {
156
- private static readonly MAVLINK_TO_TS_TYPES;
157
- convert(definition: MAVLinkDialectDefinition, dialectName: string): TypeScriptDialect;
158
- private convertEnum;
159
- private convertMessage;
160
- private convertField;
161
- private convertMessageName;
162
- private convertFieldName;
163
- private convertFieldType;
164
- private convertSingleType;
165
- private parseEnumValue;
166
- private parseDescription;
167
- }
168
-
169
- declare class TemplateEngine {
170
- private templates;
171
- constructor();
172
- private initializeTemplates;
173
- private registerHelpers;
174
- generateTypes(dialect: TypeScriptDialect, includeEnums?: boolean): string;
175
- generateEnums(dialect: TypeScriptDialect): string;
176
- generateMessages(dialect: TypeScriptDialect, includeEnums?: boolean): string;
177
- generateIndex(dialect: TypeScriptDialect, includeEnums?: boolean): string;
178
- generateSingle(dialect: TypeScriptDialect): string;
179
- generateDecoder(dialect: TypeScriptDialect): string;
180
- }
181
-
182
- interface ParsedMAVLinkMessage {
183
- timestamp: number;
184
- system_id: number;
185
- component_id: number;
186
- message_id: number;
187
- message_name: string;
188
- sequence: number;
189
- payload: Record<string, any>;
190
- protocol_version: 1 | 2;
191
- checksum: number;
192
- crc_ok: boolean;
193
- signature?: Uint8Array;
194
- }
195
- interface MAVLinkFrame {
196
- magic: number;
197
- length: number;
198
- incompatible_flags?: number;
199
- compatible_flags?: number;
200
- sequence: number;
201
- system_id: number;
202
- component_id: number;
203
- message_id: number;
204
- payload: Uint8Array;
205
- checksum: number;
206
- signature?: Uint8Array;
207
- }
208
- interface ParserOptions {
209
- validateCRC?: boolean;
210
- allowProtocolV1?: boolean;
211
- allowProtocolV2?: boolean;
212
- maxBufferSize?: number;
213
- }
214
- declare class ParserError extends Error {
215
- frame?: any;
216
- constructor(message: string, frame?: any);
217
- }
218
- interface ParserResult {
219
- messages: ParsedMAVLinkMessage[];
220
- errors: ParserError[];
221
- bytesProcessed: number;
222
- remainingBytes: Uint8Array;
223
- }
224
- interface FieldDescriptor {
225
- name: string;
226
- type: string;
227
- enum?: string;
228
- arrayLength?: number;
229
- }
230
- interface MessageDescriptor {
231
- id: number;
232
- name: string;
233
- fields: FieldDescriptor[];
234
- crc_extra: number;
235
- }
236
- interface DialectRegistry {
237
- [dialectName: string]: {
238
- [messageId: number]: MessageDescriptor;
239
- };
240
- }
241
-
242
- declare class MAVLinkParser {
243
- private frameParser;
244
- private messageDecoder;
245
- private buffer;
246
- private bufferLength;
247
- private options;
248
- constructor(options?: ParserOptions);
249
- /**
250
- * Parse raw bytes from data channel and return JSON messages
251
- * @param data Raw bytes from data channel (WebRTC, WebSocket, etc.)
252
- * @returns Array of parsed MAVLink messages in JSON format
253
- */
254
- parseBytes(data: Uint8Array): ParsedMAVLinkMessage[];
255
- /**
256
- * Parse a single raw message (for testing or when you have complete frames)
257
- */
258
- parseMessage(data: Uint8Array): ParsedMAVLinkMessage | null;
259
- private appendToBuffer;
260
- private tryParseFrame;
261
- private getFrameLength;
262
- private validateFrameCRC;
263
- /**
264
- * Reset parser state (useful when connection is reset)
265
- */
266
- reset(): void;
267
- /**
268
- * Get parser statistics
269
- */
270
- getStats(): {
271
- bufferSize: number;
272
- bufferUsed: number;
273
- };
274
- }
275
-
276
- declare class MAVLinkFrameParser {
277
- private static readonly MAVLINK_V1_MAGIC;
278
- private static readonly MAVLINK_V2_MAGIC;
279
- private static readonly MAVLINK_V1_HEADER_SIZE;
280
- private static readonly MAVLINK_V2_HEADER_SIZE;
281
- private static readonly MAVLINK_CHECKSUM_SIZE;
282
- private static readonly MAVLINK_V2_SIGNATURE_SIZE;
283
- parseFrame(data: Uint8Array): MAVLinkFrame & {
284
- protocol_version: 1 | 2;
285
- };
286
- private parseV1Frame;
287
- private parseV2Frame;
288
- }
289
-
290
- interface MessageDefinition {
291
- id: number;
292
- name: string;
293
- fields: FieldDefinition[];
294
- }
295
- interface FieldDefinition {
296
- name: string;
297
- type: string;
298
- arrayLength?: number;
299
- extension?: boolean;
300
- }
301
- declare class MAVLinkMessageDecoder {
302
- private messageDefinitions;
303
- private definitionsLoaded;
304
- constructor();
305
- decode(frame: MAVLinkFrame & {
306
- crc_ok?: boolean;
307
- protocol_version?: 1 | 2;
308
- }): ParsedMAVLinkMessage;
309
- private decodePayload;
310
- private getDefaultValue;
311
- private decodeField;
312
- private decodeSingleValue;
313
- /**
314
- * Load all available generated message definitions from built-in dialects
315
- * This enables decoding of 319+ messages instead of just basic ones
316
- */
317
- loadGeneratedDefinitions(): Promise<void>;
318
- private initializeFromGeneratedDefinitions;
319
- private getAvailableDialects;
320
- private loadDialectDecoder;
321
- addCustomMessageDefinition(id: number, name: string, fields: FieldDefinition[]): void;
322
- getMessageDefinition(id: number): MessageDefinition | undefined;
323
- getSupportedMessageIds(): number[];
324
- isDefinitionsLoaded(): boolean;
325
- /**
326
- * Wait for definitions to be loaded before proceeding
327
- * Returns immediately if already loaded
328
- */
329
- waitForDefinitions(): Promise<void>;
330
- /**
331
- * Factory method to create decoder with all generated definitions loaded
332
- * @returns Promise that resolves to decoder with 319+ message definitions
333
- */
334
- static createWithGeneratedDefinitions(): Promise<MAVLinkMessageDecoder>;
335
- }
336
-
337
- declare class CRCCalculator {
338
- private static readonly CRC_INIT;
339
- static calculate(data: Uint8Array, extra?: number): number;
340
- private static crcAccumulate;
341
- static getCRCExtra(messageId: number): number;
342
- }
343
-
344
- export { BatchProcessor, CRCCalculator, MAVLinkFrameParser, MAVLinkGenerator, MAVLinkMessageDecoder, MAVLinkParser, ParserError, TemplateEngine, TypeConverter, XMLParser, generateTypesFromXML };
345
- export type { DialectRegistry, EnumDefinition, EnumEntry, FieldDefinition$1 as FieldDefinition, FieldDescriptor, GenerationOptions, MAVLinkDialect, MAVLinkDialectDefinition, MAVLinkFrame, MessageDefinition$1 as MessageDefinition, MessageDescriptor, ParsedMAVLinkMessage, ParserOptions, ParserResult, TypeScriptDialect, TypeScriptEnum, TypeScriptEnumValue, TypeScriptField, TypeScriptMessage, XMLEnum, XMLEnumEntry, XMLField, XMLMessage };
@@ -1,27 +0,0 @@
1
- // @aircast-4g/mavlink - Bundled CommonJS
2
- // Generated from TypeScript sources
3
- 'use strict';
4
-
5
- // Main entry point for programmatic usage
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.TemplateEngine = exports.TypeConverter = exports.XMLParser = exports.BatchProcessor = exports.generateTypesFromXML = exports.MAVLinkGenerator = void 0;
8
- const tslib_1 = require("tslib");
9
- // Generator exports
10
- var generator_1 = require("./generator/generator");
11
- Object.defineProperty(exports, "MAVLinkGenerator", { enumerable: true, get: function () { return generator_1.MAVLinkGenerator; } });
12
- Object.defineProperty(exports, "generateTypesFromXML", { enumerable: true, get: function () { return generator_1.generateTypesFromXML; } });
13
- var batch_processor_1 = require("./generator/batch-processor");
14
- Object.defineProperty(exports, "BatchProcessor", { enumerable: true, get: function () { return batch_processor_1.BatchProcessor; } });
15
- var xml_parser_1 = require("./generator/xml-parser");
16
- Object.defineProperty(exports, "XMLParser", { enumerable: true, get: function () { return xml_parser_1.XMLParser; } });
17
- var type_converter_1 = require("./generator/type-converter");
18
- Object.defineProperty(exports, "TypeConverter", { enumerable: true, get: function () { return type_converter_1.TypeConverter; } });
19
- var template_engine_1 = require("./generator/template-engine");
20
- Object.defineProperty(exports, "TemplateEngine", { enumerable: true, get: function () { return template_engine_1.TemplateEngine; } });
21
- // Parser exports
22
- tslib_1.__exportStar(require("./parser"), exports);
23
- // Core types
24
- tslib_1.__exportStar(require("./types"), exports);
25
- // Pre-generated MAVLink dialect types are available in the published package
26
- // Import them after installation: import { CommonTypes } from 'aircast-mavlink/types/common'
27
- //# sourceMappingURL=mavlink.cjs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mavlink.cjs.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;;AAEA;AACA,IAAA,WAAA,GAAA,OAAA,CAAA,uBAAA,CAAA;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAAA,WAAA,CAAA,gBAAgB,CAAA,CAAA,CAAA,EAAA,CAAA;AAAE,MAAA,CAAA,cAAA,C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Script sources
3
- // Browser-specific entry point that excludes Node.js dependencies
4
- // This exports only the runtime parser/decoder functionality
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const tslib_1 = require("tslib");
7
- // Re-export parser functionality
8
- tslib_1.__exportStar(require("./parser"), exports);
9
- // Re-export types
10
- tslib_1.__exportStar(require("./types"), exports);
11
- //# sourceMappingURL=mavlink.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mavlink.esm.js","sources":["../src/browser.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;;;AAEA;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA,CAAA;AAEA;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA,CAAA"}
@@ -1,17 +0,0 @@
1
- // @aircast-4g/mavlink - Bundled IIFE
2
- // Generated from TypeScript sources
3
- // Usage: window.AircastMAVLink
4
- (function () {
5
- 'use strict';
6
-
7
- // Browser-specific entry point that excludes Node.js dependencies
8
- // This exports only the runtime parser/decoder functionality
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- const tslib_1 = require("tslib");
11
- // Re-export parser functionality
12
- tslib_1.__exportStar(require("./parser"), exports);
13
- // Re-export types
14
- tslib_1.__exportStar(require("./types"), exports);
15
-
16
- })();
17
- //# sourceMappingURL=mavlink.iife.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mavlink.iife.js","sources":["../src/browser.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;CAAA;CACA;;;CAEA;CACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA,CAAA;CAEA;CACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA,CAAA;;;;;;"}