Skip to content

Invalid PortInfo typscript declaration #2600

@loucass003

Description

@loucass003

SerialPort Version

10.5.0

Node Version

v18.10.0

Electron Version

No response

Platform

Microsoft Windows NT 10.0.22621.0 x64

Architecture

x64

Hardware or chipset of serialport

USB-SERIAL CH340

What steps will reproduce the bug?

const [first] = await SerialPort.list();
  
console.log(first);

What happens?

that code gives me back

     path: 'COM5',
     manufacturer: 'wch.cn',
     serialNumber: '6&28CF390B&0&5',
     pnpId: 'USB\\VID_1A86&PID_7523\\6&28CF390B&0&5',
     locationId: 'Port_#0005.Hub_#0001',
     friendlyName: 'USB-SERIAL CH340 (COM5)',
     vendorId: '1A86',
     productId: '7523'
}

the output is correct but the type deffinition is wrong

What should have happened?

on the portInfo definition there is only

export declare interface PortInfo {
    path: string;
    manufacturer: string | undefined;
    serialNumber: string | undefined;
    pnpId: string | undefined;
    locationId: string | undefined;
    productId: string | undefined;
    vendorId: string | undefined;
}

the friendlyName is missing from this definition but is acutally there in the sent object

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions