aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx
index 56902ef14..073822fa8 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/FieldTypes.tsx
@@ -29,11 +29,11 @@ type FieldSettings = {
description?: string;
};
-interface ConstructedField {
+interface ConstructedField<T> {
renderedDoc: () => Doc;
validSubfieldGroups: () => Field[];
- setContent: (newContent: any) => void;
- getContent: () => any;
+ setContent: (newContent: T) => void;
+ getContent: () => T;
}
class Field {
@@ -114,7 +114,7 @@ class Field {
}
}
-class TextField extends Field implements ConstructedField {
+class TextField extends Field implements ConstructedField<string> {
content: string = '';
constructor(settings: FieldSettings, parent: Field) {
@@ -137,11 +137,7 @@ class TextField extends Field implements ConstructedField {
return [];
}
- setContent = (newContent: any) => {
- if (newContent !instanceof String){
- return;
- }
-
+ setContent = (newContent: string) => {
this.content = newContent;
}