Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide the API version for TS' HttpTunnelManagementClient as an enumeration #361

Closed
connor4312 opened this issue Dec 5, 2023 · 2 comments
Assignees

Comments

@connor4312
Copy link
Member

The valid versions of the apiVersion passed into the HttpTunnelManagementClient are checked at runtime and an error is thrown if invalid

if (apiVersions.indexOf(apiVersion) === -1) {
throw new TypeError(`Invalid API version: ${apiVersion}, must be one of ${apiVersions}`);
}

It would be less error-prone if API vesions were exposed as a type (e.g. an enum or union of string types) so that they can be checked at compile-time.

This led to some confusion in https://github.com/microsoft/vscode-remote-tunnels/pull/709#discussion_r1416362126

@connor4312 connor4312 changed the title Provide the TS API version as an enumeration Provide the API version for TS' HttpTunnelManagementClient as an enumeration Dec 5, 2023
@derekbekoe
Copy link
Contributor

@jfullerton44 can this be done?

@jfullerton44
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants