From 200dd604ee648ef8d3767e113805bb77bac4a92c Mon Sep 17 00:00:00 2001 From: junyi233 Date: Fri, 1 Jul 2022 16:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=AB=E6=8F=8F=E7=BC=BA=E9=99=B7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: junyi233 --- .../reference/apis/js-apis-Bundle.md | 24 +++---- .../apis/js-apis-bundle-AbilityInfo.md | 62 ++++++++++--------- .../apis/js-apis-bundle-ApplicationInfo.md | 50 ++++++++------- .../apis/js-apis-bundle-BundleInfo.md | 2 + .../apis/js-apis-bundle-CustomizeData.md | 2 + .../js-apis-bundle-ExtensionAbilityInfo.md | 4 +- .../apis/js-apis-bundle-HapModuleInfo.md | 2 + .../reference/apis/js-apis-bundle-Metadata.md | 4 +- .../apis/js-apis-bundle-ModuleInfo.md | 2 + .../reference/apis/js-apis-zlib.md | 32 ++++++---- 10 files changed, 103 insertions(+), 81 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md index 3a7382c8bb..8b74695f62 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md @@ -73,7 +73,7 @@ getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, call **需要权限:** -ohos.permission.GET_BUNDLE_INFO_PRIVILEGED,ohos.permission.GET_BUNDLE_INFO +ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 或 ohos.permission.GET_BUNDLE_INFO **系统能力:** @@ -310,7 +310,7 @@ getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback\< **需要权限:** -ohos.permission.GET_BUNDLE_INFO_PRIVILEGED,ohos.permission.GET_BUNDLE_INFO +ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 或 ohos.permission.GET_BUNDLE_INFO **系统能力:** @@ -608,7 +608,7 @@ getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback\ **需要权限:** -ohos.permission.GET_BUNDLE_INFO_PRIVILEGED,ohos.permission.GET_BUNDLE_INFO +ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 或 ohos.permission.GET_BUNDLE_INFO **系统能力:** @@ -684,7 +684,7 @@ getAbilityLabel(bundleName: string, abilityName: string, callback : AsyncCallbac **需要权限:** -ohos.permission.GET_BUNDLE_INFO_PRIVILEGED,ohos.permission.GET_BUNDLE_INFO +ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 或 ohos.permission.GET_BUNDLE_INFO **系统能力:** @@ -755,10 +755,6 @@ isAbilityEnabled(info : AbilityInfo, callback : AsyncCallback\): void 以异步方法根据给定的AbilityInfo查询ability是否已经启用,使用callback形式返回结果。 -**需要权限:** - -无 - **系统能力:** SystemCapability.BundleManager.BundleFramework @@ -826,10 +822,6 @@ isApplicationEnabled(bundleName: string, callback : AsyncCallback\): vo 以异步方法根据给定的bundleName查询指定应用程序是否已经启用,使用callback形式返回结果。 -**需要权限:** - -无 - **系统能力:** SystemCapability.BundleManager.BundleFramework @@ -948,6 +940,10 @@ queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback | 是 | 否 | 被其他应用Ability调用时需要申请的权限集合 | -| deviceTypes | Array\ | 是 | 否 | Ability支持的设备类型 | -| deviceCapabilities | Array\ | 是 | 否 | Ability需要的设备能力 | -| readPermission | string | 是 | 否 | 读取Ability数据所需的权限 | -| writePermission | string | 是 | 否 | 向Ability写数据所需的权限 | -| applicationInfo | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | -| uri | string | 是 | 否 | 获取Ability的统一资源标识符(URI) | -| labelId | number | 是 | 否 | Ability的标签id | -| subType | AbilitySubType | 是 | 否 | Ability中枚举使用的模板的子类型 | -| metaData8+ | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)> | 是 | 否 | ability的自定义信息 | -| metaData9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | 是 | 否 | ability的元信息 | -| enabled8+ | boolean | 是 | 否 | ability是否可用 | \ No newline at end of file +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------------------- | -------------------------------------------------------- | ---- | ---- | ----------------------------------------- | +| bundleName | string | 是 | 否 | 应用包名 | +| name | string | 是 | 否 | Ability名称 | +| label | string | 是 | 否 | Ability对用户显示的名称 | +| description | string | 是 | 否 | Ability的描述 | +| icon | string | 是 | 否 | Ability的图标资源文件索引 | +| descriptionId | number | 是 | 否 | Ability的描述id | +| iconId | number | 是 | 否 | Ability的图标id | +| moduleName | string | 是 | 否 | Ability所属的HAP包的名称 | +| process | string | 是 | 否 | Ability的进程,如果不设置,默认为包的名称 | +| targetAbility | string | 是 | 否 | 当前Ability重用的目标Ability | +| backgroundModes | number | 是 | 否 | 表示后台服务的类型 | +| isVisible | boolean | 是 | 否 | 判断Ability是否可以被其他应用调用 | +| formEnabled | boolean | 是 | 否 | 判断Ability是否提供卡片能力 | +| type | AbilityType | 是 | 否 | Ability类型 | +| orientation | DisplayOrientation | 是 | 否 | Ability的显示模式 | +| launchMode | LaunchMode | 是 | 否 | Ability的启动模式 | +| permissions | Array\ | 是 | 否 | 被其他应用Ability调用时需要申请的权限集合 | +| deviceTypes | Array\ | 是 | 否 | Ability支持的设备类型 | +| deviceCapabilities | Array\ | 是 | 否 | Ability需要的设备能力 | +| readPermission | string | 是 | 否 | 读取Ability数据所需的权限 | +| writePermission | string | 是 | 否 | 向Ability写数据所需的权限 | +| applicationInfo | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | +| uri | string | 是 | 否 | 获取Ability的统一资源标识符(URI) | +| labelId | number | 是 | 否 | Ability的标签id | +| subType | AbilitySubType | 是 | 否 | Ability中枚举使用的模板的子类型 | +| metaData8+ | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)> | 是 | 否 | ability的自定义信息 | +| metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | 是 | 否 | ability的元信息 | +| enabled8+ | boolean | 是 | 否 | ability是否可用 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md index 7acbbe7e72..86178e4dc9 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md @@ -6,29 +6,31 @@ 应用程序信息 +## ApplicationInfo + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| -------------------------- | ---------------------------------- | ---- | ---- | --------------------- | -| name | string | 是 | 否 | 应用程序的名称 | -| description | string | 是 | 否 | 应用程序的描述 | -| descriptionId | number | 是 | 否 | 应用程序的描述id | -| systemApp | boolean | 是 | 否 | 判断是否为系统应用程序,默认为false | -| enabled | boolean | 是 | 否 | 判断应用程序是否可以使用,默认为true | -| label | string | 是 | 否 | 应用程序的标签 | -| labelId | string | 是 | 否 | 应用程序的标签id | -| icon | string | 是 | 否 | 应用程序的图标 | -| iconId | string | 是 | 否 | 应用程序的图标id | -| process | string | 是 | 否 | 应用程序的进程,如果不设置,默认为包的名称 | -| supportedModes | number | 是 | 否 | 应用程序支持的运行模式 | -| moduleSourceDirs | Array\ | 是 | 否 | 应用程序的资源存放的相对路径 | -| permissions | Array\ | 是 | 否 | 访问应用程序所需的权限 | -| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | 是 | 否 | 应用程序的模块信息 | -| entryDir | string | 是 | 否 | 应用程序的文件保存路径 | -| codePath8+ | string | 是 | 否 | 应用程序的安装目录 | -| metaData8+ | Map\> | 是 | 否 | 应用程序的自定义元信息 | -| metaData9+ | Map\> | 是 | 否 | 应用程序的元信息 | -| removable8+ | boolean | 是 | 否 | 应用程序是否可以被移除 | -| accessTokenId8+ | number | 是 | 否 | 应用程序的accessTokenId | -| uid8+ | number | 是 | 否 | 应用程序的uid | -| entityType8+ | string | 是 | 否 | 应用程序的实体类型 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------ | +| name | string | 是 | 否 | 应用程序的名称 | +| description | string | 是 | 否 | 应用程序的描述 | +| descriptionId | number | 是 | 否 | 应用程序的描述id | +| systemApp | boolean | 是 | 否 | 判断是否为系统应用程序,默认为false | +| enabled | boolean | 是 | 否 | 判断应用程序是否可以使用,默认为true | +| label | string | 是 | 否 | 应用程序的标签 | +| labelId | string | 是 | 否 | 应用程序的标签id | +| icon | string | 是 | 否 | 应用程序的图标 | +| iconId | string | 是 | 否 | 应用程序的图标id | +| process | string | 是 | 否 | 应用程序的进程,如果不设置,默认为包的名称 | +| supportedModes | number | 是 | 否 | 应用程序支持的运行模式 | +| moduleSourceDirs | Array\ | 是 | 否 | 应用程序的资源存放的相对路径 | +| permissions | Array\ | 是 | 否 | 访问应用程序所需的权限 | +| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | 是 | 否 | 应用程序的模块信息 | +| entryDir | string | 是 | 否 | 应用程序的文件保存路径 | +| codePath8+ | string | 是 | 否 | 应用程序的安装目录 | +| metaData8+ | Map\> | 是 | 否 | 应用程序的自定义元信息 | +| metadata9+ | Map\> | 是 | 否 | 应用程序的元信息 | +| removable8+ | boolean | 是 | 否 | 应用程序是否可以被移除 | +| accessTokenId8+ | number | 是 | 否 | 应用程序的accessTokenId | +| uid8+ | number | 是 | 否 | 应用程序的uid | +| entityType8+ | string | 是 | 否 | 应用程序的实体类型 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-BundleInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-BundleInfo.md index 894a5701bc..77e59722dc 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-BundleInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-BundleInfo.md @@ -6,6 +6,8 @@ 应用包的信息 +## BundleInfo + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework | 名称 | 类型 | 可读 | 可写 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-CustomizeData.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-CustomizeData.md index 7f32383bc4..03e85c7040 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-CustomizeData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-CustomizeData.md @@ -5,6 +5,8 @@ 自定义元数据 +## CustomizeData + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework | 名称 | 类型 | 可读 | 可写 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md index 836c467ffb..97a6e1b877 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md @@ -6,6 +6,8 @@ ExtensionAbility信息 +## ExtensionAbilityInfo + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework | 名称 | 类型 | 可读 | 可写 | 说明 | @@ -20,7 +22,7 @@ ExtensionAbility信息 | extensionAbilityType | bundle.ExtensionAbilityType | 是 | 否 | ExtensionAbility类型 | | permissions | Array\ | 是 | 否 | 被其他应用ExtensionAbility调用时需要申请的权限集合 | | applicationInfo | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | -| metaData | Array\<[Metadata](js-apis-bundle-Metadata.md)> | 是 | 否 | ExtensionAbility的元信息 | +| metadata | Array\<[Metadata](js-apis-bundle-Metadata.md)> | 是 | 否 | ExtensionAbility的元信息 | | enabled | boolean | 是 | 否 | ExtensionAbility是否可用 | | readPermission | string | 是 | 否 | 读取ExtensionAbility数据所需的权限 | | writePermission | string | 是 | 否 | 向ExtensionAbility写数据所需的权限 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md index f09be597ee..2f8de58758 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md @@ -6,6 +6,8 @@ Hap模块信息 +## HapModuleInfo + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework | 名称 | 类型 | 可读 | 可写 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-Metadata.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-Metadata.md index 8b91530fb1..513ab86191 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-Metadata.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-Metadata.md @@ -1,11 +1,13 @@ # Metadata > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** -> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > API9 当前为Canary版本,仅供试用,不保证接口可稳定调用。 元数据信息 +## Metadata + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework | 名称 | 类型 | 可读 | 可写 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-ModuleInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-ModuleInfo.md index 58a42cf7c2..6f6c8f995e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-ModuleInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-ModuleInfo.md @@ -5,6 +5,8 @@ 应用程序的模块信息 +## ModuleInfo + **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework | 名称 | 类型 | 可读 | 可写 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-zlib.md b/zh-cn/application-dev/reference/apis/js-apis-zlib.md index 8d7de4e167..101fd03f35 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-zlib.md +++ b/zh-cn/application-dev/reference/apis/js-apis-zlib.md @@ -21,11 +21,11 @@ zipFile(inFile:string, outFile:string, options: Options): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 描述 | -| ------- | ------------------- | ---- | ------------------------------------------- | -| inFile | string | 是 | 指定压缩的文件夹路径或者文件路径 | -| outFile | string | 是 | 指定的压缩结果的文件路径(文件的扩展名zip) | -| options | [Options](#options) | 否 | 压缩的可选参数 | +| 参数名 | 类型 | 必填 | 描述 | +| ------- | ------------------- | ---- | ------------------------------------------------------------ | +| inFile | string | 是 | 指定压缩的文件夹路径或者文件路径,对应的路径参考[FA模型](js-apis-Context.md),[stage模型](js-apis-application-context.md) | +| outFile | string | 是 | 指定的压缩结果的文件路径(文件的扩展名zip) | +| options | [Options](#options) | 否 | 压缩的可选参数 | **返回值:** @@ -85,11 +85,11 @@ unzipFile(inFile:string, outFile:string, options: Options): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 描述 | -| ------- | ------------------- | ---- | ----------------------------------- | -| inFile | string | 是 | 指定解压的文件路径(文件扩展名zip) | -| outFile | string | 是 | 指定的解压文件路径 | -| options | [Options](#options) | 否 | 解压的可选参数 | +| 参数名 | 类型 | 必填 | 描述 | +| ------- | ------------------- | ---- | ------------------------------------------------------------ | +| inFile | string | 是 | 指定压缩的文件夹路径或者文件路径,对应的路径参考[FA模型](js-apis-Context.md),[stage模型](js-apis-application-context.md) | +| outFile | string | 是 | 指定的解压文件路径 | +| options | [Options](#options) | 否 | 解压的可选参数 | **返回值:** @@ -120,14 +120,18 @@ zlib.unzipFile(inFile, outFile, options).then((data) => { ## Options +**系统能力:** SystemCapability.BundleManager.Zlib + | 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------- | ---- | --------------------------------------------------------- | | level | CompressLeve | 否 | [参考zip.CompressLevel枚举定义](#zip.CompressLevel) | | memLevel | MemLevel | 否 | [参考zip.MemLevel枚举定义](#zip.MemLevel) | -| userId | CompressStrategy | 否 | [参考zip.CompressStrategy枚举定义](#zip.CompressStrategy) | +| strategy | CompressStrategy | 否 | [参考zip.CompressStrategy枚举定义](#zip.CompressStrategy) | ## zip.MemLevel +**系统能力:** SystemCapability.BundleManager.Zlib + | 名称 | 值 | 说明 | | ----------------- | ---- | -------------------------------- | | MEM_LEVEL_MIN | 1 | zip 接口在压缩过程中最小使用内存 | @@ -136,6 +140,8 @@ zlib.unzipFile(inFile, outFile, options).then((data) => { ## zip.CompressLevel +**系统能力:** SystemCapability.BundleManager.Zlib + | 名称 | 值 | 说明 | | ---------------------------------- | ---- | ----------------- | | COMPRESS_LEVEL_NO_COMPRESSION | 0 | 压缩率为0压缩等级 | @@ -145,6 +151,8 @@ zlib.unzipFile(inFile, outFile, options).then((data) => { ## zip.CompressStrategy +**系统能力:** SystemCapability.BundleManager.Zlib + | 名称 | 值 | 说明 | | ---------------------------------- | ---- | ------------------------ | | COMPRESS_STRATEGY_DEFAULT_STRATEGY | 0 | 常规数据策略 | @@ -155,6 +163,8 @@ zlib.unzipFile(inFile, outFile, options).then((data) => { ## zip.ErrorCode +**系统能力:** SystemCapability.BundleManager.Zlib + | 名称 | 值 | 说明 | | ---------------- | ---- | ------------ | | ERROR_CODE_OK | 0 | 函数调用成功 | -- GitLab