aboutsummaryrefslogtreecommitdiff
path: root/src/server/Message.ts
diff options
context:
space:
mode:
authoryipstanley <stanley_yip@brown.edu>2019-02-13 20:17:21 -0500
committeryipstanley <stanley_yip@brown.edu>2019-02-13 20:17:21 -0500
commitf3544f004a696e4682fbd8d1f18ac69beec59439 (patch)
tree0839c355fe813ba494c6451b9017c5e325e1cfb8 /src/server/Message.ts
parent430878f6dd8d36b1322e15d0898ada0d44fecacb (diff)
asdfkj
Diffstat (limited to 'src/server/Message.ts')
-rw-r--r--src/server/Message.ts29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/server/Message.ts b/src/server/Message.ts
index 0391b6671..f63168223 100644
--- a/src/server/Message.ts
+++ b/src/server/Message.ts
@@ -52,9 +52,9 @@ export enum Types {
export class DocumentTransfer implements Transferable {
readonly type = Types.Document
- _id: ObjectId;
+ _id: string
- constructor(readonly obj: { type: Types, data: [string, string][], _id: ObjectId }) {
+ constructor(readonly obj: { type: Types, data: [string, string][], _id: string }) {
this._id = obj._id
}
}
@@ -62,56 +62,56 @@ export class DocumentTransfer implements Transferable {
export class ImageTransfer implements Transferable {
readonly type = Types.Image
- constructor(readonly _id: ObjectId) { }
+ constructor(readonly _id: string) { }
}
export class KeyTransfer implements Transferable {
name: string
- readonly _id: ObjectId
+ readonly _id: string
readonly type = Types.Key
constructor(i: string, n: string) {
this.name = n
- this._id = new ObjectId(i)
+ this._id = i
}
}
export class ListTransfer implements Transferable {
type = Types.List;
- constructor(readonly _id: ObjectId) { }
+ constructor(readonly _id: string) { }
}
export class NumberTransfer implements Transferable {
readonly type = Types.Number
- constructor(readonly value: number, readonly _id: ObjectId) { }
+ constructor(readonly value: number, readonly _id: string) { }
}
export class TextTransfer implements Transferable {
value: string
- readonly _id: ObjectId
+ readonly _id: string
readonly type = Types.Text
constructor(t: string, i: string) {
this.value = t
- this._id = new ObjectId(i)
+ this._id = i
}
}
export class RichTextTransfer implements Transferable {
value: string
- readonly _id: ObjectId
+ readonly _id: string
readonly type = Types.Text
constructor(t: string, i: string) {
this.value = t
- this._id = new ObjectId(i)
+ this._id = i
}
}
export interface Transferable {
- readonly _id: ObjectId
+ readonly _id: string
readonly type: Types
}
@@ -119,6 +119,7 @@ export namespace MessageStore {
export const Foo = new Message<string>("Foo");
export const Bar = new Message<string>("Bar");
export const AddDocument = new Message<DocumentTransfer>("Add Document");
- export const SetField = new Message<{ _id: ObjectId, data: any, type: Types }>("Set Field")
- export const GetField = new Message<GetFieldArgs>("Get Field")
+ export const SetField = new Message<{ _id: string, data: any, type: Types }>("Set Field")
+ export const GetField = new Message<string>("Get Field")
+ export const GetDocument = new Message<string>("Get Document");
} \ No newline at end of file