Skip to content

Commit

Permalink
Upgrade to typescript 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelgrosner committed Jul 13, 2017
1 parent 64518d8 commit dd5247f
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/mongodb": "^2.1.43",
"@types/node": "^7.0.12",
"@types/q": "^1.0.0",
"@types/request": "0.0.42",
"@types/request": "0.0.46",
"@types/serve-static": "^1.7.31",
"@types/socket.io": "^1.4.29",
"@types/socket.io-client": "^1.4.29",
Expand Down Expand Up @@ -57,7 +57,7 @@
"shortid": "2.2.8",
"socket.io": "^1.4.5",
"socket.io-client": "1.7.3",
"typescript": "2.2.2",
"typescript": "^2.4.1",
"typings": "2.1.0",
"utf-8-validate": "^1.2.1",
"ws": "^1.0.1"
Expand Down
4 changes: 2 additions & 2 deletions src/admin/pair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ export class DisplayPair {

this._subscribers.push(connectivitySubscriber);

const activeSub = subscriberFactory.getSubscriber(scope, Messaging.Topics.ActiveChange);
const activeSub = subscriberFactory.getSubscriber<boolean>(scope, Messaging.Topics.ActiveChange);
this.active = new QuotingButtonViewModel(
activeSub,
fireFactory.getFire(Messaging.Topics.ActiveChange)
);
this._subscribers.push(activeSub);

const qpSub = subscriberFactory.getSubscriber(scope, Messaging.Topics.QuotingParametersChange);
const qpSub = subscriberFactory.getSubscriber<Models.QuotingParameters>(scope, Messaging.Topics.QuotingParametersChange);
this.quotingParameters = new DisplayQuotingParameters(
qpSub,
fireFactory.getFire(Messaging.Topics.QuotingParametersChange)
Expand Down
2 changes: 1 addition & 1 deletion src/service/gateways/coinbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class CoinbaseOrderBook {

class CoinbaseMarketDataGateway implements Interfaces.IMarketDataGateway {
MarketData = new Utils.Evt<Models.Market>();
MarketTrade = new Utils.Evt<Models.MarketSide>();
MarketTrade = new Utils.Evt<Models.GatewayMarketTrade>();
ConnectChanged = new Utils.Evt<Models.ConnectivityStatus>();

private onReceived = (msg: CoinbaseReceived, t: Date) => {
Expand Down
2 changes: 1 addition & 1 deletion src/service/gateways/hitbtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class SideMarketData {

class HitBtcMarketDataGateway implements Interfaces.IMarketDataGateway {
MarketData = new Utils.Evt<Models.Market>();
MarketTrade = new Utils.Evt<Models.MarketSide>();
MarketTrade = new Utils.Evt<Models.GatewayMarketTrade>();
private readonly _marketDataWs : WebSocket;

private _hasProcessedSnapshot = false;
Expand Down
2 changes: 1 addition & 1 deletion src/service/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface IOrderEntryGateway extends IGateway {
cancelOrder(cancel: Models.OrderStatusReport): void;
replaceOrder(replace: Models.OrderStatusReport): void;

OrderUpdate: Utils.Evt<Models.OrderStatusReport>;
OrderUpdate: Utils.Evt<Models.OrderStatusUpdate>;

cancelsByClientOrderId: boolean;
generateClientOrderId(): string;
Expand Down
10 changes: 5 additions & 5 deletions src/service/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ interface SimulationClasses {
getExch(orderCache: Broker.OrderStateCache): Promise<Interfaces.CombinedGateway>;
getReceiver<T>(topic: string) : Messaging.IReceive<T>;
getPersister<T extends Persister.Persistable>(collectionName: string) : Promise<Persister.ILoadAll<T>>;
getRepository<T extends Persister.Persistable>(defValue: T, collectionName: string) : Persister.ILoadLatest<T>;
getRepository<T>(defValue: T, collectionName: string) : Persister.ILoadLatest<T>;
getPublisher<T>(topic: string, persister?: Persister.ILoadAll<T>): Messaging.IPublish<T>;
}

Expand Down Expand Up @@ -301,10 +301,10 @@ const runTradingSystem = async (classes: SimulationClasses) : Promise<void> => {
messages.publish("start up");

const getReceiver = classes.getReceiver;
const activeReceiver = getReceiver(Messaging.Topics.ActiveChange);
const quotingParametersReceiver = getReceiver(Messaging.Topics.QuotingParametersChange);
const submitOrderReceiver = getReceiver(Messaging.Topics.SubmitNewOrder);
const cancelOrderReceiver = getReceiver(Messaging.Topics.CancelOrder);
const activeReceiver = getReceiver<boolean>(Messaging.Topics.ActiveChange);
const quotingParametersReceiver = getReceiver<Models.QuotingParameters>(Messaging.Topics.QuotingParametersChange);
const submitOrderReceiver = getReceiver<Models.OrderRequestFromUI>(Messaging.Topics.SubmitNewOrder);
const cancelOrderReceiver = getReceiver<Models.OrderStatusReport>(Messaging.Topics.CancelOrder);
const cancelAllOrdersReceiver = getReceiver(Messaging.Topics.CancelAllOrders);

const broker = new Broker.ExchangeBroker(pair, gateway.md, gateway.base, gateway.oe, connectivity);
Expand Down
4 changes: 2 additions & 2 deletions src/service/persister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface ILoadAll<T> extends IPersist<T> {
loadAll(limit?: number, query?: Object): Promise<T[]>;
}

export class RepositoryPersister<T extends Persistable> implements ILoadLatest<T> {
export class RepositoryPersister<T> implements ILoadLatest<T> {
private _log = log("tribeca:exchangebroker:repopersister");

public loadLatest = async (): Promise<T> => {
Expand Down Expand Up @@ -73,7 +73,7 @@ export class RepositoryPersister<T extends Persistable> implements ILoadLatest<T
}).done();
};

private converter = (x: T) : T => {
private converter = (x: any) : T => {
if (typeof x.exchange === "undefined")
x.exchange = this._exchange;
if (typeof x.pair === "undefined")
Expand Down

0 comments on commit dd5247f

Please sign in to comment.