From 00d6046d081cd89305fb4f6bc0f0cc8ca04258a5 Mon Sep 17 00:00:00 2001 From: yanyilin Date: Tue, 7 Nov 2023 20:41:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0uni.intallApk=E8=AF=AD?= =?UTF-8?q?=E6=B3=95=E6=8F=90=E7=A4=BA=E6=8F=8F=E8=BF=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit c18c27691f47f82aa44835aa62359743b5fd789d) --- uni_modules/uni-installApk/utssdk/index.d.ts | 78 ++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 uni_modules/uni-installApk/utssdk/index.d.ts diff --git a/uni_modules/uni-installApk/utssdk/index.d.ts b/uni_modules/uni-installApk/utssdk/index.d.ts new file mode 100644 index 00000000..ad24effb --- /dev/null +++ b/uni_modules/uni-installApk/utssdk/index.d.ts @@ -0,0 +1,78 @@ +declare namespace UniNamespace { + +interface InstallApkSuccess { + /** + * 安装成功消息 + */ + errMsg : string +} + +type InstallApkErrorCode = 1300002 +interface InstallApkFail { + errCode : InstallApkErrorCode +} + +type InstallApkComplete = any + +type InstallApkSuccessCallback = (res : InstallApkSuccess) => void +type InstallApkFailCallback = (err : InstallApkFail) => void +type InstallApkCompleteCallback = (res : InstallApkComplete) => void + +interface InstallApkOptions { + /** + * apk文件地址 + */ + filePath : string, + /** + * 接口调用成功的回调函数 + * @defaultValue null + */ + success ?: InstallApkSuccessCallback | null, + /** + * 接口调用失败的回调函数 + * @defaultValue null + */ + fail ?: InstallApkFailCallback | null, + /** + * 接口调用结束的回调函数(调用成功、失败都会执行) + * @defaultValue null + */ + complete ?: InstallApkCompleteCallback | null +} + +} + + +declare interface Uni { + /** + * installApk() + * @description + * 安装apk + * @param {InstallApkOptions} + * @return {void} + * @uniPlatform { + * "app": { + * "android": { + * "osVer": "4.4", + * "uniVer": "3.94+", + * "unixVer": "3.94+" + * }, + * "ios": { + * "osVer": "x", + * "uniVer": "x", + * "unixVer": "x" + * } + * } + * } + * @example + ```typescript + uni.installApk({ + filePath: "/xx/xx/xx.apk", + complete: (res: any) => { + console.log("complete => " + JSON.stringify(res)); + } + }); + ``` + */ + installApk(options : UniNamespace.InstallApkOptions) : void +} -- GitLab