From 8a8c876d8dda42f62dbd12522ed5dbe0c97901f0 Mon Sep 17 00:00:00 2001 From: qiang Date: Wed, 26 Oct 2022 21:10:29 +0800 Subject: [PATCH] docs: uni-usercapturescreen add readme --- .../uni-usercapturescreen/changelog.md | 2 + uni_modules/uni-usercapturescreen/index.d.ts | 16 +++++ .../uni-usercapturescreen/package.json | 58 +++++++++---------- uni_modules/uni-usercapturescreen/readme.md | 18 ++++-- 4 files changed, 60 insertions(+), 34 deletions(-) create mode 100644 uni_modules/uni-usercapturescreen/index.d.ts diff --git a/uni_modules/uni-usercapturescreen/changelog.md b/uni_modules/uni-usercapturescreen/changelog.md index e69de29..71e8ea2 100644 --- a/uni_modules/uni-usercapturescreen/changelog.md +++ b/uni_modules/uni-usercapturescreen/changelog.md @@ -0,0 +1,2 @@ +## 1.0.0(2022-10-26) +支持安卓、iOS、微信小程序平台 diff --git a/uni_modules/uni-usercapturescreen/index.d.ts b/uni_modules/uni-usercapturescreen/index.d.ts new file mode 100644 index 0000000..0511956 --- /dev/null +++ b/uni_modules/uni-usercapturescreen/index.d.ts @@ -0,0 +1,16 @@ +type OnUserCaptureScreenCallback = (res?: { errMsg: string }) => void + +declare class Uni { + /** + * 监听用户主动截屏事件,用户使用系统截屏按键截屏时触发此事件。 + * + * 文档: [https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen) + */ + onUserCaptureScreen(callback: OnUserCaptureScreenCallback): void; + /** + * 用户主动截屏事件。取消事件监听。 + * + * 文档: [https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen) + */ + offUserCaptureScreen(callback: OnUserCaptureScreenCallback): void; +} diff --git a/uni_modules/uni-usercapturescreen/package.json b/uni_modules/uni-usercapturescreen/package.json index 4afe7e3..2d52707 100644 --- a/uni_modules/uni-usercapturescreen/package.json +++ b/uni_modules/uni-usercapturescreen/package.json @@ -4,8 +4,8 @@ "version": "1.0.0", "description": "uni-usercapturescreen", "keywords": [ - "截屏" - ], + "截屏" + ], "repository": "", "engines": { "HBuilderX": "^3.6.0" @@ -24,9 +24,9 @@ "qq": "" }, "declaration": { - "ads": "", - "data": "", - "permissions": "" + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" }, "npmurl": "" }, @@ -41,8 +41,8 @@ "encrypt": [], "platforms": { "cloud": { - "tcb": "u", - "aliyun": "u" + "tcb": "y", + "aliyun": "y" }, "client": { "Vue": { @@ -50,36 +50,36 @@ "vue3": "y" }, "App": { - "app-android": "u", - "app-ios": "u" + "app-android": "y", + "app-ios": "y" }, "H5-mobile": { - "Safari": "u", - "Android Browser": "u", - "微信浏览器(Android)": "u", - "QQ浏览器(Android)": "u" + "Safari": "n", + "Android Browser": "n", + "微信浏览器(Android)": "n", + "QQ浏览器(Android)": "n" }, "H5-pc": { - "Chrome": "u", - "IE": "u", - "Edge": "u", - "Firefox": "u", - "Safari": "u" + "Chrome": "n", + "IE": "n", + "Edge": "n", + "Firefox": "n", + "Safari": "n" }, "小程序": { - "微信": "u", - "阿里": "u", - "百度": "u", - "字节跳动": "u", - "QQ": "u", - "钉钉": "u", - "快手": "u", - "飞书": "u", - "京东": "u" + "微信": "y", + "阿里": "n", + "百度": "n", + "字节跳动": "n", + "QQ": "n", + "钉钉": "n", + "快手": "n", + "飞书": "n", + "京东": "n" }, "快应用": { - "华为": "u", - "联盟": "u" + "华为": "n", + "联盟": "n" } } } diff --git a/uni_modules/uni-usercapturescreen/readme.md b/uni_modules/uni-usercapturescreen/readme.md index a9d3215..7752410 100644 --- a/uni_modules/uni-usercapturescreen/readme.md +++ b/uni_modules/uni-usercapturescreen/readme.md @@ -1,5 +1,13 @@ -# uts-screenshot-listener -### 开发文档 -[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html) -[UTS 原生插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html) -[Hello UTS](https://gitcode.net/dcloud/hello-uts/-/tree/dev) \ No newline at end of file +# uni-usercapturescreen + +### uni.onUserCaptureScreen + +监听用户主动截屏事件,用户使用系统截屏按键截屏时触发此事件。 + +> 使用文档:[https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen) + +### uni.offUserCaptureScreen + +用户主动截屏事件。取消事件监听。 + +> 使用文档:[https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen) -- GitLab