diff options
author | Monika Hedman <monika_hedman@brown.edu> | 2019-05-07 16:34:00 -0400 |
---|---|---|
committer | Monika Hedman <monika_hedman@brown.edu> | 2019-05-07 16:34:00 -0400 |
commit | ef54fbecd832e4c8f31144ab9fa217146833a397 (patch) | |
tree | 4bf8367cc6456f2a3eb23c242adda17dc7999f85 /src/new_fields/ObjectField.ts | |
parent | 93d2214b84eaef61c9a9f980d24b5c1addbd67dc (diff) | |
parent | 14c776b6d30e0bc0d5b3712f28e4b9f1170eae3b (diff) |
pulled from new search
Diffstat (limited to 'src/new_fields/ObjectField.ts')
-rw-r--r-- | src/new_fields/ObjectField.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/new_fields/ObjectField.ts b/src/new_fields/ObjectField.ts new file mode 100644 index 000000000..0f3777af6 --- /dev/null +++ b/src/new_fields/ObjectField.ts @@ -0,0 +1,17 @@ +import { Doc } from "./Doc"; + +export const OnUpdate = Symbol("OnUpdate"); +export const Parent = Symbol("Parent"); +export const Copy = Symbol("Copy"); + +export abstract class ObjectField { + protected [OnUpdate]?: (diff?: any) => void; + private [Parent]?: Doc; + abstract [Copy](): ObjectField; +} + +export namespace ObjectField { + export function MakeCopy<T extends ObjectField>(field: T) { + return field[Copy](); + } +} |