Skip to content

Import error in generated message-registry.ts #16

@FullPint

Description

@FullPint

The following were generated using common.xml:
enums/
messages/
message-registry.ts
tsconfig.json

Inside of message-registry.ts:

import {MAVLinkMessage} from 'node-mavlink';

TypesScript gives the following error: Cannot find module 'node-mavlink'.ts(2307)

When changing the line to import @ifrunistuttgart/node-mavlink instead of node-mavlink:

import {MAVLinkMessage} from '@ifrunistuttgart/node-mavlink';
...
/*
   All lines following the export now throw a complaint
*/
export const messageRegistry: Array<[number, new (system_id: number, component_id: number) => MAVLinkMessage]> = [

The type error where {MAVLink type} is any type coming from common.xml:

Type 'typeof {MAVLink Type}' is not assignable to type 'new (system_id: number, component_id: number) => MAVLinkMessage'.
  Type 'Heartbeat' is missing the following properties from type 'MAVLinkMessage': _system_id, _component_id, _payload_length, _extension_length, and 2 more.ts(2322)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions