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

fix: uni-usercaptruescreen uts语法调整

上级 9a59eecd
import { NotificationCenter} from 'Foundation';
import { UIApplication } from "UIKit"
import { OnUserCaptureScreen, OffUserCaptureScreen, UserCaptureScreenCallback } from "../interface.uts"
import { OnUserCaptureScreen, OffUserCaptureScreen, UserCaptureScreenCallback, OnUserCaptureScreenResult } from "../interface.uts"
/**
......@@ -23,7 +23,13 @@ class CaptureScreenTool {
// target-action 的方法前需要添加 @objc 前缀
@objc static userDidTakeScreenshot() {
// 回调
this.listener?.({})
const res: OnUserCaptureScreenResult = {
errCode: 0,
errSubject: "uni-usercapturescreen",
errMsg: "onUserCaptureScreen:ok",
path: null
}
this.listener?.(res)
}
// 移除监听事件
......@@ -33,20 +39,6 @@ class CaptureScreenTool {
}
}
// /**
// * 开启截图监听
// */
// export function onUserCaptureScreen(callback?: UTSCallback) {
// CaptureScreenTool.listenCaptureScreen(callback)
// }
// /**
// * 关闭截屏监听
// */
// export function offUserCaptureScreen(callback?: UTSCallback) {
// CaptureScreenTool.removeListen(callback)
// }
/**
* 开启截图监听
*/
......
export type UserCaptureScreenCallback = (res: any) => void
export type OnUserCaptureScreenResult = {
/**
* 错误码
* 0:成功
* -1:permission denied
*/
errCode : number,
/**
* 调用API的名称
*/
errSubject : string,
/**
* 错误的详细信息
*/
errMsg : string,
/**
* 截屏文件路径(仅Android返回)
*/
path ?: string
}
export type UserCaptureScreenCallback = (res: OnUserCaptureScreenResult) => void
/**
* 开启截屏监听
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册