From 19cd72fdded779e9f024834e6ac4d0739df2857b Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 18 Dec 2017 21:40:05 +0900 Subject: [PATCH] ing --- .../webapp/client/central/webapp/client.ts | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/ts/@overflow/webapp/client/central/webapp/client.ts diff --git a/src/ts/@overflow/webapp/client/central/webapp/client.ts b/src/ts/@overflow/webapp/client/central/webapp/client.ts new file mode 100644 index 0000000..033c730 --- /dev/null +++ b/src/ts/@overflow/webapp/client/central/webapp/client.ts @@ -0,0 +1,60 @@ + +export default class WebAppClient { + private url: string; + private conn: WebSocket; + + private pendingRequests: Map; + + public constructor(url: string) { + this.url = url; + + } + + /** + * connect + */ + public connect(): Promise { + return new Promise((resolve, reject) => { + try { + this.conn = new WebSocket(this.url); + } catch(e) { + console.log(e); + } + }); + } + + /** + * close + */ + public close(): Promise { + return new Promise((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 { + + } + + +}