.d.t.s generation is missing "static" keyword for event on a static interface
nichamp opened this issue · comments
nichamp commented
For example, for Windows.Networking.Connectivity.NetworkInformation it emits:
abstract class NetworkInformation {
static findConnectionProfilesAsync(pProfileFilter: any): Windows.Foundation.WinRTPromise<Windows.Foundation.Collections.IVectorView<Windows.Networking.Connectivity.ConnectionProfile>, void>;
static getConnectionProfiles(): Windows.Foundation.Collections.IVectorView<Windows.Networking.Connectivity.ConnectionProfile>;
static getInternetConnectionProfile(): Windows.Networking.Connectivity.ConnectionProfile;
static getLanIdentifiers(): Windows.Foundation.Collections.IVectorView<any>;
static getHostNames(): Windows.Foundation.Collections.IVectorView<any>;
static getProxyConfigurationAsync(uri: Windows.Foundation.Uri): Windows.Foundation.WinRTPromise<any, void>;
static getSortedEndpointPairs(destinationList: Windows.Foundation.Collections.IIterable<any>, sortOptions: any): Windows.Foundation.Collections.IVectorView<any>;
addEventListener(type: "networkstatuschanged", listener: Windows.Networking.Connectivity.NetworkStatusChangedEventHandler): void
removeEventListener(type: "networkstatuschanged", listener: Windows.Networking.Connectivity.NetworkStatusChangedEventHandler): void
}
where as the IDL has
[uuid(5074F851-950D-4165-9C15-365619481EEA), exclusiveto(NetworkInformation)]
[contract(Windows.Foundation.UniversalApiContract, 1)]
interface INetworkInformationStatics : IInspectable
{
...
[eventadd] HRESULT NetworkStatusChanged(
[in] NetworkStatusChangedEventHandler* networkStatusHandler,
[out, retval] EventRegistrationToken* eventCookie);
[eventremove] HRESULT NetworkStatusChanged([in] EventRegistrationToken eventCookie);
}
Duncan Horn commented
Forgive my lack of TS knowledge. What is the expected code-gen in this situation?
Duncan Horn commented
Oh, I see. The metadata is kind of confusing in this case. There's not much of an indication that the event is static although the add/remove functions are marked as static.