We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems that the typings for echo are wrong.
It should accept function that only returns string, string[] or Promise
string
string[]
Promise
it accepts to return type of promise of everything.
Here are the typings:
declare namespace JQueryTerminal { type echoValue = string | string[] | Element | JQuery<Element> | (() => string | string[]); type setEchoValueFunction = (value: TypeOrPromise<echoValue>) => void; type greetingsArg = ((this: JQueryTerminal, setGreeting: setEchoValueFunction) => (void | TypeOrPromise<JQueryTerminal.echoValue>)) | string | null; } interface JQueryTerminal<TElement = HTMLElement> extends JQuery<TElement> { echo<TValue = JQueryTerminal.echoValue>(arg: TypeOrPromise<TValue>, options?: JQueryTerminal.EchoOptions): JQueryTerminal; }
You can't return the promise of jQuery Element, but this is how works according to types.
The text was updated successfully, but these errors were encountered:
it should be:
type echoValue = TypeOrPromise<string | string[] | Element | JQuery<Element>>| (() => TypeOrPromise<string | string[]>);
Sorry, something went wrong.
Also maybe it should be any because of renderHandler, but maybe that will be solved by a generic echo.
renderHandler
fix typings for echo #658
4333c67
No branches or pull requests
Issue summary
It seems that the typings for echo are wrong.
Expected behavior
It should accept function that only returns
string
,string[]
orPromise
Actual behavior
it accepts to return type of promise of everything.
Here are the typings:
You can't return the promise of jQuery Element, but this is how works according to types.
The text was updated successfully, but these errors were encountered: