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
fix: update type definitions #261
base: master
Are you sure you want to change the base?
Conversation
Converted some support functions to TypeScript
input, confirm, numberal, password, invisible, toggle, basicauth
So that they can be used when declaring custom types
or else cannot support mix Question + Fn. also restored original typescript test
The skipped test could be a bug, but without a clean way to test the code, it is more problematic to fix it then not.
Hi @unional – thanks for this PR! I'm noticing a lot of inaccuracies in the current type definitions (I'm having to use Are you still working on this? How can I help get this merged? |
Thanks @bitjson |
Here is the new type definition.
I have moved the test files to a different folder and keep the existing JS tests
The
prompt
function support discriminated unions. It means depending on thetype
, you will get different code completion.The actual
Prompt
and their sub-classes have their own types and separate from those used in theprompt
function because I'm not very clear on what property, method, and options these classes should expose for customization and for creating custom prompts. So separating them allow them to be evolved and expend separately.Let me know what do you think. 🍺