diff options
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](); + } +} |