提交 dcfa32bb 编写于 作者: lizhongyi_'s avatar lizhongyi_

uni-memorywarning 添加index.d.ts

上级 5558eb58
declare namespace UniNamespace {
interface MemoryWarningCallbackResult {
/**
* 内存警告等级(仅安卓平台有效,iOS始终是0)
*/
level: number
}
/**
* uni.onMemoryWarning/uni.offMemoryWarning回调函数定义
*/
type MemoryWarningCallback = (res: MemoryWarningCallbackResult) => void
type OnMemoryWarning = (callback: MemoryWarningCallback) => void
type OffMemoryWarning = (callback : MemoryWarningCallback | null) => void
}
declare interface Uni {
/**
* 开启监听内存警告
*
* @param {MemoryWarningCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/memory.html#onmemorywarning
* @uniPlatform {
* "app": {
* "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
* @uniVueVersion 2,3 //支持的vue版本
* @autotest { expectCallback: true }
*/
onMemoryWarning(callback: UniNamespace.MemoryWarningCallback) : void,
/**
* 取消监听内存不足告警事件
*
* @param {MemoryWarningCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning
* @uniPlatform {
* "app": {
* "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
* @uniVueVersion 2,3 //支持的vue版本
* @autotest { expectCallback: true }
*/
offMemoryWarning(callback : UniNamespace.MemoryWarningCallback | null) : void
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册