wechat/app
app module provides miniprogram app bindings
it also includes a few global utility functions
details in wechat document
Values
pub fn array_buffer_to_base64(buffer: object.JsObject) -> String
wx.arrayBufferToBase64
Convert ArrayBuffer to base64 string
pub fn base64_to_array_buffer(base64: String) -> object.JsObject
wx.base64ToArrayBuffer
Convert base64 string to ArrayBuffer
pub fn decode_uri_component(uri: String) -> object.JsObject
global function decodeURIComponent
pub fn get_account_info_sync() -> object.JsObject
wx.getAccountInfoSync
Get account info (sync)
pub fn get_app_authorize_setting() -> object.JsObject
wx.getAppAuthorizeSetting
Get app authorize setting (sync)
pub fn get_app_base_info() -> object.JsObject
wx.getAppBaseInfo
Get app base info (sync)
pub fn get_device_benchmark_info(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.getDeviceBenchmarkInfo
Get device performance benchmark info
pub fn get_device_info() -> object.JsObject
wx.getDeviceInfo
Get device info (sync)
pub fn get_enter_options_sync() -> object.JsObject
wx.getEnterOptionsSync
Get enter options (sync)
pub fn get_launch_options_sync() -> object.JsObject
wx.getLaunchOptionsSync
Get launch options (sync)
pub fn get_renderer_user_agent(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.getRendererUserAgent
Get Webview renderer UserAgent string
pub fn get_skyline_info(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.getSkylineInfo
Check if Skyline rendering engine is supported
pub fn get_skyline_info_sync() -> object.JsObject
wx.getSkylineInfoSync
Check if Skyline rendering engine is supported (sync)
pub fn get_system_info(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.getSystemInfo
Get system information (async)
pub fn get_system_info_async(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.getSystemInfoAsync
Get system information (async without callback)
pub fn get_system_info_sync() -> object.JsObject
wx.getSystemInfoSync
Get system information (sync)
pub fn get_system_setting() -> object.JsObject
wx.getSystemSetting
Get system settings (sync)
pub fn get_window_info() -> object.JsObject
wx.getWindowInfo
Get window info (sync)
pub fn open_app_authorize_setting(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.openAppAuthorizeSetting
Open app authorization settings page
pub fn open_system_bluetooth_setting(
complete cb: fn() -> Nil,
) -> promise.Promise(Result(object.JsObject, object.WechatError))
wx.openSystemBluetoothSetting
Open system Bluetooth settings page (Android only)
pub fn run_app(o: object.JsObject) -> Nil
app constructor App({...})
the main entry point for miniprogram
pub fn set_interval(
callback cb: fn(object.JsObject) -> Nil,
delay d: Int,
with o: object.JsObject,
) -> Int
global function setInterval(...)
pub fn set_timeout(
callback cb: fn(object.JsObject) -> Nil,
delay d: Int,
with o: object.JsObject,
) -> Int
global function setTimeout(...)