@@ -11,7 +11,7 @@ export interface WebSocketInterface {
1111 path : string ,
1212 textHandler : ( ( text : string ) => boolean ) | null ,
1313 binaryHandler : ( ( stream : number , buff : Buffer ) => boolean ) | null ,
14- ) : Promise < WebSocket > ;
14+ ) : Promise < WebSocket . WebSocket > ;
1515}
1616
1717export class WebSocketHandler implements WebSocketInterface {
@@ -50,7 +50,7 @@ export class WebSocketHandler implements WebSocketInterface {
5050 }
5151
5252 public static handleStandardInput (
53- ws : WebSocket ,
53+ ws : WebSocket . WebSocket ,
5454 stdin : stream . Readable | any ,
5555 streamNum : number = 0 ,
5656 ) : boolean {
@@ -74,11 +74,11 @@ export class WebSocketHandler implements WebSocketInterface {
7474
7575 public static async processData (
7676 data : string | Buffer ,
77- ws : WebSocket | null ,
78- createWS : ( ) => Promise < WebSocket > ,
77+ ws : WebSocket . WebSocket | null ,
78+ createWS : ( ) => Promise < WebSocket . WebSocket > ,
7979 streamNum : number = 0 ,
8080 retryCount : number = 3 ,
81- ) : Promise < WebSocket | null > {
81+ ) : Promise < WebSocket . WebSocket | null > {
8282 const buff = Buffer . alloc ( data . length + 1 ) ;
8383
8484 buff . writeInt8 ( streamNum , 0 ) ;
@@ -108,17 +108,17 @@ export class WebSocketHandler implements WebSocketInterface {
108108 }
109109
110110 public static restartableHandleStandardInput (
111- createWS : ( ) => Promise < WebSocket > ,
111+ createWS : ( ) => Promise < WebSocket . WebSocket > ,
112112 stdin : stream . Readable | any ,
113113 streamNum : number = 0 ,
114114 retryCount : number = 3 ,
115- ) : ( ) => WebSocket | null {
115+ ) : ( ) => WebSocket . WebSocket | null {
116116 if ( retryCount < 0 ) {
117117 throw new Error ( "retryCount can't be lower than 0." ) ;
118118 }
119119
120120 let queue : Promise < void > = Promise . resolve ( ) ;
121- let ws : WebSocket | null = null ;
121+ let ws : WebSocket . WebSocket | null = null ;
122122
123123 stdin . on ( 'data' , ( data ) => {
124124 queue = queue . then ( async ( ) => {
@@ -138,7 +138,7 @@ export class WebSocketHandler implements WebSocketInterface {
138138 // factory is really just for test injection
139139 public constructor (
140140 readonly config : KubeConfig ,
141- readonly socketFactory ?: ( uri : string , opts : WebSocket . ClientOptions ) => WebSocket ,
141+ readonly socketFactory ?: ( uri : string , opts : WebSocket . ClientOptions ) => WebSocket . WebSocket ,
142142 ) { }
143143
144144 /**
@@ -153,7 +153,7 @@ export class WebSocketHandler implements WebSocketInterface {
153153 path : string ,
154154 textHandler : ( ( text : string ) => boolean ) | null ,
155155 binaryHandler : ( ( stream : number , buff : Buffer ) => boolean ) | null ,
156- ) : Promise < WebSocket > {
156+ ) : Promise < WebSocket . WebSocket > {
157157 const cluster = this . config . getCurrentCluster ( ) ;
158158 if ( ! cluster ) {
159159 throw new Error ( 'No cluster is defined.' ) ;
@@ -168,7 +168,7 @@ export class WebSocketHandler implements WebSocketInterface {
168168
169169 await this . config . applyToHTTPSOptions ( opts ) ;
170170
171- return await new Promise < WebSocket > ( ( resolve , reject ) => {
171+ return await new Promise < WebSocket . WebSocket > ( ( resolve , reject ) => {
172172 const client = this . socketFactory
173173 ? this . socketFactory ( uri , opts )
174174 : new WebSocket ( uri , protocols , opts ) ;
0 commit comments