import Vnmf from '../../index' declare module '../../index' { namespace openSystemBluetoothSetting { interface Option { /** Interface call successful callback function */ success?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failure recovery function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** The callback function of the interface call (Call success 、Failure will be executed ) */ complete?: (res: VnmfGeneral.CallbackResult) => void } } namespace openAppAuthorizeSetting { interface Option { /** Interface call successful callback function */ success?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failure recovery function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** The callback function of the interface call (Call success 、Failure will be executed ) */ complete?: (res: VnmfGeneral.CallbackResult) => void } } namespace getWindowInfo { interface Result { /** Equipment pixel ratio */ pixelRatio: number /** Screen width ,unit px */ screenWidth: number /** Screen height ,unit px */ screenHeight: number /** Can use window width ,unit px */ windowWidth: number /** Can use window height ,unit px */ windowHeight: number /** The height of the status bar ,unit px */ statusBarHeight?: number /** Safety areas under the positive direction of the vertical screen */ safeArea?: VnmfGeneral.SafeAreaResult } } namespace getSystemSetting { interface Result { /** Bluetooth system switch */ bluetoothEnabled?: boolean /** System switch with geographical location */ locationEnabled?: boolean /** Wi-Fi System switch */ wifiEnabled?: boolean /** Direction */ deviceOrientation?: keyof DeviceOrientation } /** Legal value of equipment direction */ interface DeviceOrientation { /** Vertical screen */ portrait /** Horizontal screen */ landscape } } namespace getSystemInfoSync { interface Result { /** Device brand */ brand: string /** Device model */ model: string /** Equipment pixel ratio */ pixelRatio: number /** Screen width ,unit px */ screenWidth: number /** Screen height ,unit px */ screenHeight: number /** Can use window width ,unit px */ windowWidth: number /** Can use window height ,unit px */ windowHeight: number /** The height of the status bar ,unit px */ statusBarHeight?: number /** WeChat settings language */ language: string /** WeChat version number */ version?: string /** Operating system and version */ system: string /** Client platform */ platform: string /** User font size (unit px)。WeChat client 「I -set up -Universal -font size 」The settings are prevailing */ fontSizeSetting?: number /** Client Basic Library Version */ SDKVersion?: string /** Equipment performance level (only AndroidGames )。Value :-2 or 0(The device cannot run the mini -game ),-1(Unknown performance ),>=1(Equipment performance ,The higher the value ,The better the equipment performance ,The highest is currently not available 50) */ benchmarkLevel: number /** Allow WeChat use of the album switch (only iOS efficient ) */ albumAuthorized?: boolean /** Allow WeChat to use the switch of the camera */ cameraAuthorized?: boolean /** Allow WeChat to use positioning switch */ locationAuthorized?: boolean /** Allow WeChat to use microphone switches */ microphoneAuthorized?: boolean /** Switch that allows WeChat notification */ notificationAuthorized?: boolean /** Allow WeChat notification switch with reminders (only iOS efficient ) */ notificationAlertAuthorized?: boolean /** Allow WeChat notification to notify switches with tags (only iOS efficient ) */ notificationBadgeAuthorized?: boolean /** Allow WeChat notification switch with sound (only iOS efficient ) */ notificationSoundAuthorized?: boolean /** Allow WeChat to use the calendar switch */ phoneCalendarAuthorized?: boolean /** Bluetooth system switch */ bluetoothEnabled?: boolean /** System switch with geographical location */ locationEnabled?: boolean /** Wi-Fi System switch */ wifiEnabled?: boolean /** Safety areas under the positive direction of the vertical screen */ safeArea?: VnmfGeneral.SafeAreaResult /** `true` Express the fuzzy positioning ,`false` Express accurate positioning ,only iOS support */ locationReducedAccuracy?: boolean /** The current theme of the system ,Value lightor dark,Global configuration "darkmode":trueOnly then can be obtained ,Otherwise undefined (Do not support mini games ) */ theme?: keyof Theme /** The host environment run by the current mini program */ host?: Host /** Have you opened debugging 。You can pass the menu or [Vnmf.setEnableDebug](/docs/apis/base/debug/setEnableDebug) Turn on debugging 。 */ enableDebug?: boolean /** Direction */ deviceOrientation?: keyof DeviceOrientation /** Small program current operating environment */ environment?: string } /** System theme Legal value */ interface Theme { /** Dark theme */ dark /** Light -colored theme */ light } interface Host { /** Host app corresponding appId */ appId: string } /** Legal value of equipment direction */ interface DeviceOrientation { /** Vertical screen */ portrait /** Horizontal screen */ landscape } } namespace getSystemInfoAsync { interface Option { /** Interface call successful callback function */ success?: (res: Result) => void /** Interface call failure recovery function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** The callback function of the interface call (Call success 、Failure will be executed ) */ complete?: (res: VnmfGeneral.CallbackResult | Result) => void } interface Result extends VnmfGeneral.CallbackResult { /** Device brand */ brand: string /** Device model */ model: string /** Equipment pixel ratio */ pixelRatio: number /** Screen width ,unit px */ screenWidth: number /** Screen height ,unit px */ screenHeight: number /** Can use window width ,unit px */ windowWidth: number /** Can use window height ,unit px */ windowHeight: number /** The height of the status bar ,unit px */ statusBarHeight?: number /** WeChat settings language */ language: string /** WeChat version number */ version?: string /** Operating system and version */ system: string /** Client platform */ platform: string /** User font size (unit px)。WeChat client 「I -set up -Universal -font size 」The settings are prevailing */ fontSizeSetting?: number /** Client Basic Library Version */ SDKVersion?: string /** Equipment performance level (only AndroidGames )。Value :-2 or 0(The device cannot run the mini -game ),-1(Unknown performance ),>=1(Equipment performance ,The higher the value ,The better the equipment performance ,The highest is currently not available 50) */ benchmarkLevel: number /** Allow WeChat use of the album switch (only iOS efficient ) */ albumAuthorized?: boolean /** Allow WeChat to use the switch of the camera */ cameraAuthorized?: boolean /** Allow WeChat to use positioning switch */ locationAuthorized?: boolean /** Allow WeChat to use microphone switches */ microphoneAuthorized?: boolean /** Switch that allows WeChat notification */ notificationAuthorized?: boolean /** Allow WeChat notification switch with reminders (only iOS efficient ) */ notificationAlertAuthorized?: boolean /** Allow WeChat notification to notify switches with tags (only iOS efficient ) */ notificationBadgeAuthorized?: boolean /** Allow WeChat notification switch with sound (only iOS efficient ) */ notificationSoundAuthorized?: boolean /** Allow WeChat to use the calendar switch */ phoneCalendarAuthorized?: boolean /** Bluetooth system switch */ bluetoothEnabled?: boolean /** System switch with geographical location */ locationEnabled?: boolean /** Wi-Fi System switch */ wifiEnabled?: boolean /** Safety areas under the positive direction of the vertical screen */ safeArea?: VnmfGeneral.SafeAreaResult /** `true` Express the fuzzy positioning ,`false` Express accurate positioning ,only iOS support */ locationReducedAccuracy?: boolean /** The current theme of the system ,Value lightor dark,Global configuration "darkmode":trueOnly then can be obtained ,Otherwise undefined (Do not support mini games ) */ theme?: keyof Theme /** The host environment run by the current mini program */ host?: Host /** Have you opened debugging 。You can pass the menu or [Vnmf.setEnableDebug](/docs/apis/base/debug/setEnableDebug) Turn on debugging 。 */ enableDebug?: boolean /** Direction */ deviceOrientation?: keyof DeviceOrientation /** Small program current operating environment */ environment?: string } /** System theme Legal value */ interface Theme { /** Dark theme */ dark /** Light -colored theme */ light } interface Host { /** Host app corresponding appId */ appId: string } /** Legal value of equipment direction */ interface DeviceOrientation { /** Vertical screen */ portrait /** Horizontal screen */ landscape } } namespace getSystemInfo { interface Option { /** Interface call successful callback function */ success?: (res: Result) => void /** Interface call failure recovery function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** The callback function of the interface call (Call success 、Failure will be executed ) */ complete?: (res: VnmfGeneral.CallbackResult | Result) => void } interface Result extends VnmfGeneral.CallbackResult { /** Device brand */ brand: string /** Device model */ model: string /** Equipment pixel ratio */ pixelRatio: number /** Screen width ,unit px */ screenWidth: number /** Screen height ,unit px */ screenHeight: number /** Can use window width ,unit px */ windowWidth: number /** Can use window height ,unit px */ windowHeight: number /** The height of the status bar ,unit px */ statusBarHeight?: number /** WeChat settings language */ language: string /** WeChat version number */ version?: string /** Operating system and version */ system: string /** Client platform */ platform: string /** User font size (unit px)。WeChat client 「I -set up -Universal -font size 」The settings are prevailing */ fontSizeSetting?: number /** Client Basic Library Version */ SDKVersion?: string /** Equipment performance level (only AndroidGames )。Value :-2 or 0(The device cannot run the mini -game ),-1(Unknown performance ),>=1(Equipment performance ,The higher the value ,The better the equipment performance ,The highest is currently not available 50) */ benchmarkLevel: number /** Allow WeChat use of the album switch (only iOS efficient ) */ albumAuthorized?: boolean /** Allow WeChat to use the switch of the camera */ cameraAuthorized?: boolean /** Allow WeChat to use positioning switch */ locationAuthorized?: boolean /** Allow WeChat to use microphone switches */ microphoneAuthorized?: boolean /** Switch that allows WeChat notification */ notificationAuthorized?: boolean /** Allow WeChat notification switch with reminders (only iOS efficient ) */ notificationAlertAuthorized?: boolean /** Allow WeChat notification to notify switches with tags (only iOS efficient ) */ notificationBadgeAuthorized?: boolean /** Allow WeChat notification switch with sound (only iOS efficient ) */ notificationSoundAuthorized?: boolean /** Allow WeChat to use the calendar switch */ phoneCalendarAuthorized?: boolean /** Bluetooth system switch */ bluetoothEnabled?: boolean /** System switch with geographical location */ locationEnabled?: boolean /** Wi-Fi System switch */ wifiEnabled?: boolean /** Safety areas under the positive direction of the vertical screen */ safeArea?: VnmfGeneral.SafeAreaResult /** `true` Express the fuzzy positioning ,`false` Express accurate positioning ,only iOS support */ locationReducedAccuracy?: boolean /** The current theme of the system ,Value lightor dark,Global configuration "darkmode":trueOnly then can be obtained ,Otherwise undefined (Do not support mini games ) */ theme?: keyof Theme /** The host environment run by the current mini program */ host?: Host /** Have you opened debugging 。You can pass the menu or [Vnmf.setEnableDebug](/docs/apis/base/debug/setEnableDebug) Turn on debugging 。 */ enableDebug?: boolean /** Direction */ deviceOrientation?: keyof DeviceOrientation /** Small program current operating environment */ environment?: string } /** System theme Legal value */ interface Theme { /** Dark theme */ dark /** Light -colored theme */ light } interface Host { /** Host app corresponding appId */ appId: string } /** Legal value of equipment direction */ interface DeviceOrientation { /** Vertical screen */ portrait /** Horizontal screen */ landscape } } namespace getDeviceInfo { interface Result { /** Application of binary interface types (only Android support ) */ abi?: string /** Equipment performance level (only AndroidGames )。Value :-2 or 0(The device cannot run the mini -game ),-1(Unknown performance ),>=1(Equipment performance ,The higher the value ,The better the equipment performance ,The highest is currently not available 50) */ benchmarkLevel: number /** Device brand */ brand: string /** Device model */ model: string /** Operating system and version */ system: string /** Client platform */ platform: string } } namespace getAppBaseInfo { interface Result { /** Client Basic Library Version */ SDKVersion?: string /** Have you opened debugging 。You can pass the menu or [Vnmf.setEnableDebug](/docs/apis/base/debug/setEnableDebug) Turn on debugging 。 */ enableDebug?: boolean /** The host environment run by the current mini program */ host?: Host /** WeChat settings language */ language: string /** WeChat version number */ version?: string /** The current theme of the system ,Value lightor dark,Global configuration "darkmode":trueOnly then can be obtained ,Otherwise undefined (Do not support mini games ) */ theme?: keyof Theme } /** System theme Legal value */ interface Theme { /** Dark theme */ dark /** Light -colored theme */ light } interface Host { /** Host app corresponding appId */ appId: string } } namespace getAppAuthorizeSetting { interface Result { /** Allow WeChat use of the album switch (only iOS efficient ) */ albumAuthorized: keyof Authorized /** Allow WeChat to use the Bluetooth switch (only iOS efficient ) */ bluetoothAuthorized: keyof Authorized /** Allow WeChat to use the switch of the camera */ cameraAuthorized: keyof Authorized /** Allow WeChat to use positioning switch */ locationAuthorized: keyof Authorized /** Accuracy 。true Express the fuzzy positioning ,false Express accurate positioning (only iOS efficient ) */ locationReducedAccuracy: boolean /** Allow WeChat to use microphone switches */ microphoneAuthorized: keyof Authorized /** Switch that allows WeChat notification */ notificationAuthorized: keyof Authorized /** Allow WeChat notification switch with reminders (only iOS efficient ) */ notificationAlertAuthorized: keyof Authorized /** Allow WeChat notification to notify switches with tags (only iOS efficient ) */ notificationBadgeAuthorized: keyof Authorized /** Allow WeChat notification switch with sound (only iOS efficient ) */ notificationSoundAuthorized: keyof Authorized /** Allow WeChat read and write calendar switches */ phoneCalendarAuthorized: keyof Authorized } /** Authorized legal value */ interface Authorized { /** Indicates authorization ,No need to request authorization again */ authorized /** Indicates that the request authorization is rejected ,Can't ask for authorization again (This situation needs to guide users to open [Open the system settings ](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),Open permissions in the setting page ) */ denied /** Indicates that it has not requested authorization ,Will request the corresponding authority when the system is called next time on WeChat (only iOS Will appear 。Guide users in this case [Open the system settings ](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),No display switch ) */ 'not determined' } } interface VnmfStatic { /** Jumping system Bluetooth setting page * @supported weapp * @example * ```tsx * Vnmf.openSystemBluetoothSetting({ * success (res) { * console.log(res) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openSystemBluetoothSetting.html */ openSystemBluetoothSetting(option: openSystemBluetoothSetting.Option): Promise /** Jumping system WeChat authorization management page * @supported weapp * @example * ```tsx * Vnmf.openAppAuthorizeSetting({ * success (res) { * console.log(res) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html */ openAppAuthorizeSetting(option: openAppAuthorizeSetting.Option): Promise /** Get window information * @supported weapp * @h5 not support statusBarHeight、safeArea * @example * ```tsx * const windowInfo = Vnmf.getWindowInfo() * * console.log(windowInfo.pixelRatio) * console.log(windowInfo.screenWidth) * console.log(windowInfo.screenHeight) * console.log(windowInfo.windowWidth) * console.log(windowInfo.windowHeight) * console.log(windowInfo.statusBarHeight) * console.log(windowInfo.safeArea) * console.log(windowInfo.screenTop) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getWindowInfo.html */ getWindowInfo(): getWindowInfo.Result /** Get equipment settings * @supported weapp, h5 * @h5 not support bluetoothEnabled、locationEnabled、wifiEnabled * @example * ```tsx * const systemSetting = Vnmf.getSystemSetting() * * console.log(systemSetting.bluetoothEnabled) * console.log(systemSetting.deviceOrientation) * console.log(systemSetting.locationEnabled) * console.log(systemSetting.wifiEnabled) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemSetting.html */ getSystemSetting(): getSystemSetting.Result /** [Vnmf.getSystemInfo](./getSystemInfo) Synchronous version * @supported weapp, h5, rn, tt * @h5 not support version、statusBarHeight、fontSizeSetting、SDKVersion * @weapp The applet can call this interface in WeChat and corporate WeChat ,But when this interface is called in corporate WeChat ,Will return an additional one environment Field (No return in WeChat ),Such a field value is wxwork,It means that the current applet is running in the WeChat environment of the enterprise 。 * @example * ```tsx * try { * const res = Vnmf.getSystemInfoSync() * console.log(res.model) * console.log(res.pixelRatio) * console.log(res.windowWidth) * console.log(res.windowHeight) * console.log(res.language) * console.log(res.version) * console.log(res.platform) * } catch (e) { * // Do something when catch error * } * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/system-info/wx.getSystemInfoSync.html */ getSystemInfoSync(): getSystemInfoSync.Result /** Asynchronous acquisition system information 。Need a certain WeChat client version support ,On the client that does not support ,Will use synchronous implementation to return 。 * @supported weapp, h5 * @h5 not support version、statusBarHeight、fontSizeSetting、SDKVersion * @weapp The applet can call this interface in WeChat and corporate WeChat ,But when this interface is called in corporate WeChat ,Will return an additional one environment Field (No return in WeChat ),Such a field value is wxwork,It means that the current applet is running in the WeChat environment of the enterprise 。 * @example * ```tsx * Vnmf.getSystemInfoAsync({ * success (res) { * console.log(res.model) * console.log(res.pixelRatio) * console.log(res.windowWidth) * console.log(res.windowHeight) * console.log(res.language) * console.log(res.version) * console.log(res.platform) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoAsync.html */ getSystemInfoAsync(res?: getSystemInfoAsync.Option): Promise /** Get system information ,support `Promise` Use 。 * @supported weapp, h5, rn, tt * @h5 not support version、statusBarHeight、fontSizeSetting、SDKVersion * @weapp The applet can call this interface in WeChat and corporate WeChat ,But when this interface is called in corporate WeChat ,Will return an additional one environment Field (No return in WeChat ),Such a field value is wxwork,It means that the current applet is running in the WeChat environment of the enterprise 。 * @example * ```tsx * Vnmf.getSystemInfo({ * success: res => console.log(res) * }) * .then(res => console.log(res)) * ``` * @example * ```tsx * Vnmf.getSystemInfo({ * success: function (res) { * console.log(res.model) * console.log(res.pixelRatio) * console.log(res.windowWidth) * console.log(res.windowHeight) * console.log(res.language) * console.log(res.version) * console.log(res.platform) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/system-info/wx.getSystemInfo.html */ getSystemInfo(res?: getSystemInfo.Option): Promise /** Get the basic information of the equipment * @supported weapp, h5 * @h5 not support abi、benchmarkLevel * @example * ```tsx * const deviceInfo = Vnmf.getDeviceInfo() * * console.log(deviceInfo.abi) * console.log(deviceInfo.benchmarkLevel) * console.log(deviceInfo.brand) * console.log(deviceInfo.model) * console.log(deviceInfo.platform) * console.log(deviceInfo.system) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceInfo.html */ getDeviceInfo(): getDeviceInfo.Result /** Get WeChat APPbasic information * @supported weapp, h5 * @h5 not support SDKVersion、host、version * @example * ```tsx * const appBaseInfo = Vnmf.getAppBaseInfo() * * console.log(appBaseInfo.SDKVersion) * console.log(appBaseInfo.enableDebug) * console.log(appBaseInfo.host) * console.log(appBaseInfo.language) * console.log(appBaseInfo.version) * console.log(appBaseInfo.theme) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppBaseInfo.html */ getAppBaseInfo(): getAppBaseInfo.Result /** Get WeChat APPAuthorized settings * * - 'authorized' Indicates authorization ,No need to request authorization again ; * - 'denied' Indicates that the request authorization is rejected ,Can't ask for authorization again ;(This situation needs to be guided by users [Open the system settings ](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),Open permissions in the setting page ) * - 'non determined' Indicates that it has not requested authorization ,Will request the corresponding authority when the system is called next time on WeChat ;(only iOS Will appear 。In this case, guide users to open the system settings ,No display switch ) * @supported weapp, h5 * @h5 No support for settings * @example * ```tsx * const appAuthorizeSetting = Vnmf.getAppAuthorizeSetting() * * console.log(appAuthorizeSetting.albumAuthorized) * console.log(appAuthorizeSetting.bluetoothAuthorized) * console.log(appAuthorizeSetting.cameraAuthorized) * console.log(appAuthorizeSetting.locationAuthorized) * console.log(appAuthorizeSetting.locationReducedAccuracy) * console.log(appAuthorizeSetting.microphoneAuthorized) * console.log(appAuthorizeSetting.notificationAlertAuthorized) * console.log(appAuthorizeSetting.notificationAuthorized) * console.log(appAuthorizeSetting.notificationBadgeAuthorized) * console.log(appAuthorizeSetting.notificationSoundAuthorized) * console.log(appAuthorizeSetting.phoneCalendarAuthorized) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppAuthorizeSetting.html */ getAppAuthorizeSetting(): getAppAuthorizeSetting.Result } }