0

I'm working on a React Native Windows project, and am using the projected findAllDevicesAsync() method in Windows.Devices.Enumeration namespace. An overload of the function accepts an IIterable as an additional property, which I want to provide.

I have an array of properties defined in TypeScript:

const propertyKeys: string[] = [
    HOSTNAME_PROPERTY,
    SERVICENAME_PROPERTY,
    INSTANCENAME_PROPERTY,
    IPADDRESS_PROPERTY,
    PORTNUMBER_PROPERTY,
    TEXTATTRIBUTES_PROPERTY
    ];

When I pass this to the projected findAllAsync() method, I get the following error:

Argument of type 'string[]' is not assignable to parameter of type 'IIterable<string>'.
Property 'first' is missing in type 'string[]' but required in type 'IIterable<string>'

Docs for FindAllDevicesAPI

  • Why do you mark the project with C++/WinRT, you're using typescript right? Please provide a reproducible sample code https://stackoverflow.com/help/minimal-reproducible-example – Simon Mourier Aug 22 '23 at 06:54

0 Answers0