Closed matei-radu closed 2 years ago
@AnyPang :smile:
@matei-radu It's great! I use it in Egret,and it has the following compiling errors: Error scatter-js/packages/core/types/index.d.ts (144,13): A rest parameter must be of an array type. Error scatter-js/packages/core/types/index.d.ts (144,24): Cannot find name 'Parameters'. Error scatter-js/packages/core/types/index.d.ts (144,57): Cannot find name 'ReturnType'. Maybe the Egret has the lower version of the Typescripts compiler.How should I fix these errors?
Thanks for finding this!
I don't know what Egret is but you need TypeScript version 3.1 or above to use these types, which was released more than a year ago.
Awesome! Gonna go over these tomorrow <3
So, everything looks good at a glance (haven't pulled locally yet),
but how does this handle the dynamically added methods such as ScatterJS.eos()
?
This PR adds the first chunk of TypeScript declarations to the existing code base as requested in #39.
Overall I believe these types are imperfect but still a good starting point. Over time we will iterate and improve them through usage and developer feedback.
What is included
The focus is on most of the commonly used features of
@scatter-js/core
, such as:Network
object,connect
andlogin
methods, etc)Identity
,Account
and other objects returned from ScatterIn addition, typings for
@scatter-js/eosjs2
and@scatter-js/lynx
plugins are added.What is not included
any
.eosjs
package, mainly theApi
andJsonRpc
classes. However, I did not take the liberty of adding this package as a peer dependency (maybe @nsjames can tell me if it is ok or not) so for now, those types are replaced withany
as well.