     "RegExp"
     "Date"})
 
+(def mapped-types
+  {"nil" "null"})
+
 (defn resolve-type [env ^String t]
   (cond
     (get base-types t) t
+
+    (get mapped-types t) (get mapped-types t)
 
     #?(:clj  (.startsWith t "!")
        :cljs (gstring/startsWith t "!")) t

    (emitln "throw " throw ";")))

(def base-types
  #{"boolean" "Boolean"
    "string" "String"
    "number" "Number"
    "array" "Array"

        (str ret "=")
        ret))))

(defn type-munge [s]
  (cond
    (= "null" s) s
    (= "*" s) s
    :else (munge s)))

(defn resolve-types [env ts]
  (let [ts (-> ts string/trim (subs 1 (dec (count ts))))
        xs (string/split ts #"\|")]
    (str
      "{"
      (->> (map #(resolve-type env %) xs)
        (map type-munge)
        (string/join "|"))
      "}")))

