You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both opts and s have any type according to my TypeScript language server.
Looking at the source code, I see that sftp() has a type SFTP in SSH2Promise class type, and many of the types, and extends BaseSSH2Promise which has mostly any types.
I also see the SSHConnection type which does seem to have the more strict types that I'd like to use, but it's not clear how to use that class "correctly".
If feels like much of the desired types are in the source code but that they're just not quite linked to each other properly. Do we need another round of #55? I see some other discussions of this issue specifically in #12 but that has been closed and merged. Should these issues still be happening or am I doing something stupid? Or maybe the readme should be updated to suggest using new SSH2Promise.SSH() instead?
But using SSH2Promise.SSH doesn't have the same Promise versions of the sftp() commands...
The text was updated successfully, but these errors were encountered:
Adding to this confusion... the types for SSH2Promise.shell() seem incomplete.
TypeScript server thinks it only takes 1 argument of type any, from the BaseSSH2Promise type, but it the base implementation takes 2 arguments. It looks like the implementation here doesn't allow using the second argument:
I'm trying to use this package as described in the readme:
Some functions, like
.sftp()
, are typed properly and chained calls work as expected:But other functions get
any
types inferred.Both
opts
ands
haveany
type according to my TypeScript language server.Looking at the source code, I see that
sftp()
has a typeSFTP
inSSH2Promise
class type, and many of the types, and extendsBaseSSH2Promise
which has mostlyany
types.I also see the
SSHConnection
type which does seem to have the more strict types that I'd like to use, but it's not clear how to use that class "correctly".If feels like much of the desired types are in the source code but that they're just not quite linked to each other properly. Do we need another round of #55? I see some other discussions of this issue specifically in #12 but that has been closed and merged. Should these issues still be happening or am I doing something stupid? Or maybe the readme should be updated to suggest using
new SSH2Promise.SSH()
instead?But using
SSH2Promise.SSH
doesn't have the same Promise versions of the sftp() commands...The text was updated successfully, but these errors were encountered: