diff options
author | Stanley Yip <stanley_yip@brown.edu> | 2020-05-20 22:18:13 -0700 |
---|---|---|
committer | Stanley Yip <stanley_yip@brown.edu> | 2020-05-20 22:18:13 -0700 |
commit | 1113da5f2db22bd2b2b457b1f5b183d7f1f2e68d (patch) | |
tree | a559fa400fedb87799cba4f85451460f649c46dd /src/fields/ObjectField.ts | |
parent | 4109fea6787608022c8f5c147fa4fb9ad26e92eb (diff) | |
parent | 45386f6950e5ae8390486900a430061bfe9e4846 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/fields/ObjectField.ts')
-rw-r--r-- | src/fields/ObjectField.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/fields/ObjectField.ts b/src/fields/ObjectField.ts new file mode 100644 index 000000000..9aa1c9b04 --- /dev/null +++ b/src/fields/ObjectField.ts @@ -0,0 +1,20 @@ +import { RefField } from "./RefField"; +import { OnUpdate, Parent, Copy, ToScriptString, ToString } from "./FieldSymbols"; +import { Scripting } from "../client/util/Scripting"; + +export abstract class ObjectField { + protected [OnUpdate](diff?: any) { } + private [Parent]?: RefField | ObjectField; + abstract [Copy](): ObjectField; + + abstract [ToScriptString](): string; + abstract [ToString](): string; +} + +export namespace ObjectField { + export function MakeCopy<T extends ObjectField>(field: T) { + return field?.[Copy](); + } +} + +Scripting.addGlobal(ObjectField);
\ No newline at end of file |