|
@@ -17,8 +17,8 @@ function stripAfterEquals(str:string):string{
|
17
|
17
|
* A websocket-on-steroids with built-in RPC capabilities
|
18
|
18
|
*/
|
19
|
19
|
export class RPCSocket implements I.Socket{
|
20
|
|
- static async makeSocket<T extends T.RPCInterface= T.RPCInterface>(port:number, server: string, sesame?:string, conf?:T.SocketConf): Promise<RPCSocket & T.RPCInterface<T>> {
|
21
|
|
- const socket = <RPCSocket & T> new RPCSocket(port, server, conf)
|
|
20
|
+ static async makeSocket<T extends T.RPCInterface = T.RPCInterface>(port:number, server: string, sesame?:string, conf?:T.SocketConf): Promise<RPCSocket & T> {
|
|
21
|
+ const socket = new RPCSocket(port, server, conf)
|
22
|
22
|
return await socket.connect<T>(sesame)
|
23
|
23
|
}
|
24
|
24
|
|
|
@@ -95,7 +95,7 @@ export class RPCSocket implements I.Socket{
|
95
|
95
|
/**
|
96
|
96
|
* Connects to the server and attaches available RPCs to this object
|
97
|
97
|
*/
|
98
|
|
- public async connect<T extends T.RPCInterface= T.RPCInterface>( sesame?: string ) : Promise<RPCSocket & T.RPCInterface<T>>{
|
|
98
|
+ public async connect<T extends T.RPCInterface= T.RPCInterface>( sesame?: string ) : Promise<RPCSocket & T>{
|
99
|
99
|
this.socket = await bsock.connect(this.port, this.server, this.conf.tls?this.conf.tls:false)
|
100
|
100
|
|
101
|
101
|
const info:T.ExtendedRpcInfo[] = await this.info()
|