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

Enforce option value via types #889

Closed
Tyriar opened this issue Aug 16, 2017 · 1 comment
Closed

Enforce option value via types #889

Tyriar opened this issue Aug 16, 2017 · 1 comment
Labels
help wanted type/enhancement Features or improvements to existing features
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Aug 16, 2017

I think we can extend StringOption and similar to actually check the value at compile time, not just the type.

https://github.com/sourcelair/xterm.js/blob/39328d6e0c05b1f1f574303ad0288687ca6f813f/src/Types.ts#L33-L35

@Tyriar
Copy link
Member Author

Tyriar commented Feb 26, 2018

I think this is already done in setOption:

    setOption(key: 'bellStyle', value: null | 'none' | 'visual' | 'sound' | 'both'): void;
    /**
     * Sets an option on the terminal.
     * @param key The option key.
     * @param value The option value.
     */
    setOption(key: 'cursorStyle', value: null | 'block' | 'underline' | 'bar'): void;

@Tyriar Tyriar closed this as completed Feb 26, 2018
@Tyriar Tyriar added this to the 3.2.0 milestone Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type/enhancement Features or improvements to existing features
Projects
None yet
Development

No branches or pull requests

1 participant