/** * 返回移动设备辨别信息 * @deprecated 不建议使用 * @see {@link OS} * @see {@link isiOS} * @see {@link isAndroid} * @see {@link isMobile} * @category 检测 */ export declare function platform(): { /** * 设备系统名称 */ name: string; isIOS: boolean; isAndroid: boolean; isNative: boolean; }; /** * 返回系统名称 * ```ts * import { OS } from 'sunny-js' * console.log(OS()) * ``` * @category 检测 */ export declare function OS(): string; /** * 是否是iOS系统 * @category 检测 */ export declare function isiOS(): boolean; /** * 是否是安卓系统 * @category 检测 */ export declare function isAndroid(): boolean; /** * 是否为移动设备 * @category 检测 */ export declare function isMobile(): boolean; /** * 是否为微信Webview * @category 检测 */ export declare function isWeChat(): boolean; /** * 模拟modernizr addTest方法 * * 会在html根DOM节点增加css class类名 * * ```ts * import { addTest, isWebpSupport } from 'sunny-js' * addTest('webp', isWebpSupport()) * console.log(document.documentElement.classList.toString()) * // => 'webp' * ``` * * @param feature 特性名称 * @param tester 测试结果或使用自定义测试函数 * @see https://modernizr.com/docs/#modernizr-addtest * @category 检测 */ export declare function addTest(feature: string, tester: boolean | (() => boolean)): void; /** * 测试是否支持webp * @category 检测 */ export declare function isWebpSupport(): boolean; /** * 是否为浏览器环境 * @category 检测 */ export declare function isBrowser(): boolean;