This commit is contained in:
crusader 2017-12-18 21:40:05 +09:00
parent 90fb76955e
commit 19cd72fdde

View File

@ -0,0 +1,60 @@
export default class WebAppClient {
private url: string;
private conn: WebSocket;
private pendingRequests: Map<number, any>;
public constructor(url: string) {
this.url = url;
}
/**
* connect
*/
public connect(): Promise<void> {
return new Promise<void>((resolve, reject) => {
try {
this.conn = new WebSocket(this.url);
} catch(e) {
console.log(e);
}
});
}
/**
* close
*/
public close(): Promise<void> {
return new Promise<void>((resolve, reject) => {
try {
this.conn.close();
} catch(e) {
console.log(e);
}
});
}
/**
* close
*/
public send(): void {
}
/**
* close
*/
public call(method: string, ...params: any[]): void {
}
/**
* close
*/
public callTimeout(): void {
}
}