Request: Supports custom status types
We should be able to pass our own state type to usePrefix as in the case of makeTheme.
This would be especially useful for those that use a state other than the one defined by inquirer, as in my case with inquirer-file-selector, which uses a state of its own to define when the user cancels the prompt.
That's a reasonable request. PR welcomed is anyone gets to it before I do.
@br14n-sol @SBoudrias I would like to work on this but there are a few doubts that I have:
- There is some logic written on the
loadingstate, what will happen to it if we start allowing users to define custom logic? - I am understanding that if the user have passed custom states, then he needs to pass some
fnis args which will returntrue/falsefor loading state
Hey @malavshah9 👋🏻 Unknown state would try to get theme.prefix[status] for their prefix; we might want to add a fallback to idle on unknown and undefined prefix icons.
Also, make sure we maintain the TS auto-suggestions to propose known values in the editor. I forgot exactly, but there's a trick to not replace the type with string autocomplete suggestion.