aboutsummaryrefslogtreecommitdiff
path: root/src/fields/HtmlField.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-05-15 00:03:41 -0700
committerSam Wilkins <samwilkins333@gmail.com>2020-05-15 00:03:41 -0700
commit2b79008596351f6948d8de80c7887446d97b068c (patch)
tree7f393199bf780936cee1427c07c64bd2745fa3f9 /src/fields/HtmlField.ts
parentb9440e34d89b28acacdd6eed2cda39cd2a1d8c46 (diff)
renamed new_fields to fields
Diffstat (limited to 'src/fields/HtmlField.ts')
-rw-r--r--src/fields/HtmlField.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/fields/HtmlField.ts b/src/fields/HtmlField.ts
new file mode 100644
index 000000000..6e8bba977
--- /dev/null
+++ b/src/fields/HtmlField.ts
@@ -0,0 +1,26 @@
+import { Deserializable } from "../client/util/SerializationHelper";
+import { serializable, primitive } from "serializr";
+import { ObjectField } from "./ObjectField";
+import { Copy, ToScriptString, ToString} from "./FieldSymbols";
+
+@Deserializable("html")
+export class HtmlField extends ObjectField {
+ @serializable(primitive())
+ readonly html: string;
+
+ constructor(html: string) {
+ super();
+ this.html = html;
+ }
+
+ [Copy]() {
+ return new HtmlField(this.html);
+ }
+
+ [ToScriptString]() {
+ return "invalid";
+ }
+ [ToString]() {
+ return this.html;
+ }
+}