 
 (defn stop-component!
   "Stops the given `component` of the given `system`."
-  [^IPersistentMap system-map ^IComponent component]
+  [#?(:clj ^IPersistentMap) system-map
+   #?(:clj ^IComponent)     component]
   (reduce stop-component!
           (update-in system-map
                      [:components (hcomp/get-name component)]


(defn set-system!
  "Sets the system of HellHound."
  [^IPersistentMap system-map]
  (reset! system (update-system-components system-map)))

(defn get-dependencies-of
  "Returns a vector of dependencies for the given `component` ins the given
  `system`."
  [system-map component]
  (let [dependencies (hcomp/dependencies component)]
    (filter #(some #{(hcomp/get-name %)} dependencies)
            (vals (utils/get-components system-map)))))

(defn ^IPersistentMap start-component!
  "Starts the given `component` of the given `system`."
  [^IPersistentMap system-map ^IComponent component]
  (let [dependencies (get-dependencies-of system-map component)
        new-system   (reduce start-component! system-map dependencies)]
    (update-in new-system

  TODO: More explaination."
  {:public-api true
   :added      1.0}
  [#?(:clj ^IPersistentMap) system-map]
  (if-not (s/valid? ::system-map system-map)
    (throw (ex-info "Provided system is not valid"
                    {:cause (s/explain-data ::system-map system-map)})))
