interface.uts 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12

export type OnMemoryWarning = (callback: UTSCallback) => void

export type OffMemoryWarning = (callback : UTSCallback | null) => void

export interface Uni {
	/**
	 * 开启监听内存警告
	 * 
	 * @param {UTSCallback} callback 
	 * @tutorial https://uniapp.dcloud.net.cn/api/system/memory.html#onmemorywarning
	 * @uniPlatform {
lizhongyi_'s avatar
lizhongyi_ 已提交
13
	 *    "app": {
14 15 16 17 18 19 20 21 22 23 24 25 26
	 *        "android": {
	 *            "osVer": "4.4.4",
	 *            "uniVer": "3.7.7",
	 *            "unixVer": "3.9.0"
	 *        },
	 *        "ios": {
	 *            "osVer": "9.0",
	 *            "uniVer": "3.7.7",
	 *            "unixVer": "3.9.0"
	 *   	  }
	 *    }
	 * }
	 * @uniVersion 3.7.7
27 28
	 * @uniVueVersion 2,3  //支持的vue版本
	 * @autotest { expectCallback: true }
29
	 */
lizhongyi_'s avatar
lizhongyi_ 已提交
30
	onMemoryWarning(callback: UTSCallback) : void,
31 32 33 34 35 36
	/**
	 * 取消监听内存不足告警事件
	 * 
	 * @param {UTSCallback} callback 
	 * @tutorial https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning
	 * @uniPlatform {
lizhongyi_'s avatar
lizhongyi_ 已提交
37
	 *    "app": {
38 39 40 41 42 43 44 45 46 47 48 49 50
	 *        "android": {
	 *            "osVer": "4.4.4",
	 *            "uniVer": "3.7.7",
	 *            "unixVer": "3.9.0"
	 *        },
	 *        "ios": {
	 *            "osVer": "9.0",
	 *            "uniVer": "3.7.7",
	 *            "unixVer": "3.9.0"
	 *   	  }
	 *    }
	 * }
	 * @uniVersion 3.7.7
51 52
	 * @uniVueVersion 2,3  //支持的vue版本
	 * @autotest { expectCallback: true }
53
	 */
lizhongyi_'s avatar
lizhongyi_ 已提交
54
	offMemoryWarning(callback : UTSCallback | null) : void
55
}