export interface Uni { /** * getSystemInfo() * @description * 异步获取系统信息 * @param {GetSystemInfoOptions} options * @return {void} * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/system/info.html * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-system-info.html * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-system-info.html * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } * @example ```typescript uni.getSystemInfo({ success(e) { console.log("success :",e); }, complete(e) { console.log("complete :",e); } }) ``` */ getSystemInfo(options: GetSystemInfoOptions): void; /** * getSystemInfoSync() * @description * 同步获取系统信息 * @param {void} * @return {GetSystemInfoResult} * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/system/info.html#getsysteminfosync * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-system-info.html#getsysteminfosync * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-system-info.html#getsysteminfosync * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } * @example ```typescript uni.getSystemInfoSync() ``` */ getSystemInfoSync(): GetSystemInfoResult; /** * getWindowInfo() * @description * 同步获取窗口信息 * @param {void} * @return {GetWindowInfoResult} result * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/system/getWindowInfo.html * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-window-info.html * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-window-info.html * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } * @example ```typescript uni.getWindowInfo() ``` */ getWindowInfo(): GetWindowInfoResult; } export type GetSystemInfo = (options: GetSystemInfoOptions) => void; export type GetSystemInfoSync = () => GetSystemInfoResult; export type GetWindowInfo = () => GetWindowInfoResult; export type SafeArea = { /** * 安全区域左上角横坐标,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ left: number, /** * 安全区域右下角横坐标,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ right: number, /** * 安全区域左上角纵坐标,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ top: number, /** * 安全区域右下角纵坐标,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ bottom: number, /** * 安全区域的宽度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ width: number, /** * 安全区域的高度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ height: number }; export type SafeAreaInsets = { /** * 安全区域左侧插入位置(距离左边边界距离),单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ left: number, /** * 安全区域右侧插入位置(距离右边边界距离),单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ right: number, /** * 安全区顶部插入位置(距离顶部边界距离),单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ top: number, /** * 安全区域底部插入位置(距离底部边界距离),单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ bottom: number }; export type GetSystemInfoResult = { /** * 客户端基础库版本 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } */ SDKVersion: string, /** * `manifest.json` 中应用appid。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ appId: string, /** * 应用设置的语言。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ appLanguage: string, /** * `manifest.json` 中应用名称。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ appName: string, /** * `manifest.json` 中应用版本名称。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ appVersion: string, /** * `manifest.json` 中应用版本名号。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ appVersionCode: string, /** * 应用资源(wgt)的版本名称。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "x" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "x" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } */ appWgtVersion?: string | null, /** * 手机品牌。 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } */ brand: string, /** * 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ browserName: string, /** * 浏览器版本、webview 版本。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ browserVersion: string, /** * 设备 ID * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ deviceId: string, /** * 设备品牌。如:`apple`、`huawei`。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ deviceBrand: string, /** * 设备型号 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ deviceModel: string, /** * 设备类型。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ deviceType: 'phone' | 'pad' | 'tv' | 'watch' | 'pc' | 'undefined' | 'car' | 'vr' | 'appliance', /** * 设备像素比 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ devicePixelRatio: number, /** * 设备方向。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ deviceOrientation: /** * 纵向 */ 'portrait' | /** * 横向 */ 'landscape', /** * 程序设置的语言 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ language: string, /** * 手机型号 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ model?: string, /** * 系统名称 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ osName: 'ios' | 'android' | 'harmonyos' | 'macos' | 'windows' | 'linux', /** * 操作系统版本。如 ios 版本,andriod 版本 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ osVersion: string, /** * 操作系统语言 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ osLanguage: string, /** * 操作系统主题 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "√" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } */ osTheme?: 'light' | 'dark' | null, /** * 设备像素比 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ pixelRatio: number, /** * 客户端平台 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ platform: 'ios' | 'android' | 'harmonyos' | 'mac' | 'windows' | 'linux', /** * 屏幕宽度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ screenWidth: number, /** * 屏幕高度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ screenHeight: number, /** * 状态栏的高度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ statusBarHeight: number, /** * 操作系统版本 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ system: string, /** * 在竖屏正方向下的安全区域 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ safeArea: SafeArea, /** * 在竖屏正方向下的安全区域插入位置 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ safeAreaInsets: SafeAreaInsets, /** * 用户标识。小程序端为空 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ ua: string, /** * uni 编译器版本。 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ uniCompileVersion: string, /** * uni 编译器版本。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "x", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "x", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "4.18" * } * } */ uniCompilerVersion: string, /** * uni-app 运行平台,与条件编译平台相同。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ uniPlatform: 'app' | 'web' | 'mp-weixin' | 'mp-alipay' | 'mp-baidu' | 'mp-toutiao' | 'mp-lark' | 'mp-qq' | 'mp-kuaishou' | 'mp-jd' | 'mp-360' | 'quickapp-webview' | 'quickapp-webview-union' | 'quickapp-webview-huawei', /** * uni 运行时版本。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ uniRuntimeVersion: string, /** * uni 编译器版本号。 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "x", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "x", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ uniCompileVersionCode: number, /** * uni 编译器版本号。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "x", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "x", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "4.18" * } * } */ uniCompilerVersionCode: number, /** * uni 运行时版本号。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "x", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "x", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ uniRuntimeVersionCode: number, /** * 引擎版本号。 * @deprecated 已废弃,仅为了向下兼容保留 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ version: string, /** * rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "x", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } */ romName: string, /** * rom 版本号。Android 部分机型获取不到值。iOS 为操作系统版本号(同 `osVersion`)。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "x", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } */ romVersion: string, /** * 可使用窗口宽度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ windowWidth: number, /** * 可使用窗口高度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ windowHeight: number, /** * 内容区域距离顶部的距离(同CSS变量 `--window-top`),单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ windowTop: number, /** * 内容区域距离底部的距离(同CSS变量 `--window-bottom`),单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ windowBottom: number, /** * Android 系统API库的版本。 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "√" * }, * "ios": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * }, * "harmony": { * "osVer": "x", * "uniVer": "x", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } */ osAndroidAPILevel?: number | null, /** * 当前App的主题 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "x", * "unixVer": "4.18" * }, * "ios": { * "osVer": "12.0", * "uniVer": "x", * "unixVer": "4.18" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "x", * "unixVer": "x" * } * } */ appTheme?: 'light' | 'dark' | 'auto' | null, }; export type GetSystemInfoSuccessCallback = (result: GetSystemInfoResult) => void; type GetSystemInfoFail = UniError; type GetSystemInfoFailCallback = (result: GetSystemInfoFail) => void; export type GetSystemInfoComplete = any; export type GetSystemInfoCompleteCallback = (result: GetSystemInfoComplete) => void; export type GetSystemInfoOptions = { /** * 接口调用成功的回调函数 * @defaultValue null */ success?: GetSystemInfoSuccessCallback | null, /** * 接口调用失败的回调函数 * @defaultValue null */ fail?: GetSystemInfoFailCallback | null, /** * 接口调用结束的回调函数(调用成功、失败都会执行) * @defaultValue null */ complete?: GetSystemInfoCompleteCallback | null }; export type GetWindowInfoResult = { /** * 设备像素比 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ pixelRatio: number, /** * 屏幕宽度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ screenWidth: number, /** * 屏幕高度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ screenHeight: number, /** * 可使用窗口宽度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ windowWidth: number, /** * 可使用窗口高度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * } * } */ windowHeight: number, /** * 状态栏的高度,单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ statusBarHeight: number, /** * 内容区域距离顶部的距离(同CSS变量 `--window-top`),单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ windowTop: number, /** * 内容区域距离底部的距离(同CSS变量 `--window-bottom`),单位为px * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ windowBottom: number, /** * 安全区域在屏幕中的位置信息 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ safeArea: SafeArea, /** * 安全区域插入位置(与屏幕边界的距离)信息 * * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ safeAreaInsets: SafeAreaInsets, /** * 窗口上边缘的 y 值,单位为px * * @deprecated 已废弃,仅为了向下兼容保留 * @uniPlatform * { * "app": { * "android": { * "osVer": "5.0", * "uniVer": "√", * "unixVer": "3.9+" * }, * "ios": { * "osVer": "12.0", * "uniVer": "√", * "unixVer": "4.11" * }, * "harmony": { * "osVer": "3.0", * "uniVer": "4.23", * "unixVer": "x" * } * }, * "web": { * "uniVer": "√", * "unixVer": "4.0" * } * } */ screenTop: number };