/** * 完整设备系统信息接口,包含小程序环境与宿主系统的关键元数据。 */ export interface DeviceInfo { /** 小程序 appId */ appid: string; /** 应用名称 */ app_name: string; /** 小程序版本号(版本名称) */ version: string; /** 小程序版本号(版本号) */ version_code: string; /** 小程序来源渠道 */ channel: string; /** 设备 brand。如:apple、huawei */ device_brand: string; /** 设备型号 */ device_model: string; /** 设备 ID */ device_id: string; /** 设备类型:phone/pad/pc */ device_type: string; /** 设备方向:portrait/landscape */ device_orientation: "portrait" | "landscape"; /** 手机品牌。H5 不支持 */ brand: string; /** 手机型号 */ model: string; /** 操作系统版本 */ system: string; /** 操作系统版本(简写) */ os: string; /** 设备像素比 */ pixel_ratio: number; /** 屏幕宽度 (px) */ screen_width: number; /** 屏幕高度 (px) */ screen_height: number; /** 可用窗口宽度 (px) */ window_width: number; /** 可用窗口高度 (px) */ window_height: number; /** 状态栏高度 (px) */ status_bar_height: number; /** 微信基础库版本 */ sdk_version: string; /** 宿主名称。如:WeChat、alipay */ host_name: string; /** 宿主版本。如:微信版本号 */ host_version: string; /** 宿主语言 */ host_language: string; /** 宿主主题:light/dark */ host_theme: string; /** 平台类型 weapp/toutiao/h5 */ platform: string; /** 客户端语言 */ language: string; } /** * 过滤后常用于接口公共请求 Query 的设备字段子集。 */ export type DeviceQueryInfo = Pick; /** * 获取缓存后的设备信息数据。 */ export declare function getDevice(): DeviceInfo; /** * 获取接口请求专用的设备信息 query 字符串。 */ export declare function getDeviceQuery(): string; /** * 清除本地设备信息缓存,使下一次读取重新走系统调用收集。 */ export declare function clearDeviceCache(): void;