diff options
author | yipstanley <stanley_yip@brown.edu> | 2019-02-11 20:25:15 -0500 |
---|---|---|
committer | yipstanley <stanley_yip@brown.edu> | 2019-02-11 20:25:15 -0500 |
commit | 867fd2bffb67be06e889d3ac0fb6603bc8c4d92a (patch) | |
tree | 6b045d218d8211b5e0ac9f2b7fdb9e45dfe30515 /src/fields/ImageField.ts | |
parent | 448f8880b50dc50090a596cafaf68d2f444ce3db (diff) |
asdkjfl
Diffstat (limited to 'src/fields/ImageField.ts')
-rw-r--r-- | src/fields/ImageField.ts | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/fields/ImageField.ts b/src/fields/ImageField.ts index d82260f54..8ffc6d680 100644 --- a/src/fields/ImageField.ts +++ b/src/fields/ImageField.ts @@ -1,9 +1,10 @@ import { BasicField } from "./BasicField"; -import { Field } from "./Field"; +import { Field, FIELD_ID } from "./Field"; +import { Types } from "../server/Message"; export class ImageField extends BasicField<URL> { - constructor(data: URL | undefined = undefined) { - super(data == undefined ? new URL("http://cs.brown.edu/~bcz/bob_fettucine.jpg") : data); + constructor(data: URL | undefined = undefined, id: FIELD_ID = undefined) { + super(data == undefined ? new URL("http://cs.brown.edu/~bcz/bob_fettucine.jpg") : data, id); } toString(): string { @@ -18,4 +19,11 @@ export class ImageField extends BasicField<URL> { return new ImageField(this.Data); } + ToJson(): { type: Types, data: URL, id: string } { + return { + type: Types.Image, + data: this.Data, + id: this.Id as string + } + } }
\ No newline at end of file |