Closed saidelike closed 2 months ago
Should we change the return type to Promise<any>
? Or maybe a sum type.
A sum type seems good?
I have an upcoming PR https://github.com/neovim/node-client/pull/338 to fix all the type errors (this project currently doesn't enforce strict
), this could follow that.
The prototype of executeLua is:
However when calling executeLua, it is possible that it returns a string. So we have to do something like this casting:
which is not great.
Indeed, it works great with arrays as we can use that casting:
but when only a single value is returned, we can't cast it without using the ugly "unknown" syntax.