aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Document.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/fields/Document.ts')
-rw-r--r--src/fields/Document.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts
index 53138eda9..e482df622 100644
--- a/src/fields/Document.ts
+++ b/src/fields/Document.ts
@@ -1,4 +1,4 @@
-import { Field, Cast, Opt, FieldWaiting, FIELD_ID, DOC_ID } from "./Field"
+import { Field, Cast, Opt, FieldWaiting, FIELD_ID, DOC_ID, FieldValue } from "./Field"
import { Key, KeyStore } from "./Key"
import { NumberField } from "./NumberField";
import { ObservableMap, computed, action, observable } from "mobx";
@@ -16,8 +16,8 @@ export class Document extends Field {
return this.GetText(KeyStore.Title, "<untitled>");
}
- Get(key: Key, ignoreProto: boolean = false): Opt<Field> {
- let field: Opt<Field>;
+ Get(key: Key, ignoreProto: boolean = false): FieldValue<Field> {
+ let field: FieldValue<Field>;
if (ignoreProto) {
if (this.fields.has(key)) {
field = this.fields.get(key);
@@ -25,7 +25,7 @@ export class Document extends Field {
field = Server.GetDocumentField(this, key);
}
} else {
- let doc: Opt<Document> = this;
+ let doc: FieldValue<Document> = this;
while (doc && doc != FieldWaiting && field != FieldWaiting) {
if (!doc.fields.has(key)) {
if (doc._proxies.has(key)) {
@@ -46,7 +46,7 @@ export class Document extends Field {
return field;
}
- GetT<T extends Field = Field>(key: Key, ctor: { new(...args: any[]): T }, ignoreProto: boolean = false): Opt<T> {
+ GetT<T extends Field = Field>(key: Key, ctor: { new(...args: any[]): T }, ignoreProto: boolean = false): FieldValue<T> {
var getfield = this.Get(key, ignoreProto);
if (getfield != FieldWaiting) {
return Cast(getfield, ctor);
@@ -119,13 +119,13 @@ export class Document extends Field {
this.SetData(key, value, NumberField, replaceWrongType);
}
- GetPrototype(): Opt<Document> {
+ GetPrototype(): FieldValue<Document> {
return this.GetT(KeyStore.Prototype, Document, true);
}
GetAllPrototypes(): Document[] {
let protos: Document[] = [];
- let doc: Opt<Document> = this;
+ let doc: FieldValue<Document> = this;
while (doc && doc != FieldWaiting) {
protos.push(doc);
doc = doc.GetPrototype();