aboutsummaryrefslogtreecommitdiff
path: root/src/fields/DocumentReference.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-02-07 23:33:44 -0500
committerTyler Schicke <tyler_schicke@brown.edu>2019-02-07 23:33:44 -0500
commit9b942166ca6b09ce4f310928c3daf8503a63ee5c (patch)
treecec530ff1bf61f02f3d1a9e722325d78aa935d70 /src/fields/DocumentReference.ts
parent090093a50397ddc2a8fc2c50f5097f4a4ea8a74c (diff)
Restored Opt<T> and made a new FieldValue<T> type to replace old Opt<T>
Diffstat (limited to 'src/fields/DocumentReference.ts')
-rw-r--r--src/fields/DocumentReference.ts11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/fields/DocumentReference.ts b/src/fields/DocumentReference.ts
index 10dac9f92..983b162a3 100644
--- a/src/fields/DocumentReference.ts
+++ b/src/fields/DocumentReference.ts
@@ -1,4 +1,4 @@
-import { Field, Opt } from "./Field";
+import { Field, Opt, FieldValue } from "./Field";
import { Document } from "./Document";
import { Key } from "./Key";
@@ -15,12 +15,12 @@ export class DocumentReference extends Field {
super();
}
- Dereference(): Opt<Field> {
+ Dereference(): FieldValue<Field> {
return this.document.Get(this.key);
}
- DereferenceToRoot(): Opt<Field> {
- let field: Opt<Field> = this;
+ DereferenceToRoot(): FieldValue<Field> {
+ let field: FieldValue<Field> = this;
while (field instanceof DocumentReference) {
field = field.Dereference();
}
@@ -37,5 +37,8 @@ export class DocumentReference extends Field {
throw new Error("Method not implemented.");
}
+ ToScriptString(): string {
+ return "";
+ }
} \ No newline at end of file