Skip to content

Suggest values #37492

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

Closed
VimHax opened this issue Mar 20, 2020 · 1 comment
Closed

Suggest values #37492

VimHax opened this issue Mar 20, 2020 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@VimHax
Copy link

VimHax commented Mar 20, 2020

Search Terms

Suggest, Suggestion, Suggest Values

Suggestion

type Suggest = string | 'hello' | 'world';
var x: Suggest = 'hello';

When typing out the value of x i.e. 'hello', it should suggest, not force, the values given in the type, so 'hello' & 'world'.

Use Cases

For example, if you are define the on method of the Node.js EventEmitter, on: (event: Event, listener: EventListener) => this; , & you want the user to be able to emit custom events, you can't suggest them existing events without forcing them to only use them.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Mar 20, 2020
@RyanCavanaugh
Copy link
Member

Duplicate #33471

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants