aboutsummaryrefslogtreecommitdiff
path: root/src/client/SocketStub.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-03-22 02:57:16 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-03-22 02:57:16 -0400
commit618fc97d28686c256bb3b179ada482f142b9bd31 (patch)
tree894eb0e82f30b9e506e19cdaaa219afbc637ddcb /src/client/SocketStub.ts
parentadaba603d22ae28feb2d4d1a5eda43a52f8ad9ba (diff)
Added interface for GetFields request
Added one more Promise
Diffstat (limited to 'src/client/SocketStub.ts')
-rw-r--r--src/client/SocketStub.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/SocketStub.ts b/src/client/SocketStub.ts
index 27528c4c3..5045037c5 100644
--- a/src/client/SocketStub.ts
+++ b/src/client/SocketStub.ts
@@ -7,6 +7,11 @@ import { Utils } from "../Utils";
import { Server } from "./Server";
import { ServerUtils } from "../server/ServerUtil";
+
+export interface FieldMap {
+ [id: string]: Opt<Field>;
+}
+
//TODO tfs: I think it might be cleaner to not have SocketStub deal with turning what the server gives it into Fields (in other words not call ServerUtils.FromJson), and leave that for the Server class.
export class SocketStub {
@@ -54,7 +59,7 @@ export class SocketStub {
}
}
- public static SEND_FIELDS_REQUEST(fieldIds: FieldId[], callback: (fields: { [key: string]: Field }) => any) {
+ public static SEND_FIELDS_REQUEST(fieldIds: FieldId[], callback: (fields: FieldMap) => any) {
Utils.EmitCallback(Server.Socket, MessageStore.GetFields, fieldIds, (fields: any[]) => {
let fieldMap: any = {};
for (let field of fields) {