Skip to content

Commit 8438d45

Browse files
committed
add missing function schemas
1 parent d029247 commit 8438d45

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/renderer/element/handlers.cljs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@
241241
(entities db)
242242
(vals)))
243243

244+
(m/=> update-prop [:-> App uuid? ifn? [:* any?] App])
244245
(defn update-prop
245246
[db id k & more]
246247
(-> (apply update-in db (path db id k) more)
@@ -295,6 +296,7 @@
295296
(assoc-attr db id k (string/trim (str v))))
296297
db)))
297298

299+
(m/=> update-attr [:-> App uuid? keyword? ifn? [:* any?] App])
298300
(defn update-attr
299301
[db id k f & more]
300302
(if (utils.element/supported-attr? (entity db id) k)
@@ -817,9 +819,16 @@
817819
(= (:tag (entity db id)) :path)
818820
(update-attr id :d utils.path/manipulate action))))
819821

822+
(def SvgData [:map
823+
[:svg string?]
824+
[:label string?]
825+
[:position Vec2]])
826+
827+
(m/=> import-svg [:-> App SvgData App])
820828
(defn import-svg
821-
[db {:keys [svg label position]}]
822-
(let [[x y] position
829+
[db data]
830+
(let [{:keys [svg label position]} data
831+
[x y] position
823832
hickory (hickory/as-hickory (hickory/parse svg))
824833
zipper (hickory.zip/hickory-zip hickory)
825834
svg (utils.hiccup/find-svg zipper)

src/renderer/ruler/handlers.cljs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
(:require
33
[clojure.math.combinatorics :as combo]
44
[malli.core :as m]
5+
[renderer.app.db :refer [App]]
56
[renderer.document.db :refer [ZoomFactor]]
67
[renderer.frame.db :refer [Viewbox]]
78
[renderer.frame.handlers :as frame.handlers]
@@ -42,6 +43,7 @@
4243
(if (= orientation :vertical) height width)
4344
ruler-step)))
4445

46+
(m/=> steps-intersections [:-> App [:sequential [:sequential number?]]])
4547
(defn steps-intersections
4648
"Returns the intersection points of the rulers."
4749
[db]

0 commit comments

Comments
 (0)