missing gentype

This commit is contained in:
Umur Ozkul 2022-08-17 19:32:11 +02:00
parent a8c7297621
commit 55c03ed520

View File

@ -7,6 +7,7 @@ external ivtString_: int = "IvtString"
@module("ForTS_InternalValue_tag") @scope("InternalValueTag")
external ivtRecordLike_: int = "IvtRecordLike"
@genType
let getTag = (variant: internalValue) =>
switch variant {
| IvVoid(_) => ivtVoid_
@ -14,18 +15,21 @@ let getTag = (variant: internalValue) =>
| IvRecordLike(_) => ivtRecordLike_
}
@genType
let getVoid = (variant: internalValue): option<internalVoid> =>
switch variant {
| IvVoid(v) => Some(v)
| _ => None
}
@genType
let getString = (variant: internalValue): option<string> =>
switch variant {
| IvString(s) => Some(s)
| _ => None
}
@genType
let getRecordLike = (variant: internalValue): option<recordLike> =>
switch variant {
| IvRecordLike(r) => Some(r)