diff options
author | eperelm2 <emily_perelman@brown.edu> | 2023-08-10 18:46:04 -0400 |
---|---|---|
committer | eperelm2 <emily_perelman@brown.edu> | 2023-08-10 18:46:04 -0400 |
commit | 1c5bb5390ab9f198acde7d48aaa7d7d536f432cd (patch) | |
tree | b80984ea3b07d79925eeb7194ff6dedb6d38cf87 /src/fields/IconField.ts | |
parent | 082a280ed989007d84c8619438889c64a6fedb14 (diff) |
need to pull
Diffstat (limited to 'src/fields/IconField.ts')
-rw-r--r-- | src/fields/IconField.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/fields/IconField.ts b/src/fields/IconField.ts new file mode 100644 index 000000000..76c4ddf1b --- /dev/null +++ b/src/fields/IconField.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("icon") +export class IconField extends ObjectField { + @serializable(primitive()) + readonly icon: string; + + constructor(icon: string) { + super(); + this.icon = icon; + } + + [Copy]() { + return new IconField(this.icon); + } + + [ToScriptString]() { + return "invalid"; + } + [ToString]() { + return "ICONfield"; + } +} |