aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/Types.ts
diff options
context:
space:
mode:
authormonikahedman <monika_hedman@brown.edu>2019-08-13 16:32:01 -0400
committermonikahedman <monika_hedman@brown.edu>2019-08-13 16:32:01 -0400
commit3d3f55b0b9fb66a1a02a2a57edb6bcc38c2a5803 (patch)
tree6f0b778b307a335b3797a14317471ed7da2af9ac /src/new_fields/Types.ts
parent180a1268d6e732bca9557da7f935ec540de4b878 (diff)
parentafec8d91ec6de13de33e2a31c987727b4cc7101d (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into checkbox
Diffstat (limited to 'src/new_fields/Types.ts')
-rw-r--r--src/new_fields/Types.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/new_fields/Types.ts b/src/new_fields/Types.ts
index 09cbff25e..0ca35fab2 100644
--- a/src/new_fields/Types.ts
+++ b/src/new_fields/Types.ts
@@ -2,6 +2,7 @@ import { Field, Opt, FieldResult, Doc } from "./Doc";
import { List } from "./List";
import { RefField } from "./RefField";
import { DateField } from "./DateField";
+import { ScriptField } from "./ScriptField";
export type ToType<T extends InterfaceValue> =
T extends "string" ? string :
@@ -86,6 +87,9 @@ export function BoolCast(field: FieldResult, defaultVal: boolean | null = false)
export function DateCast(field: FieldResult) {
return Cast(field, DateField, null);
}
+export function ScriptCast(field: FieldResult) {
+ return Cast(field, ScriptField, null);
+}
type WithoutList<T extends Field> = T extends List<infer R> ? (R extends RefField ? (R | Promise<R>)[] : R[]) : T;