소스 검색

mobile: some util helper

Weihua Lu 4 년 전
부모
커밋
a7c8a4c51a
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 14 0
      src/main/frontend/mobile/util.cljs

+ 14 - 0
src/main/frontend/mobile/util.cljs

@@ -0,0 +1,14 @@
+(ns frontend.mobile.util
+  (:require ["@capacitor/core" :refer [Capacitor]]))
+
+(defn platform []
+  (.getPlatform Capacitor))
+
+(defn is-native-platform? []
+  (.isNativePlatform Capacitor))
+
+(defn convert-file-src [path-str]
+  (.convertFileSrc Capacitor path-str))
+
+(defn is-plugin-available? [name]
+  (.isPluginAvailable Capacitor name))