diff options
author | ab <abdullah_ahmed@brown.edu> | 2019-03-09 16:06:18 -0500 |
---|---|---|
committer | ab <abdullah_ahmed@brown.edu> | 2019-03-09 16:06:18 -0500 |
commit | a2b90031fe06701b0ecc7c6fa3b48c933e4d37b8 (patch) | |
tree | 541052a97652ad25b0829685f205ec35d3976743 /src/fields/TextField.ts | |
parent | b72ff1323bc76dc244ebe50893aa78064fd836c7 (diff) | |
parent | 09928503be98d605052fba65dcd2f91f9b056f23 (diff) |
fix
Diffstat (limited to 'src/fields/TextField.ts')
-rw-r--r-- | src/fields/TextField.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/fields/TextField.ts b/src/fields/TextField.ts index 11d2ed7cd..71d8ea310 100644 --- a/src/fields/TextField.ts +++ b/src/fields/TextField.ts @@ -1,8 +1,10 @@ import { BasicField } from "./BasicField" +import { FieldId } from "./Field"; +import { Types } from "../server/Message"; export class TextField extends BasicField<string> { - constructor(data: string = "") { - super(data); + constructor(data: string = "", id?: FieldId, save: boolean = true) { + super(data, save, id); } ToScriptString(): string { @@ -12,4 +14,12 @@ export class TextField extends BasicField<string> { Copy() { return new TextField(this.Data); } -} + + ToJson(): { type: Types, data: string, _id: string } { + return { + type: Types.Text, + data: this.Data, + _id: this.Id + } + } +}
\ No newline at end of file |