Fix TS compiler errors and pin TS to 2.7

This commit is contained in:
Kelvin Jin 2018-01-31 14:28:39 -08:00
parent 5e07d6096f
commit e3c3c3462f
6 changed files with 11 additions and 11 deletions

View File

@ -38,7 +38,7 @@
"through2": "^2.0.3", "through2": "^2.0.3",
"ts-node": "^3.3.0", "ts-node": "^3.3.0",
"tslint": "^5.5.0", "tslint": "^5.5.0",
"typescript": "^2.5.1", "typescript": "~2.7.0",
"xml2js": "^0.4.19" "xml2js": "^0.4.19"
}, },
"contributors": [ "contributors": [

View File

@ -19,7 +19,7 @@
"@types/node": "^8.0.55", "@types/node": "^8.0.55",
"clang-format": "^1.0.55", "clang-format": "^1.0.55",
"gts": "^0.5.1", "gts": "^0.5.1",
"typescript": "^2.6.1" "typescript": "~2.7.0"
}, },
"contributors": [ "contributors": [
{ {

View File

@ -76,7 +76,7 @@ export class Http2Channel extends EventEmitter implements Channel {
private connectivityState: ConnectivityState = ConnectivityState.IDLE; private connectivityState: ConnectivityState = ConnectivityState.IDLE;
/* For now, we have up to one subchannel, which will exist as long as we are /* For now, we have up to one subchannel, which will exist as long as we are
* connecting or trying to connect */ * connecting or trying to connect */
private subChannel: http2.ClientHttp2Session|null; private subChannel: http2.ClientHttp2Session|null = null;
private filterStackFactory: FilterStackFactory; private filterStackFactory: FilterStackFactory;
private subChannelConnectCallback: ()=>void = () => {}; private subChannelConnectCallback: ()=>void = () => {};
@ -123,7 +123,7 @@ export class Http2Channel extends EventEmitter implements Channel {
} }
// Transition from any of a set of oldStates to a specific newState // Transition from any of a set of oldStates to a specific newState
private transitionToState(oldStates: [ConnectivityState], newState: ConnectivityState): void { private transitionToState(oldStates: ConnectivityState[], newState: ConnectivityState): void {
if (oldStates.indexOf(this.connectivityState) > -1) { if (oldStates.indexOf(this.connectivityState) > -1) {
let oldState: ConnectivityState = this.connectivityState; let oldState: ConnectivityState = this.connectivityState;
this.connectivityState = newState; this.connectivityState = newState;

View File

@ -38,11 +38,11 @@ class ClientHttp2StreamMock extends stream.Duplex implements http2.ClientHttp2St
} }
bytesRead = 0; bytesRead = 0;
dataFrame = 0; dataFrame = 0;
aborted: boolean; aborted: boolean = false;
destroyed: boolean; destroyed: boolean = false;
rstCode: number; rstCode: number = 0;
session: http2.Http2Session; session: http2.Http2Session = {} as any;
state: http2.StreamState; state: http2.StreamState = {} as any;
priority = mockFunction; priority = mockFunction;
rstStream = mockFunction; rstStream = mockFunction;
rstWithNoError = mockFunction; rstWithNoError = mockFunction;

View File

@ -8,7 +8,7 @@ import {ChannelCredentials} from '../src/channel-credentials';
import {assert2, mockFunction} from './common'; import {assert2, mockFunction} from './common';
class CallCredentialsMock implements CallCredentials { class CallCredentialsMock implements CallCredentials {
child: CallCredentialsMock; child: CallCredentialsMock|null = null;
constructor(child?: CallCredentialsMock) { constructor(child?: CallCredentialsMock) {
if (child) { if (child) {
this.child = child; this.child = child;

View File

@ -29,6 +29,6 @@
}, },
"devDependencies": { "devDependencies": {
"gts": "^0.5.1", "gts": "^0.5.1",
"typescript": "^2.6.1" "typescript": "~2.7.0"
} }
} }