Comments (7)
This looks good then! Probably just call it types.d.ts
and put it at the root of the project so it doesn't get confused with the actual source and the babel build
from binance-api-node.
Hello Ben, thanks!
I've mixed feelings about JS typings to be honest, but I know some people grew to like it. What would it imply in term of configuration in this repository exactly? I would prefer if we kept it as simple as possible (all the babel thing is already a tad big imho), but is that even possible to separate typings and the repo source?
from binance-api-node.
It doesn't require much. In order to serve typings together with your module, you just need to do two simple steps.
- Add an
index.d.ts
file (with all the type definitions) to the repository - Reference the
index.d.ts
file in yourpackage.json
with atypes
attribute
There is good documentation here: http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html
And here is a live example (which I did in the past): https://github.com/caiogondim/logdown.js/pull/45/files
from binance-api-node.
Do you think we should keep this opened as long as everything is not typed for tracking purposes?
from binance-api-node.
Yes, let's keep it as a reminder. 😃
I can also make a list of the methods which are still missing definitions for tracking purposes.
Reminder to myself
Turn:
import Binance from 'binance-api-node'
const client: any = this.client = Binance({
apiKey: process.env.BINANCE_API_KEY,
apiSecret: process.env.BINANCE_API_SECRET,
})
Into:
import Binance, {BinanceClient} from 'binance-api-node'
const client: BinanceClient = this.client = Binance({
apiKey: process.env.BINANCE_API_KEY,
apiSecret: process.env.BINANCE_API_SECRET,
})
from binance-api-node.
Closing as binance-exchange#4. Improvements of typings will be expressed by new issues, thanks for your help @bennyn!
from binance-api-node.
@balthazar Okay! Looking forward we should consider using tsd-jsdoc. It would give us the ability to automatically generate type definitions from JSDoc comments. 😃
from binance-api-node.
Related Issues (20)
- Add changelog HOT 3
- I
- Dust Transfer typings missing HOT 1
- Partial depth not working
- How do you get the current position info for future account? HOT 1
- Reconnecting-websocket options not working? HOT 1
- TypeError: fetch failed HOT 1
- fix about node:fetch? HOT 1
- Module "crypto" has been externalized for browser compatibility HOT 2
- DeprecationWarning: crypto.DEFAULT_ENCODING is deprecated.
- TypeError: Binance is not a function HOT 2
- futuresCancelBatchOrders lacks return-type annotation HOT 3
- Different data
- Opening an order with TP/SL HOT 5
- quantity parameter on Trailling Stop futuresOrder
- Incorrect data type of batchOrders in futuresBatchOrders
- futuresCancelBatchOrders return type error
- Websocket was closed before the connection was estabilshed with binance-api-node ticker and futuresticker
- Error: Invalid API-key, IP, or permissions for action. HOT 2
- How to keep TCP connection alive for REST requests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from binance-api-node.