aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Document.ts
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-03-18 16:10:06 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-03-18 16:10:06 -0400
commit66dc0aefa9972071a8d3f5163048867071dd2b59 (patch)
tree3b063969ae6e8bffe843c8d3068ba964fb9969cf /src/fields/Document.ts
parentf70ad315167b714f11f7d68f35a46abe9e525a4d (diff)
Fixes for ink
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);