Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-api
提交
5b734e04
U
uni-api
项目概览
DCloud
/
uni-api
通知
671
Star
23
Fork
12
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-api
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5b734e04
编写于
5月 26, 2023
作者:
lizhongyi_
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update uni-usercapturescreen uni-momorywarning插件interface
上级
4a31b6b6
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
129 addition
and
37 deletion
+129
-37
uni_modules/uni-memorywarning/utssdk/app-android/index.uts
uni_modules/uni-memorywarning/utssdk/app-android/index.uts
+3
-3
uni_modules/uni-memorywarning/utssdk/app-ios/index.uts
uni_modules/uni-memorywarning/utssdk/app-ios/index.uts
+4
-2
uni_modules/uni-memorywarning/utssdk/interface.uts
uni_modules/uni-memorywarning/utssdk/interface.uts
+53
-0
uni_modules/uni-usercapturescreen/utssdk/interface.uts
uni_modules/uni-usercapturescreen/utssdk/interface.uts
+69
-32
未找到文件。
uni_modules/uni-memorywarning/utssdk/app-android/index.uts
浏览文件 @
5b734e04
import { UTSAndroid } from "io.dcloud.uts"
import { UTSAndroid } from "io.dcloud.uts"
import { OnMemoryWarning, OffMemoryWarning } from "../interface.uts"
let listeners: UTSCallback[] = []
let listeners: UTSCallback[] = []
...
@@ -14,7 +14,7 @@ const onAppTrimMemoryListener = (ret: number) => {
...
@@ -14,7 +14,7 @@ const onAppTrimMemoryListener = (ret: number) => {
@Suppress("DEPRECATION")
@Suppress("DEPRECATION")
export
function onMemoryWarning
(callback: UTSCallback) {
export
const onMemoryWarning : OnMemoryWarning = function
(callback: UTSCallback) {
if (listeners.length == 0) {
if (listeners.length == 0) {
// 仅首次执行底层的实际监听
// 仅首次执行底层的实际监听
UTSAndroid.onAppTrimMemory(onAppTrimMemoryListener)
UTSAndroid.onAppTrimMemory(onAppTrimMemoryListener)
...
@@ -28,7 +28,7 @@ export function onMemoryWarning(callback: UTSCallback) {
...
@@ -28,7 +28,7 @@ export function onMemoryWarning(callback: UTSCallback) {
@Suppress("DEPRECATION")
@Suppress("DEPRECATION")
export
function offMemoryWarning
(callback: UTSCallback | null) {
export
const offMemoryWarning : OffMemoryWarning = function
(callback: UTSCallback | null) {
if(callback == null){
if(callback == null){
// 清除全部回调
// 清除全部回调
...
...
uni_modules/uni-memorywarning/utssdk/app-ios/index.uts
浏览文件 @
5b734e04
import { NotificationCenter } from 'Foundation';
import { NotificationCenter } from 'Foundation';
import { UIApplication } from "UIKit"
import { UIApplication } from "UIKit"
import { Selector } from "ObjectiveC"
import { Selector } from "ObjectiveC"
import { OnMemoryWarning, OffMemoryWarning } from "../interface.uts"
class MemoryWarningTool {
class MemoryWarningTool {
static listeners: UTSCallback[] = []
static listeners: UTSCallback[] = []
...
@@ -45,12 +46,13 @@ class MemoryWarningTool {
...
@@ -45,12 +46,13 @@ class MemoryWarningTool {
}
}
}
}
// 开启监听内存警告
// 开启监听内存警告
export
function onMemoryWarning
(callback: UTSCallback) {
export
const onMemoryWarning : OnMemoryWarning = function
(callback: UTSCallback) {
MemoryWarningTool.listenMemoryWarning(callback)
MemoryWarningTool.listenMemoryWarning(callback)
}
}
// 关闭监听内存警告
// 关闭监听内存警告
export
function offMemoryWarning
(callback: UTSCallback | null) {
export
const offMemoryWarning : OffMemoryWarning = function
(callback: UTSCallback | null) {
MemoryWarningTool.removeListen(callback)
MemoryWarningTool.removeListen(callback)
}
}
\ No newline at end of file
uni_modules/uni-memorywarning/utssdk/interface.uts
0 → 100644
浏览文件 @
5b734e04
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 {
* 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版本
*/
onMemoryWarning : OnMemoryWarning,
/**
* 取消监听内存不足告警事件
*
* @param {UTSCallback} 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版本
*/
offMemoryWarning : OffMemoryWarning
}
\ No newline at end of file
uni_modules/uni-usercapturescreen/utssdk/interface.uts
浏览文件 @
5b734e04
...
@@ -13,26 +13,8 @@ export type OnUserCaptureScreenCallbackResult = {
...
@@ -13,26 +13,8 @@ export type OnUserCaptureScreenCallbackResult = {
*/
*/
export type UserCaptureScreenCallback = (res : OnUserCaptureScreenCallbackResult) => void
export type UserCaptureScreenCallback = (res : OnUserCaptureScreenCallbackResult) => void
/**
* uni.onUserCaptureScreen函数定义
* 开启截屏监听
*
* @param {UserCaptureScreenCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen
* @platforms APP-IOS = ^9.0,APP-ANDROID = ^4.4
* @since 3.7.7
*/
export type OnUserCaptureScreen = (callback : UserCaptureScreenCallback | null) => void
export type OnUserCaptureScreen = (callback : UserCaptureScreenCallback | null) => void
/**
* uni.offUserCaptureScreen函数定义
* 关闭截屏监听
*
* @param {UserCaptureScreenCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen
* @platforms APP-IOS = ^9.0,APP-ANDROID = ^4.4
* @since 3.7.7
*/
export type OffUserCaptureScreen = (callback : UserCaptureScreenCallback | null) => void
export type OffUserCaptureScreen = (callback : UserCaptureScreenCallback | null) => void
/**
/**
...
@@ -102,21 +84,76 @@ export type SetUserCaptureScreenOptions = {
...
@@ -102,21 +84,76 @@ export type SetUserCaptureScreenOptions = {
complete ?: SetUserCaptureScreenCompleteCallback
complete ?: SetUserCaptureScreenCompleteCallback
}
}
export type SetUserCaptureScreen = (options : SetUserCaptureScreenOptions) => void
/**
export interface Uni {
* * uni.setUserCaptureScreen函数定义
/**
* 开启截屏监听
*
* @param {UserCaptureScreenCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen
* @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版本
*/
onUserCaptureScreen : OnUserCaptureScreen,
/**
* 关闭截屏监听
*
* @param {UserCaptureScreenCallback} callback
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen
* @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版本
*/
offUserCaptureScreen : OffUserCaptureScreen,
/**
* 设置防截屏
* 设置防截屏
*
*
* @param {SetUserCaptureScreenOptions} options
* @param {SetUserCaptureScreenOptions} options
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#setusercapturescreen
* @tutorial https://uniapp.dcloud.net.cn/api/system/capture-screen.html#setusercapturescreen
* @platforms APP-IOS = ^13.0,APP-ANDROID = ^4.4
* @uniPlatform {
* @since 3.7.7
* app: {
* "android": {
* "osVer": "4.4.4",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* },
* "ios": {
* "osVer": "13.0",
* "uniVer": "3.7.7",
* "unixVer": "3.9.0"
* }
* }
* }
* @uniVersion 3.7.7
* @uniVueVersion 2,3 //支持的vue版本
*/
*/
export type SetUserCaptureScreen = (options : SetUserCaptureScreenOptions) => void
export interface Uni {
onUserCaptureScreen : OnUserCaptureScreen,
offUserCaptureScreen : OffUserCaptureScreen,
setUserCaptureScreen : SetUserCaptureScreen
setUserCaptureScreen : SetUserCaptureScreen
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录