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.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fields/Document.ts b/src/fields/Document.ts
index be0137128..b6439364a 100644
--- a/src/fields/Document.ts
+++ b/src/fields/Document.ts
@@ -249,6 +249,13 @@ export class Document extends Field {
}
@action
+ SetDataOnPrototype<T, U extends Field & { Data: T }>(key: Key, value: T, ctor: { new(): U }, replaceWrongType = true) {
+ this.GetAsync(KeyStore.Prototype, (f: Field) => {
+ (f as Document).SetData(key, value, ctor)
+ })
+ }
+
+ @action
SetData<T, U extends Field & { Data: T }>(key: Key, value: T, ctor: { new(): U }, replaceWrongType = true) {
let field = this.Get(key, true);