tiagosiebler / orderbooks

Simple utility classes to handle orderbook snapshot & delta events in node.js, with examples for Bybit & Binance.
131 stars 34 forks source link

Wrong typings #9

Closed yovanoc closed 2 years ago

yovanoc commented 2 years ago

There is an issue with the typings, we should add array and not | [] here

handleDelta(symbol: string, deleteLevels: OrderBookLevelState | [] | undefined, updateLevels: OrderBookLevelState | [] | undefined, insertLevels: OrderBookLevelState | [] | undefined, timestamp?: number): OrderBook;

should be

handleDelta(symbol: string, deleteLevels: OrderBookLevelState[] | undefined, updateLevels: OrderBookLevelState[] | undefined, insertLevels: OrderBookLevelState[] | undefined, timestamp?: number): OrderBook;
tiagosiebler commented 2 years ago

ah that's a good catch, my bad. Fortunately only a type error - will fix shortly. Thanks for letting me know.

tiagosiebler commented 2 years ago

Fixed in v1.1.2. If you notice anything else, please let me know. Thanks!