Explorar o código

mobile: some util helper

Weihua Lu %!s(int64=4) %!d(string=hai) anos
pai
achega
a7c8a4c51a
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  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))