import { RegisterOptions, LoginOptions, ShareOptions } from '../interface.uts'

import { Weixin} from './src/Weixin.uts'

/**
 * 企业微信
 */
let weixin = new Weixin()

/**
* 注册
* @param {RegisterOptions} options
* @tutorial https://www.uxframe.cn/api/wxwork.html#register
*/
export const register = function (options : RegisterOptions) {
	weixin.register(options)
}

/**
* 登录
* @param {LoginOptions} options
* @tutorial https://www.uxframe.cn/api/wxwork.html#login
*/
export const login = function (options : LoginOptions) {
	weixin.login(options)
}

/**
* 分享
* @param {ShareOptions} options
* @tutorial https://www.uxframe.cn/api/wxwork.html#share
*/
export const share = function (options : ShareOptions) {
	weixin.share(options)
}

/**
* 微信app是否安装
* @tutorial https://www.uxframe.cn/api/wxwork.html#isInstalled
*/
export const isInstalled = function () : boolean {
	return weixin.isInstalled()
}

/**
* 打开微信app
* @tutorial https://www.uxframe.cn/api/wxwork.html#openApp
*/
export const openApp = function () {
	weixin.openApp()
}