node-simconnect icon indicating copy to clipboard operation
node-simconnect copied to clipboard

Better type safety for `DataRequestId`, `DataDefinitionId`, `ClientDataDefinitionId`, etc

Open EvenAR opened this issue 1 year ago • 0 comments

Today these are just aliases for number and provide no type safety at all. For instance, it should not be possible to pass a DataRequestId to the DataDefinitionId parameter of a function.

One way to improve the type safety is to make the types "opaque". A singleton class could be provided for generating new id's with the correct type.

EvenAR avatar Jul 07 '23 18:07 EvenAR