diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-01-15 22:31:57 -0500 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-01-15 22:31:57 -0500 |
commit | 89204d74d2a5014b4e241973b1bdb8461ed4f78c (patch) | |
tree | 4bf58acfdad603375953b2de3610dc946e569b71 /src/fields/DocumentReference.ts | |
parent | 3de39e2608e62a278b9c8cc37b53333f0877fa59 (diff) |
More stuff set up
Diffstat (limited to 'src/fields/DocumentReference.ts')
-rw-r--r-- | src/fields/DocumentReference.ts | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/fields/DocumentReference.ts b/src/fields/DocumentReference.ts new file mode 100644 index 000000000..936067bd2 --- /dev/null +++ b/src/fields/DocumentReference.ts @@ -0,0 +1,46 @@ +import { Field, Opt } from "./Field"; +import { Document } from "./Document"; +import { Key } from "./Key"; +import { DocumentUpdatedArgs } from "./FieldUpdatedArgs"; + +export class DocumentReference extends Field { + get Key(): Key{ + return this.key; + } + + get Document(): Document { + return this.document; + } + + constructor(private document: Document, private key: Key) { + super(); + } + + private DocFieldUpdated(args: DocumentUpdatedArgs):void{ + // this.FieldUpdated.emit(args.fieldArgs); + } + + Dereference() : Opt<Field> { + return this.document.GetField(this.key); + } + + DereferenceToRoot(): Opt<Field> { + let field: Opt<Field> = this; + while (field instanceof DocumentReference) { + field = field.Dereference(); + } + return field; + } + + TrySetValue(value: any): boolean { + throw new Error("Method not implemented."); + } + GetValue() { + throw new Error("Method not implemented."); + } + Copy(): Field { + throw new Error("Method not implemented."); + } + + +}
\ No newline at end of file |