diff --git a/zh-cn/application-dev/reference/apis/js-apis-ability-ability.md b/zh-cn/application-dev/reference/apis/js-apis-ability-ability.md index 91b1a00d9d222ff4760d91b3030c21c29502efd3..120d44bd117704f46223e5c8885211e72391707c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-ability-ability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-ability-ability.md @@ -15,15 +15,15 @@ import ability from '@ohos.ability.ability' **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| DataAbilityHelper | 只读 | [DataAbilityHelper](js-apis-inner-ability-dataAbilityHelper.md) | 否 | DataAbilityHelper二级模块。 | -| PacMap | 只读 | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#PacMap) | 否 | PacMap二级模块。 | -| DataAbilityOperation | 只读 | [DataAbilityOperation](js-apis-inner-ability-dataAbilityOperation.md) | 否 | DataAbilityOperation二级模块。 | -| DataAbilityResult | 只读 | [DataAbilityResult](js-apis-inner-ability-dataAbilityResult.md) | 否 | DataAbilityResult二级模块。 | -| AbilityResult | 只读 | [AbilityResult](js-apis-inner-ability-abilityResult.md) | 否 | AbilityResult二级模块。 | -| ConnectOptions | 只读 | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | 否 | ConnectOptions二级模块。 | -| StartAbilityParameter | 只读 | [StartAbilityParameter](js-apis-inner-ability-startAbilityParameter.md) | 否 | StartAbilityParameter二级模块。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | -------------------- | ---- | ------------------------------------------------------------ | +| DataAbilityHelper | [DataAbilityHelper](js-apis-inner-ability-dataAbilityHelper.md) | 否 | DataAbilityHelper二级模块。 | +| PacMap | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#PacMap) | 否 | PacMap二级模块。 | +| DataAbilityOperation | [DataAbilityOperation](js-apis-inner-ability-dataAbilityOperation.md) | 否 | DataAbilityOperation二级模块。 | +| DataAbilityResult | [DataAbilityResult](js-apis-inner-ability-dataAbilityResult.md) | 否 | DataAbilityResult二级模块。 | +| AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | 否 | AbilityResult二级模块。 | +| ConnectOptions | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | 否 | ConnectOptions二级模块。 | +| StartAbilityParameter | [StartAbilityParameter](js-apis-inner-ability-startAbilityParameter.md) | 否 | StartAbilityParameter二级模块。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md index 1b798c86f44a7dd6e01abff75c6272649f2c4411..8f1df40ecb7d2f0680ff2e011a77e3f27b0a5c18 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md @@ -28,7 +28,7 @@ class MainAbility extends Ability { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | abilityInfo | AbilityInfo | 是 | 否 | Abilityinfo相关信息 | | currentHapModuleInfo | HapModuleInfo | 是 | 否 | 当前hap包的信息 | @@ -54,7 +54,7 @@ startAbility(want: Want, callback: AsyncCallback<void>): void; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -104,7 +104,7 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void& | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -162,7 +162,7 @@ startAbility(want: Want, options?: StartOptions): Promise<void>; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -214,7 +214,7 @@ startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -265,7 +265,7 @@ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -326,7 +326,7 @@ startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityRes | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -382,7 +382,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncC | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -440,7 +440,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOp | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -506,7 +506,7 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartO | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -561,7 +561,7 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\): void; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -611,7 +611,7 @@ startServiceExtensionAbility(want: Want): Promise\; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -665,7 +665,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -719,7 +719,7 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\ | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -770,7 +770,7 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\): void; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -820,7 +820,7 @@ stopServiceExtensionAbility(want: Want): Promise\; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -874,7 +874,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -928,7 +928,7 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\< | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -977,7 +977,7 @@ terminateSelf(callback: AsyncCallback<void>): void; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -1014,7 +1014,7 @@ terminateSelf(): Promise<void>; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -1050,7 +1050,7 @@ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<voi | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -1110,7 +1110,7 @@ terminateSelfWithResult(parameter: AbilityResult): Promise<void>; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -1173,7 +1173,7 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -1231,7 +1231,7 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -1285,7 +1285,7 @@ disconnectServiceExtensionAbility(connection: number): Promise\; | 错误码ID | 错误信息 | | ------- | -------------------------------- | | 401 | Invalid input parameter. | -| 其他ID | 见[元能力子系统错误码](../errorcodes/errorcode-ability.md) | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -1333,7 +1333,7 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback\ **说明:** -> -> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 - -## 使用说明 - -通过AbilityDelegatorRegistry中getAbilityDelegator方法获取。 -```ts -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry' - -var abilityDelegator; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); - -``` - -## AbilityDelegator - -### addAbilityMonitor - -addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void - -添加AbilityMonitor实例(callback形式) - -**系统能力:**SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填说明 | 说明 | -| -------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ | -| monitor | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor)实例 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - abilityName: "abilityname", - onAbilityCreate: onAbilityCreateCallback -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.addAbilityMonitor(monitor, (err : any) => { - console.info("addAbilityMonitor callback"); -}); -``` - - - -### addAbilityMonitor - -addAbilityMonitor(monitor: AbilityMonitor): Promise\ - -添加AbilityMonitor实例(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor)实例 | - -**返回值:** - -| 类型 | 说明 | -| -------------- | ------------------- | -| Promise\ | 以Promise形式返回。 | - -**示例:** - -```ts -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - abilityName: "abilityname", - onAbilityCreate: onAbilityCreateCallback -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.addAbilityMonitor(monitor).then(() => { - console.info("addAbilityMonitor promise"); -}); -``` - - - -### removeAbilityMonitor - -removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void - -删除已经添加的AbilityMonitor实例(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor)实例 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - abilityName: "abilityname", - onAbilityCreate: onAbilityCreateCallback -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.removeAbilityMonitor(monitor, (err : any) => { - console.info("removeAbilityMonitor callback"); -}); -``` - - - -### removeAbilityMonitor - -removeAbilityMonitor(monitor: AbilityMonitor): Promise\ - -删除已经添加的AbilityMonitor实例(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 名称 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor)实例 | - -**返回值:** - -| 类型 | 说明 | -| -------------- | ------------------- | -| Promise\ | 以Promise形式返回。 | - -- 示例 - -```ts -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - abilityName: "abilityname", - onAbilityCreate: onAbilityCreateCallback -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.removeAbilityMonitor(monitor).then(() => { - console.info("removeAbilityMonitor promise"); -}); -``` - - - -### waitAbilityMonitor - -waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void - -等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor)实例 | -| callback | AsyncCallback\<[Ability](js-apis-application-ability.md#Ability)> | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - abilityName: "abilityname", - onAbilityCreate: onAbilityCreateCallback -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.waitAbilityMonitor(monitor, (err : any, data : any) => { - console.info("waitAbilityMonitor callback"); -}); -``` - - - -### waitAbilityMonitor - -waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback\): void - -设置等待时间,等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor)实例 | -| timeout | number | 是 | 最大等待时间,单位毫秒(ms) | -| callback | AsyncCallback\<[Ability](js-apis-application-ability.md#Ability)> | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; -var timeout = 100; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - abilityName: "abilityname", - onAbilityCreate: onAbilityCreateCallback -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.waitAbilityMonitor(monitor, timeout, (err : any, data : any) => { - console.info("waitAbilityMonitor callback"); -}); -``` - - - -### waitAbilityMonitor - -waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise\ - -设置等待时间,等待与AbilityMonitor实例匹配的ability到达OnCreate生命周期,并返回ability实例(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor) | 是 | [AbilityMonitor](js-apis-app-ability-abilityMonitor.md#AbilityMonitor)实例 | -| timeout | number | 否 | 最大等待时间,单位毫秒(ms) | - -**返回值:** - -| 类型 | 说明 | -| ----------------------------------------------------------- | -------------------------- | -| Promise\<[Ability](js-apis-application-ability.md#Ability)> | 以Promise形式返回Ability。 | - -**示例:** - -```ts -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - abilityName: "abilityname", - onAbilityCreate: onAbilityCreateCallback -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.waitAbilityMonitor(monitor).then((data : any) => { - console.info("waitAbilityMonitor promise"); -}); -``` - - - -### getAppContext - -getAppContext(): Context - -获取应用Context - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**返回值:** - -| 类型 | 说明 | -| ------------------------------------- | ------------------------------------------- | -| [Context](js-apis-inner-application-context.md) | 应用[Context](js-apis-inner-application-context.md)。 | - -**示例:** - -```ts -var abilityDelegator; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -var context = abilityDelegator.getAppContext(); -``` - - - -### getAbilityState9+ - -getAbilityState(ability: Ability): number - -获取指定ability的生命周期状态 - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------- | ---- | --------------- | -| ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 指定Ability对象 | - -**返回值:** - -| 类型 | 说明 | -| ------ | ------------------------------------------------------------ | -| number | 指定ability的生命周期状态。状态枚举值使用[AbilityLifecycleState](js-apis-application-abilityDelegatorRegistry.md#AbilityLifecycleState)。 | - -**示例:** - -```ts -var abilityDelegator; -var ability; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.getCurrentTopAbility((err : any, data : any) => { - console.info("getCurrentTopAbility callback"); - ability = data; - var state = abilityDelegator.getAbilityState(ability); - console.info("getAbilityState" + state); -}); -``` - - - -### getCurrentTopAbility - -getCurrentTopAbility(callback: AsyncCallback\): void - -获取当前应用顶部ability(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------------------ | ---- | ------------------ | -| callback | AsyncCallback\<[Ability](js-apis-application-ability.md#Ability)> | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; -var ability; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.getCurrentTopAbility((err : any, data : any) => { - console.info("getCurrentTopAbility callback"); - ability = data; -}); -``` - - - -### getCurrentTopAbility - -getCurrentTopAbility(): Promise\ - -获取当前应用顶部ability(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**返回值:** - -| 类型 | 说明 | -| ----------------------------------------------------------- | -------------------------------------- | -| Promise\<[Ability](js-apis-application-ability.md#Ability)> | 以Promise形式返回当前应用顶部ability。 | - -**示例:** - -```ts -var abilityDelegator; -var ability; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.getCurrentTopAbility().then((data : any) => { - console.info("getCurrentTopAbility promise"); - ability = data; -}); -``` - - - -### startAbility - -startAbility(want: Want, callback: AsyncCallback\): void - -启动指定ability(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------------------------------------- | ---- | ------------------ | -| want | [Want](js-apis-app-ability-want.md) | 是 | 启动Ability参数 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; -var want = { - bundleName: "bundleName", - abilityName: "abilityName" -}; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.startAbility(want, (err : any, data : any) => { - console.info("startAbility callback"); -}); -``` - - - -### startAbility - -startAbility(want: Want): Promise\ - -启动指定ability(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------ | -------------------------------------- | ---- | --------------- | -| want | [Want](js-apis-app-ability-want.md) | 是 | 启动Ability参数 | - -**返回值:** - -| 类型 | 说明 | -| -------------- | ------------------- | -| Promise\ | 以Promise形式返回。 | - -**示例:** - -```ts -var abilityDelegator; -var want = { - bundleName: "bundleName", - abilityName: "abilityName" -}; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.startAbility(want).then((data: any) => { - console.info("startAbility promise"); -}); -``` - - - -### doAbilityForeground - -doAbilityForeground(ability: Ability, callback: AsyncCallback\): void - -调度指定ability生命周期状态到Foreground状态(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ----------------------- | ---- | ------------------------------------------------------- | -| ability | Ability | 是 | 指定Ability对象 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法
\- true:成功
\- false:失败 | - -**示例:** - -```ts -var abilityDelegator; -var ability; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.getCurrentTopAbility((err : any, data : any) => { - console.info("getCurrentTopAbility callback"); - ability = data; - abilityDelegator.doAbilityForeground(ability, (err : any, data : any) => { - console.info("doAbilityForeground callback"); - }); -}); -``` - - - -### doAbilityForeground - -doAbilityForeground(ability: Ability): Promise\ - -调度指定ability生命周期状态到Foreground状态(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------- | ---- | --------------- | -| ability | Ability | 是 | 指定Ability对象 | - -**返回值:** - -| 类型 | 说明 | -| ----------------- | ------------------------------------------------------------ | -| Promise\ | 以Promise形式返回执行结果。
\- true:成功
\- false:失败 | - -**示例:** - -```ts -var abilityDelegator; -var ability; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.getCurrentTopAbility((err : any, data : any) => { - console.info("getCurrentTopAbility callback"); - ability = data; - abilityDelegator.doAbilityForeground(ability).then((data : any) => { - console.info("doAbilityForeground promise"); - }); -}); -``` - - - -### doAbilityBackground - -doAbilityBackground(ability: Ability, callback: AsyncCallback\): void - -调度指定ability生命周期状态到Background状态(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ----------------------- | ---- | ------------------------------------------------------- | -| ability | Ability | 是 | 指定Ability对象 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法
\- true:成功
\- false:失败 | - -**示例:** - -```ts -var abilityDelegator; -var ability; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.getCurrentTopAbility((err : any, data : any) => { - console.info("getCurrentTopAbility callback"); - ability = data; - abilityDelegator.doAbilityBackground(ability, (err : any, data : any) => { - console.info("doAbilityBackground callback"); - }); -}); -``` - - - -### doAbilityBackground - -doAbilityBackground(ability: Ability): Promise\ - -调度指定ability生命周期状态到Background状态(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------- | ---- | --------------- | -| ability | Ability | 是 | 指定Ability对象 | - -**返回值:** - -| 类型 | 说明 | -| ----------------- | ------------------------------------------------------------ | -| Promise\ | 以Promise形式返回执行结果。
\- true:成功
\- false:失败 | - -**示例:** - -```ts -var abilityDelegator; -var ability; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.getCurrentTopAbility((err : any, data : any) => { - console.info("getCurrentTopAbility callback"); - ability = data; - abilityDelegator.doAbilityBackground(ability).then((data : any) => { - console.info("doAbilityBackground promise"); - }); -}); -``` - - - -### printSync - -printSync(msg: string): void - -打印日志信息到单元测试终端控制台 - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------- | -| msg | string | 是 | 日志字符串 | - -**示例:** - -```ts -var abilityDelegator; -var msg = "msg"; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.printSync(msg); -``` - - - -### print - -print(msg: string, callback: AsyncCallback\): void - -打印日志信息到单元测试终端控制台(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------------------- | ---- | ------------------ | -| msg | string | 是 | 日志字符串 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; -var msg = "msg"; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.print(msg, (err : any) => { - console.info("print callback"); -}); -``` - - - -### print - -print(msg: string): Promise\ - -打印日志信息到单元测试终端控制台(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------- | -| msg | string | 是 | 日志字符串 | - -**返回值:** - -| 类型 | 说明 | -| -------------- | ------------------- | -| Promise\ | 以Promise形式返回。 | - -**示例:** - -```ts -var abilityDelegator; -var msg = "msg"; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.print(msg).then(() => { - console.info("print promise"); -}); -``` - - - -### executeShellCommand - -executeShellCommand(cmd: string, callback: AsyncCallback\): void - -执行指定的shell命令(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------------------ | ---- | ------------------ | -| cmd | string | 是 | shell命令字符串 | -| callback | AsyncCallback\<[ShellCmdResult](js-apis-inner-application-shellCmdResult.md)> | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; -var cmd = "cmd"; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.executeShellCommand(cmd, (err : any, data : any) => { - console.info("executeShellCommand callback"); -}); -``` - - - -### executeShellCommand - -executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback\): void - -指定超时时间,并执行指定的shell命令(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ----------- | ------------------------------------------------------------ | ---- | ----------------------------- | -| cmd | string | 是 | shell命令字符串 | -| timeoutSecs | number | 是 | 设定命令超时时间,单位秒(s) | -| callback | AsyncCallback\<[ShellCmdResult](js-apis-inner-application-shellCmdResult.md)> | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; -var cmd = "cmd"; -var timeout = 100; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.executeShellCommand(cmd, timeout, (err : any, data : any) => { - console.info("executeShellCommand callback"); -}); -``` - - - -### executeShellCommand - -executeShellCommand(cmd: string, timeoutSecs?: number): Promise\ - -指定超时时间,并执行指定的shell命令(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ----------- | ------ | ---- | ----------------------------- | -| cmd | string | 是 | shell命令字符串 | -| timeoutSecs | number | 否 | 设定命令超时时间,单位秒(s) | - -**返回值:** - -| 类型 | 说明 | -| ------------------------------------------------------------ | ------------------------------------------------------------ | -| Promise\<[ShellCmdResult](js-apis-inner-application-shellCmdResult.md)> | 以Promise形式返回Shell命令执行结果[ShellCmdResult](js-apis-inner-application-shellCmdResult.md)对象。 | - -**示例:** - -```ts -var abilityDelegator; -var cmd = "cmd"; -var timeout = 100; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.executeShellCommand(cmd, timeout).then((data : any) => { - console.info("executeShellCommand promise"); -}); -``` - - - -### finishTest - -finishTest(msg: string, code: number, callback: AsyncCallback\): void - -结束测试并打印日志信息到单元测试终端控制台(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------------------- | ---- | ------------------ | -| msg | string | 是 | 日志字符串 | -| code | number | 是 | 日志码 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; -var msg = "msg"; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.finishTest(msg, 0, (err : any) => { - console.info("finishTest callback"); -}); -``` - - - -### finishTest - -finishTest(msg: string, code: number): Promise\ - -结束测试并打印日志信息到单元测试终端控制台(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------- | -| msg | string | 是 | 日志字符串 | -| code | number | 是 | 日志码 | - -**返回值:** - -| 类型 | 说明 | -| -------------- | ------------------- | -| Promise\ | 以Promise形式返回。 | - -**示例:** - -```ts -var abilityDelegator; -var msg = "msg"; - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.finishTest(msg, 0).then(() => { - console.info("finishTest promise"); -}); -``` - -### addAbilityStageMonitor - -addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\): void; - -添加一个AbilityStageMonitor对象,用于监视指定abilityStage的生命周期状态更改。(callback形式) - -**系统能力:**SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填说明 | 说明 | -| -------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ | -| monitor | [AbilityStageMonitor](#abilitystagemonitor) | 是 | [AbilityStageMonitor](#abilitystagemonitor) 实例 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; - -var monitor = { - moduleName: "moduleName", - srcEntrance: "srcEntrance", -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.addAbilityStageMonitor(monitor, (err : any) => { - console.info("addAbilityStageMonitor callback"); -}); -``` - - - -### addAbilityStageMonitor - -addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\; - -添加一个AbilityStageMonitor对象,用于监视指定abilityStage的生命周期状态更改。(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityStageMonitor](#abilitystagemonitor) | 是 | [AbilityStageMonitor](#abilitystagemonitor) 实例 | - -**返回值:** - -| 类型 | 说明 | -| -------------- | ------------------- | -| Promise\ | 以Promise形式返回。 | - -**示例:** - -```ts -var abilityDelegator; - -var monitor = { - moduleName: "moduleName", - srcEntrance: "srcEntrance", -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.addAbilityStageMonitor(monitor).then(() => { - console.info("addAbilityStageMonitor promise"); -}); -``` - -### removeAbilityStageMonitor - -removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\): void; - -从应用程序内存中删除指定的AbilityStageMonitor对象。(callback形式) - -**系统能力:**SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填说明 | 说明 | -| -------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ | -| monitor | [AbilityStageMonitor](#abilitystagemonitor) | 是 | [AbilityStageMonitor](#abilitystagemonitor) 实例 | -| callback | AsyncCallback\ | 是 | 表示指定的回调方法 | - -**示例:** - -```ts -var abilityDelegator; - -var monitor = { - moduleName: "moduleName", - srcEntrance: "srcEntrance", -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.removeAbilityStageMonitor(monitor, (err : any) => { - console.info("removeAbilityStageMonitor callback"); -}); -``` - - - -### removeAbilityStageMonitor - -removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise\; - -从应用程序内存中删除指定的AbilityStageMonitor对象。(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityStageMonitor](#abilitystagemonitor) | 是 | [AbilityStageMonitor](#abilitystagemonitor) 实例 | - -**返回值:** - -| 类型 | 说明 | -| -------------- | ------------------- | -| Promise\ | 以Promise形式返回。 | - -**示例:** - -```ts -var abilityDelegator; - -var monitor = { - moduleName: "moduleName", - srcEntrance: "srcEntrance", -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.removeAbilityStageMonitor(monitor).then(() => { - console.info("removeAbilityStageMonitor promise"); -}); -``` - -### waitAbilityStageMonitor - -waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback\): void; - -等待并返回与给定AbilityStageMonitor中设置的条件匹配的AbilityStage对象。(callback形式) - -**系统能力:**SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填说明 | 说明 | -| -------- | ------------------------------------------------------------ | -------- | ------------------------------------------------------------ | -| monitor | [AbilityStageMonitor](#abilitystagemonitor) | 是 | [AbilityStageMonitor](#abilitystagemonitor) 实例 | -| callback | AsyncCallback\ | 是 | 成功返回AbilityStage对象,失败返回空。 | - -**示例:** - -```ts -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - moduleName: "moduleName", - srcEntrance: "srcEntrance", -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.waitAbilityStageMonitor(monitor, (err : any, data : any) => { - console.info("waitAbilityStageMonitor callback"); -}); -``` - -### waitAbilityStageMonitor - -waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise\; - -等待并返回与给定AbilityStageMonitor中设置的条件匹配的AbilityStage对象。(promise形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityStageMonitor](#abilitystagemonitor) | 是 | [AbilityStageMonitor](#abilitystagemonitor) 实例 | -| timeout | number | 否 | 超时最大等待时间,以毫秒为单位。 | - -**返回值:** - -| 类型 | 说明 | -| -------------- | ------------------- | -| Promise\ | 成功返回AbilityStage对象,失败返回空。 | - -**示例:** - -```ts -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - moduleName: "moduleName", - srcEntrance: "srcEntrance", -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.waitAbilityStageMonitor(monitor).then((data : any) => { - console.info("waitAbilityStageMonitor promise"); -}); -``` - -### waitAbilityStageMonitor - -waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: AsyncCallback\): void; - -等待并返回与给定AbilityStageMonitor中设置的条件匹配的AbilityStage对象。(callback形式) - -**系统能力:** SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| monitor | [AbilityStageMonitor](#abilitystagemonitor) | 是 | [AbilityStageMonitor](#abilitystagemonitor) 实例 | -| timeout | number | 否 | 超时最大等待时间,以毫秒为单位。 | -| callback | AsyncCallback\ | 是 | 成功返回AbilityStage对象,失败返回空。 | - -**示例:** - -```ts -var abilityDelegator; -var timeout = 100; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - moduleName: "moduleName", - srcEntrance: "srcEntrance", -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -abilityDelegator.waitAbilityStageMonitor(monitor, timeout, (err : any, data : any) => { - console.info("waitAbilityStageMonitor callback"); -}); -``` - -## AbilityStageMonitor - -提供用于匹配满足指定条件的受监视的AbilityStage对象的方法。最近匹配的AbilityStage对象将保存在AbilityStageMonitor对象中。 - -系统能力:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core - -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------------------------------------------------------------ | -------- | ---- | ---- | ------------------------------------------------------------ | -| moduleName | string | 是 | 是 | 要监视的abilityStage的模块名。 | -| srcEntrance | string | 是 | 是 | 要监视的abilityStage的源路径。 | - diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityLifecycleCallback.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityLifecycleCallback.md index 4ef2992fad4b4f2e000512fbb86105fffc9cb617..74afea1750f032f272f9a10a9eaedb96854e2946 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityLifecycleCallback.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityLifecycleCallback.md @@ -17,7 +17,7 @@ import AbilityLifecycleCallback from "@ohos.app.ability.AbilityLifecycleCallback ## AbilityLifecycleCallback.onAbilityCreate -onAbilityCreate(ability: Ability): void; +onAbilityCreate(ability: UIAbility): void; 注册监听应用上下文的生命周期后,在ability创建时触发回调。 @@ -27,12 +27,12 @@ onAbilityCreate(ability: Ability): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | ## AbilityLifecycleCallback.onWindowStageCreate -onWindowStageCreate(ability: Ability, windowStage: window.WindowStage): void; +onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void; 注册监听应用上下文的生命周期后,在windowStage创建时触发回调。 @@ -42,13 +42,13 @@ onWindowStageCreate(ability: Ability, windowStage: window.WindowStage): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 | ## AbilityLifecycleCallback.onWindowStageActive -onWindowStageActive(ability: Ability, windowStage: window.WindowStage): void; +onWindowStageActive(ability: UIAbility, windowStage: window.WindowStage): void; 注册监听应用上下文的生命周期后,在windowStage获焦时触发回调。 @@ -58,13 +58,13 @@ onWindowStageActive(ability: Ability, windowStage: window.WindowStage): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 | ## AbilityLifecycleCallback.onWindowStageInactive -onWindowStageInactive(ability: Ability, windowStage: window.WindowStage): void; +onWindowStageInactive(ability: UIAbility, windowStage: window.WindowStage): void; 注册监听应用上下文的生命周期后,在windowStage失焦时触发回调。 @@ -74,13 +74,13 @@ onWindowStageInactive(ability: Ability, windowStage: window.WindowStage): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 | ## AbilityLifecycleCallback.onWindowStageDestroy -onWindowStageDestroy(ability: Ability, windowStage: window.WindowStage): void; +onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void; 注册监听应用上下文的生命周期后,在windowStage销毁时触发回调。 @@ -90,13 +90,13 @@ onWindowStageDestroy(ability: Ability, windowStage: window.WindowStage): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | | windowStage | [window.WindowStage](js-apis-window.md#windowstage9) | 是 | 当前WindowStage对象 | ## AbilityLifecycleCallback.onAbilityDestroy -onAbilityDestroy(ability: Ability): void; +onAbilityDestroy(ability: UIAbility): void; 注册监听应用上下文的生命周期后,在ability销毁时触发回调。 @@ -106,12 +106,12 @@ onAbilityDestroy(ability: Ability): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | ## AbilityLifecycleCallback.onAbilityForeground -onAbilityForeground(ability: Ability): void; +onAbilityForeground(ability: UIAbility): void; 注册监听应用上下文的生命周期后,在ability的状态从后台转到前台时触发回调。 @@ -121,12 +121,12 @@ onAbilityForeground(ability: Ability): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | ## AbilityLifecycleCallback.onAbilityBackground -onAbilityBackground(ability: Ability): void; +onAbilityBackground(ability: UIAbility): void; 注册监听应用上下文的生命周期后,在ability的状态从前台转到后台时触发回调。 @@ -136,12 +136,12 @@ onAbilityBackground(ability: Ability): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | ## AbilityLifecycleCallback.onAbilityContinue -onAbilityContinue(ability: Ability): void; +onAbilityContinue(ability: UIAbility): void; 注册监听应用上下文的生命周期后,在ability迁移时触发回调。 @@ -151,15 +151,15 @@ onAbilityContinue(ability: Ability): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | ability | [Ability](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | + | ability | [UIAbility](js-apis-application-ability.md#Ability) | 是 | 当前Ability对象 | **示例:** ```ts - import Ability from "@ohos.application.Ability"; + import UIAbility from "@ohos.app.ability.UIAbility"; - export default class MyAbility extends Ability { + export default class MyAbility extends UIAbility { onCreate() { console.log("MyAbility onCreate") let AbilityLifecycleCallback = { diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md index d5be1795d209d5b13979e8bb1a903fc09f14e3c7..e7fc3496716c502f2735448b17553ebd41723974 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityManager.md @@ -41,7 +41,7 @@ updateConfiguration(config: Configuration, callback: AsyncCallback\): void **参数**: -| 名称 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | --------- | ---------------------------------------- | ---- | -------------- | | config | [Configuration](js-apis-app-ability-configuration.md) | 是 | 新的配置项。 | | callback | AsyncCallback\ | 是 | 被指定的回调方法。 | @@ -77,7 +77,7 @@ updateConfiguration(config: Configuration): Promise\ **参数**: -| 名称 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | --------- | ---------------------------------------- | ---- | -------------- | | config | [Configuration](js-apis-app-ability-configuration.md) | 是 | 新的配置项。 | @@ -120,7 +120,7 @@ getAbilityRunningInfos(callback: AsyncCallback\>): vo **参数**: -| 名称 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | --------- | ---------------------------------------- | ---- | -------------- | | callback | AsyncCallback\> | 是 | 被指定的回调方法。 | @@ -184,7 +184,7 @@ getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\> | 是 | 被指定的回调方法。 | @@ -218,7 +218,7 @@ getExtensionRunningInfos(upperLimit: number): Promise\): void; **参数**: -| 名称 | 类型 | 必填 | 说明 | +| 参数名 | 类型 | 必填 | 说明 | | --------- | ---------------------------------------- | ---- | -------------- | | callback | AsyncCallback\ | 是 | 被指定的回调方法。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityMonitor.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityMonitor.md deleted file mode 100644 index fb42a774cde5684b3448f5fe36dfefb119f3c723..0000000000000000000000000000000000000000 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityMonitor.md +++ /dev/null @@ -1,55 +0,0 @@ -# AbilityMonitor - -AbilityMonitor模块提供匹配满足指定条件的受监视能力对象的方法的能力,最近匹配的ability对象将保存在AbilityMonitor对象中。 - -> **说明:** -> -> 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 - -## 使用说明 - -通过abilityDelegator中的addAbilityMonitor来设置。 - -```ts -import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry' -var abilityDelegator; - -function onAbilityCreateCallback(data) { - console.info("onAbilityCreateCallback"); -} - -var monitor = { - abilityName: "abilityname", - onAbilityCreate: onAbilityCreateCallback -} - -abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); -try { - abilityDelegator.addAbilityMonitor(monitor, (err : any) => { - console.info("addAbilityMonitor callback"); - }); -} catch (paramError) { - console.log('error.code: ' + JSON.stringify(paramError.code) + - ' error.message: ' + JSON.stringify(paramError.message)); -} -``` - -## AbilityMonitor - -Ability监听器 - -系统能力:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core - -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------------------------------------------------------------ | -------- | ---- | ---- | ------------------------------------------------------------ | -| abilityName | string | 是 | 是 | 当前AbilityMonitor绑定的ability名称 | -| moduleName? | string | 是 | 是 | 当前AbilityMonitor绑定的module名称 | -| onAbilityCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | 是 | 是 | ability被启动初始化时的回调函数
不设置该属性则不能收到该生命周期回调 | -| onAbilityForeground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | 是 | 是 | ability状态变成前台时的回调函数
不设置该属性则不能收到该生命周期回调 | -| onAbilityBackground?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | 是 | 是 | ability状态变成后台时的回调函数
不设置该属性则不能收到该生命周期回调 | -| onAbilityDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | 是 | 是 | ability被销毁前的回调函数
不设置该属性则不能收到该生命周期回调
| -| onWindowStageCreate?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | 是 | 是 | window stage被创建时的回调函数
不设置该属性则不能收到该生命周期回调
| -| onWindowStageRestore?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | 是 | 是 | window stage被重载时的回调函数
不设置该属性则不能收到该生命周期回调
| -| onWindowStageDestroy?:(data: [Ability](js-apis-application-ability.md#Ability)) | function | 是 | 是 | window stage被销毁前的回调函数
不设置该属性则不能收到该生命周期回调
| - - diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityStage.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityStage.md index 5a8bdfce407d25923433354df3240dc56ec391b2..35de909edc6e8918c1bfa27d65f5a31d13c27cd9 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityStage.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-abilityStage.md @@ -9,7 +9,7 @@ AbilityStage类提供在HAP加载的时候,通知开发者,可以在此进 > 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块接口仅可在Stage模型下使用。 -## 导入类 +## 导入模块 ```ts import AbilityStage from '@ohos.app.ability.AbilityStage'; @@ -66,9 +66,9 @@ onAcceptWant(want: Want): string; ``` -## AbilityStage.onConfigurationUpdated +## AbilityStage.onConfigurationUpdate -onConfigurationUpdated(config: Configuration): void; +onConfigurationUpdate(newConfig: Configuration): void; 环境变化通知接口,发生全局配置变更时回调。 @@ -78,14 +78,14 @@ onConfigurationUpdated(config: Configuration): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | config | [Configuration](js-apis-app-ability-configuration.md) | 是 | 发生全局配置变更时触发回调,当前全局配置包括系统语言、深浅色模式。 | + | newConfig | [Configuration](js-apis-app-ability-configuration.md) | 是 | 发生全局配置变更时触发回调,当前全局配置包括系统语言、深浅色模式。 | **示例:** ```ts class MyAbilityStage extends AbilityStage { - onConfigurationUpdated(config) { - console.log('onConfigurationUpdated, language:' + config.language); + onConfigurationUpdate(config) { + console.log('onConfigurationUpdate, language:' + config.language); } } ``` @@ -96,7 +96,7 @@ onMemoryLevel(level: AbilityConstant.MemoryLevel): void; 当系统已决定调整内存时调用。例如,当该功能在后台运行时,没有足够的内存来运行尽可能多的后台进程时可以使用。 -**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **参数:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md index 5705224c816e4bce54a334b847ee3fb5a2aebc4f..e6554c2496fed02258bf31efc177c36ac0bef28c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-appManager.md @@ -9,7 +9,7 @@ appManager模块提供App管理的能力,包括查询当前是否处于稳定 ## 导入模块 ```ts -import app from '@ohos.app.ability.appManager'; +import appManager from '@ohos.app.ability.appManager'; ``` ## appManager.isRunningInStabilityTest9+ @@ -24,7 +24,7 @@ static isRunningInStabilityTest(callback: AsyncCallback<boolean>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<boolean> | 否 | 返回当前是否处于稳定性测试场景。 | + | callback | AsyncCallback<boolean> | 是 | 返回当前是否处于稳定性测试场景。 | **示例:** @@ -98,7 +98,7 @@ isRamConstrainedDevice(callback: AsyncCallback\): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<boolean> | 否 | 返回当前是否是ram受限设备。 | + | callback | AsyncCallback<boolean> | 是 | 返回当前是否是ram受限设备。 | **示例:** @@ -145,7 +145,7 @@ getAppMemorySize(callback: AsyncCallback\): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<number> | 否 | 应用程序内存大小。 | + | callback | AsyncCallback<number> | 是 | 应用程序内存大小。 | **示例:** @@ -167,6 +167,8 @@ getProcessRunningInfos(): Promise\>; **系统能力**:SystemCapability.Ability.AbilityRuntime.Core +**系统API**: 此接口为系统接口,三方应用不支持调用。 + **返回值:** | 类型 | 说明 | @@ -195,6 +197,8 @@ getProcessRunningInfos(callback: AsyncCallback\>): vo **系统能力**:SystemCapability.Ability.AbilityRuntime.Core +**系统API**: 此接口为系统接口,三方应用不支持调用。 + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -220,6 +224,8 @@ getProcessRunningInformation(): Promise\>; **系统能力**:SystemCapability.Ability.AbilityRuntime.Core +**系统API**: 此接口为系统接口,三方应用不支持调用。 + **返回值:** | 类型 | 说明 | @@ -250,7 +256,7 @@ getProcessRunningInformation(callback: AsyncCallback\> | 否 | 获取有关运行进程的信息。 | +| callback | AsyncCallback\> | 是 | 获取有关运行进程的信息。 | **示例:** @@ -261,9 +267,9 @@ getProcessRunningInformation(callback: AsyncCallback\9+ +## appManager.on -registerApplicationStateObserver(observer: ApplicationStateObserver): number; +on(type: "applicationState", observer: ApplicationStateObserver): number; 注册全部应用程序状态观测器。 @@ -277,11 +283,12 @@ registerApplicationStateObserver(observer: ApplicationStateObserver): number; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observer | [ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md) | 否 | 返回观察者的数字代码。 | +| type | string | 是 | 调用接口类型 | +| observer | [ApplicationStateObserver](./js-apis-inner-application-applicationStateObserver.md) | 是 | 返回观察者的数字代码。 | **示例:** - ```ts + ```js var applicationStateObserver = { onForegroundApplicationChanged(appStateData) { console.log('------------ onForegroundApplicationChanged -----------', appStateData); @@ -299,13 +306,18 @@ registerApplicationStateObserver(observer: ApplicationStateObserver): number; console.log('------------ onProcessStateChanged -----------', processData); } } - const observerCode = app.registerApplicationStateObserver(applicationStateObserver); - console.log('-------- observerCode: ---------', observerCode); + try { + const observerCode = app.on(applicationStateObserver); + console.log('-------- observerCode: ---------', observerCode); + } catch (paramError) { + console.log('error: ' + paramError.code + ', ' + paramError.message); + } + ``` -## appManager.registerApplicationStateObserver9+ +## appManager.on -registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameList: Array\): number; +on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array\): number; 注册指定应用程序状态观测器。 @@ -319,12 +331,13 @@ registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameL | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observer | [ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md) | 否 | 返回观察者的数字代码。 | -| bundleNameList | Array | 否 | 表示需要注册监听的bundleName数组。最大值128。 | +| type | string | 是 | 调用接口类型 | +| observer | [ApplicationStateObserver](./js-apis-inner-application-applicationStateObserver.md) | 是 | 返回观察者的数字代码。 | +| bundleNameList | Array | 是 | 表示需要注册监听的bundleName数组。最大值128。 | **示例:** - ```ts + ```js var applicationStateObserver = { onForegroundApplicationChanged(appStateData) { console.log('------------ onForegroundApplicationChanged -----------', appStateData); @@ -343,12 +356,17 @@ registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameL } } var bundleNameList = ['bundleName1', 'bundleName2']; - const observerCode = app.registerApplicationStateObserver(applicationStateObserver, bundleNameList); - console.log('-------- observerCode: ---------', observerCode); + try { + const observerCode = app.on("applicationState", applicationStateObserver, bundleNameList); + console.log('-------- observerCode: ---------', observerCode); + } catch (paramError) { + console.log('error: ' + paramError.code + ', ' + paramError.message); + } + ``` -## appManager.unregisterApplicationStateObserver9+ +## appManager.off -unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback\): void; +off(type: "applicationState", observerId: number, callback: AsyncCallback\): void; 取消注册应用程序状态观测器。 @@ -362,22 +380,100 @@ unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback\ | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | +| type | string | 是 | 调用接口类型 | +| observerId | number | 是 | 表示观察者的编号代码。 | +| callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | + +**示例:** + + ```js + var observerId = 100; + + function unregisterApplicationStateObserverCallback(err) { + if (err) { + console.log('------------ unregisterApplicationStateObserverCallback ------------', err); + } + } + try { + app.off(observerId, unregisterApplicationStateObserverCallback); + } catch (paramError) { + console.log('error: ' + paramError.code + ', ' + paramError.message); + } + ``` + +## appManager.off + +off(type: "applicationState", observerId: number): Promise\; + +取消注册应用程序状态观测器。 + +**需要权限**:ohos.permission.RUNNING_STATE_OBSERVER + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**系统API**:该接口为系统接口,三方应用不支持调用。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| type | string | 是 | 调用接口类型 | | observerId | number | 否 | 表示观察者的编号代码。 | -| callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | + +**返回值:** + +| 类型 | 说明 | +| -------- | -------- | +| Promise\ | 返回执行结果。 | **示例:** - ```ts - var observerId = 100; - function unregisterApplicationStateObserverCallback(err) { - if (err) { - console.log('------------ unregisterApplicationStateObserverCallback ------------', err); + ```js + var observerId = 100; + + try { + app.off(observerId) + .then((data) => { + console.log('----------- unregisterApplicationStateObserver success ----------', data); + }) + .catch((err) => { + console.log('----------- unregisterApplicationStateObserver fail ----------', err); + }) + } catch (paramError) { + console.log('error: ' + paramError.code + ', ' + paramError.message); } - } - app.unregisterApplicationStateObserver(observerId, unregisterApplicationStateObserverCallback); ``` -## appManager.unregisterApplicationStateObserver9+ +## appManager.getForegroundApplications + +getForegroundApplications(callback: AsyncCallback\>): void; + +获取前台进程的应用程序。 + +**需要权限**:ohos.permission.GET_RUNNING_INFO + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**系统API**:该接口为系统接口,三方应用不支持调用。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| callback | AsyncCallback\> | 是 | 表示应用的状态数据。 | + +**示例:** + + ```js + function getForegroundApplicationsCallback(err, data) { + if (err) { + console.log('--------- getForegroundApplicationsCallback fail ---------', err.code + ': ' + err.message); + } else { + console.log('--------- getForegroundApplicationsCallback success ---------', data) + } + } + app.getForegroundApplications(getForegroundApplicationsCallback); + ``` unregisterApplicationStateObserver(observerId: number): Promise\; @@ -393,7 +489,7 @@ unregisterApplicationStateObserver(observerId: number): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observerId | number | 否 | 表示观察者的编号代码。 | +| observerId | number | 是 | 表示观察者的编号代码。 | **返回值:** @@ -430,7 +526,7 @@ getForegroundApplications(callback: AsyncCallback\>): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\> | 否 | 表示应用的状态数据。 | +| callback | AsyncCallback\> | 是 | 表示应用的状态数据。 | **示例:** @@ -560,8 +656,8 @@ killProcessesByBundleName(bundleName: string, callback: AsyncCallback\); | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| bundleName | string | 否 | 表示包名。 | -| callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | +| bundleName | string | 是 | 表示包名。 | +| callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | **示例:** @@ -593,7 +689,7 @@ killProcessesByBundleName(bundleName: string): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| bundleName | string | 否 | 表示包名。 | +| bundleName | string | 是 | 表示包名。 | **返回值:** @@ -630,8 +726,8 @@ clearUpApplicationData(bundleName: string, callback: AsyncCallback\); | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| bundleName | string | 否 | 表示包名。 | -| callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | +| bundleName | string | 是 | 表示包名。 | +| callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | **示例:** @@ -663,7 +759,7 @@ clearUpApplicationData(bundleName: string): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| bundleName | string | 否 | 表示包名。 | +| bundleName | string | 是 | 表示包名。 | **返回值:** @@ -690,7 +786,7 @@ clearUpApplicationData(bundleName: string): Promise\; **系统API**: 此接口为系统接口,三方应用不支持调用。 -| 名称 | 值 | 描述 | +| 名称 | 值 | 说明 | | -------------------- | --- | --------------------------------- | | STATE_CREATE | 1 | 当应用在创建中的时候处于的状态。 | | STATE_FOREGROUND | 2 | 当应用切换到前台的时候处于的状态。 | @@ -704,7 +800,7 @@ clearUpApplicationData(bundleName: string): Promise\; **系统API**: 此接口为系统接口,三方应用不支持调用。 -| 名称 | 值 | 描述 | +| 名称 | 值 | 说明 | | -------------------- | --- | --------------------------------- | | STATE_CREATE | 1 | 当进程在创建中的时候处于的状态。 | | STATE_FOREGROUND | 2 | 当进程切换到前台的时候处于的状态。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-appRecovery.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-appRecovery.md index 318a1d4b690207df73c2181e36d38c4682e56795..1f87ef14e76ebd855c43990ce2d84dbcb2ee3832 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-appRecovery.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-appRecovery.md @@ -21,10 +21,10 @@ import appRecovery from '@ohos.app.ability.appRecovery' | 名称 | 值 | 说明 | | ----------------------------- | ---- | ------------------------------------------------------------ | | ALWAYS_RESTART | 0 | 总是重启应用。 | -| CPP_CRASH_NO_RESTART | 1 | 发生CPP_CRASH时不重启应用。 | -| JS_CRASH_NO_RESTART | 2 | 发生JS_CRASH时不重启应用。 | -| APP_FREEZE_NO_RESTART | 4 | 发生APP_FREEZE时不重启应用。 | -| NO_RESTART | 65535 | 总是不重启应用。 | +| CPP_CRASH_NO_RESTART | 0x0001 | 发生CPP_CRASH时不重启应用。 | +| JS_CRASH_NO_RESTART | 0x0002 | 发生JS_CRASH时不重启应用。 | +| APP_FREEZE_NO_RESTART | 0x0004 | 发生APP_FREEZE时不重启应用。 | +| NO_RESTART | 0xFFFF | 总是不重启应用。 | ## appRecovery.SaveOccasionFlag @@ -34,8 +34,8 @@ import appRecovery from '@ohos.app.ability.appRecovery' | 名称 | 值 | 说明 | | ----------------------------- | ---- | ------------------------------------------------------------ | -| SAVE_WHEN_ERROR | 1 | 当发生应用故障时保存。 | -| SAVE_WHEN_BACKGROUND | 2 | 当应用切入后台时保存。 | +| SAVE_WHEN_ERROR | 0x0001 | 当发生应用故障时保存。 | +| SAVE_WHEN_BACKGROUND | 0x0002 | 当应用切入后台时保存。 | ## appRecovery.SaveModeFlag @@ -45,8 +45,8 @@ import appRecovery from '@ohos.app.ability.appRecovery' | 名称 | 值 | 说明 | | ----------------------------- | ---- | ------------------------------------------------------------ | -| SAVE_WITH_FILE | 1 | 每次状态保存都会写入到本地文件缓存。 | -| SAVE_WITH_SHARED_MEMORY | 2 | 状态先保存在内存中,应用故障退出时写入到本地文件缓存。 | +| SAVE_WITH_FILE | 0x0001 | 每次状态保存都会写入到本地文件缓存。 | +| SAVE_WITH_SHARED_MEMORY | 0x0002 | 状态先保存在内存中,应用故障退出时写入到本地文件缓存。 | ## appRecovery.enableAppRecovery diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md index b8979b193d16e9415b6ac7656d7b40817f7fd388..e6137aebb793a24632cfd0eb3549bd422947bfea 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-common.md @@ -15,21 +15,21 @@ import common from '@ohos.app.ability.common' **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| UIAbilityContext | 只读 | [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md) | 否 | UIAbilityContext二级模块。 | -| AbilityStageContext | 只读 | [AbilityStageContext](js-apis-inner-application-abilityStageContext.md) | 否 | AbilityStageContext二级模块。 | -| ApplicationContext | 只读 | [ApplicationContext](js-apis-inner-application-applicationContext.md) | 否 | ApplicationContext二级模块。 | -| BaseContext | 只读 | [BaseContext](js-apis-inner-application-baseContext.md) | 否 | BaseContext二级模块。 | -| Context | 只读 | [Context](js-apis-inner-application-context.md) | 否 | Context二级模块。 | -| ExtensionContext | 只读 | [ExtensionContext](js-apis-inner-application-extensionContext.md) | 否 | ExtensionContext二级模块。 | -| FormExtensionContext | 只读 | [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) | 否 | FormExtensionContext二级模块。 | -| AreaMode | 只读 | [AreaMode](#areamode) | 否 | AreaMode枚举值。 | -| EventHub | 只读 | [EventHub](js-apis-inner-application-eventHub.md) | 否 | EventHub二级模块。 | -| PermissionRequestResult | 只读 | [PermissionRequestResult](js-apis-inner-application-permissionRequestResult.md) | 否 | PermissionRequestResult二级模块。 | -| PacMap | 只读 | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#PacMap) | 否 | PacMap二级模块。 | -| AbilityResult | 只读 | [AbilityResult](js-apis-inner-ability-abilityResult.md) | 否 | AbilityResult二级模块。 | -| ConnectOptions | 只读 | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | 否 | ConnectOptions二级模块。 | +| 名称 | 类型 | 必填 | 说明 | +| ----------- | -------------------- | ---- | ------------------------------------------------------------ | +| UIAbilityContext | [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md) | 否 | UIAbilityContext二级模块。 | +| AbilityStageContext | [AbilityStageContext](js-apis-inner-application-abilityStageContext.md) | 否 | AbilityStageContext二级模块。 | +| ApplicationContext | [ApplicationContext](js-apis-inner-application-applicationContext.md) | 否 | ApplicationContext二级模块。 | +| BaseContext | [BaseContext](js-apis-inner-application-baseContext.md) | 否 | BaseContext二级模块。 | +| Context | [Context](js-apis-inner-application-context.md) | 否 | Context二级模块。 | +| ExtensionContext | [ExtensionContext](js-apis-inner-application-extensionContext.md) | 否 | ExtensionContext二级模块。 | +| FormExtensionContext | [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) | 否 | FormExtensionContext二级模块。 | +| AreaMode | [AreaMode](#areamode) | 否 | AreaMode枚举值。 | +| EventHub | [EventHub](js-apis-inner-application-eventHub.md) | 否 | EventHub二级模块。 | +| PermissionRequestResult | [PermissionRequestResult](js-apis-inner-application-permissionRequestResult.md) | 否 | PermissionRequestResult二级模块。 | +| PacMap | [PacMap](js-apis-inner-ability-dataAbilityHelper.md#PacMap) | 否 | PacMap二级模块。 | +| AbilityResult | [AbilityResult](js-apis-inner-ability-abilityResult.md) | 否 | AbilityResult二级模块。 | +| ConnectOptions | [ConnectOptions](js-apis-inner-ability-connectOptions.md) | 否 | ConnectOptions二级模块。 | **示例:** ```ts @@ -56,7 +56,7 @@ let connectOptions: common.ConnectOptions; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 变量 | 值 | 描述 | +| 名称 | 值 | 说明 | | --------------- | ---- | --------------- | | EL1 | 0 | 设备级加密区。 | | EL2 | 1 | 用户凭据加密区。默认为EL2。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-configuration.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-configuration.md index b74857f2a1501e1cb25fb2ec68f5cbcd5b9a0414..6324254303644d708d1ca9c9eb0d85a0dc20cc15 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-configuration.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-configuration.md @@ -6,12 +6,18 @@ > > 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +## 导入模块 + +```ts +import Configuration from '@ohos.app.ability.Configuration' +``` + **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase | 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | language | string | 是 | 是 | 表示应用程序的当前语言。 | -| colorMode | [ColorMode](js-apis-app-ability-configurationconstant.md#configurationconstantcolormode) | 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 | +| colorMode | [ColorMode](js-apis-app-ability-configurationConstant.md#configurationconstantcolormode) | 是 | 是 | 表示深浅色模式,取值范围:浅色模式(COLOR_MODE_LIGHT),深色模式(COLOR_MODE_DARK)。默认为浅色。 | | direction | Direction | 是 | 否 | 表示屏幕方向,取值范围:水平方向(DIRECTION_HORIZONTAL),垂直方向(DIRECTION_VERTICAL)。 | | screenDensity | ScreenDensity | 是 | 否 | 表示屏幕分辨率,取值范围:SCREEN_DENSITY_SDPI(120)、SCREEN_DENSITY_MDPI(160)、SCREEN_DENSITY_LDPI(240)、SCREEN_DENSITY_XLDPI(320)、SCREEN_DENSITY_XXLDPI(480)、SCREEN_DENSITY_XXXLDPI(640)。 | | displayId | number | 是 | 否 | 表示应用所在的物理屏幕Id。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-contextConstant.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-contextConstant.md index 6cbae9bd87e3776d8bbdedfce6e050b8c4ff3616..b64e0d35d838aae642e8986bcc99ccc8b5fba2f8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-contextConstant.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-contextConstant.md @@ -17,7 +17,7 @@ import contextConstant from '@ohos.app.ability.contextConstant'; 使用时通过ContextConstant.AreaMode获取。 -**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.SystemCapability.Ability.AbilityRuntime.Core +**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core | 名称 | 值 | 说明 | | -------- | -------- | -------- | diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-errorManager.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-errorManager.md index 14b9d63f228cc09e7ba4e483ab4fe9af6bf87c80..43a6a8e6d1835be75cf7dd2608211b39899ac385 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-errorManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-errorManager.md @@ -24,7 +24,7 @@ on(type: "error", observer: ErrorObserver): number; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | type | string | 是 | 调用接口类型 | -| observer | [ErrorObserver](#errorobserver) | 否 | 返回观察者的数字代码。 | +| observer | [ErrorObserver](./js-apis-inner-application-errorObserver.md) | 是 | 返回观察者的数字代码。 | **示例:** @@ -54,8 +54,8 @@ off(type: "error", observerId: number, callback: AsyncCallback\): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | type | string | 是 | 调用接口类型 | -| observerId | number | 否 | 返回观察者的数字代码。 | -| callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | +| observerId | number | 是 | 返回观察者的数字代码。 | +| callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | **示例:** @@ -87,7 +87,7 @@ off(type: "error", observerId: number): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | type | string | 是 | 调用接口类型 | -| observerId | number | 否 | 返回观察者的数字代码。 | +| observerId | number | 是 | 返回观察者的数字代码。 | **返回值:** @@ -112,28 +112,3 @@ try { } ``` - -## ErrorObserver - -onUnhandledException(errMsg: string): void; - -将在js运行时引发用户未捕获的异常时调用。 - -**系统能力**:SystemCapability.Ability.AbilityRuntime.Core - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| errMsg | string | 否 | 有关异常的消息和错误堆栈跟踪。 | - -**示例:** - -```js -var observer = { - onUnhandledException(errorMsg) { - console.log('onUnhandledException, errorMsg: ', errorMsg) - } -} -errorManager.on(observer) -``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md index 296ecc929e889872750b9705611bfe7d754ccedd..0f2d943aa526835c41db0e62c38ae6fa5f71c028 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-quickFixManager.md @@ -20,11 +20,11 @@ hap级别的快速修复信息。 **系统API**: 此接口为系统接口,三方应用不支持调用。 -| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ----------- | -------- |-------- | -------------------- | ---- | ------------------------------------------------------------ | -| moduleName | 是 | 否 | string | 是 | hap包的名称。 | -| originHapHash | 是 | 否 | string | 是 | 指示hap的哈希值。 | -| quickFixFilePath | 是 | 否 | string | 是 | 指示快速修复文件的安装路径。 | +| 名称 | 类型 | 必填 | 说明 | +| ----------- | -------------------- | ---- | ------------------------------------------------------------ | +| moduleName | string | 是 | hap包的名称。 | +| originHapHash | string | 是 | 指示hap的哈希值。 | +| quickFixFilePath | string | 是 | 指示快速修复文件的安装路径。 | ## ApplicationQuickFixInfo @@ -34,14 +34,14 @@ hap级别的快速修复信息。 **系统API**: 此接口为系统接口,三方应用不支持调用。 -| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ----------- | -------- |-------- | -------------------- | ---- | ------------------------------------------------------------ | -| bundleName | 是 | 否 | string | 是 | 应用的包名。 | -| bundleVersionCode | 是 | 否 | number | 是 | 应用的版本号。 | -| bundleVersionName | 是 | 否 | string | 是 | 应用版本号的文字描述。 | -| quickFixVersionCode | 是 | 否 | number | 是 | 快速修复补丁包的版本号。 | -| quickFixVersionName | 是 | 否 | string | 是 | 快速修复补丁包版本号的文字描述。 | -| hapModuleQuickFixInfo | 是 | 否 | Array\<[HapModuleQuickFixInfo](#hapmodulequickfixinfo)> | 是 | hap级别的快速修复信息。 | +| 名称 | 类型 | 必填 | 说明 | +| ----------- | -------------------- | ---- | ------------------------------------------------------------ | +| bundleName | string | 是 | 应用的包名。 | +| bundleVersionCode | number | 是 | 应用的版本号。 | +| bundleVersionName | string | 是 | 应用版本号的文字描述。 | +| quickFixVersionCode | number | 是 | 快速修复补丁包的版本号。 | +| quickFixVersionName | string | 是 | 快速修复补丁包版本号的文字描述。 | +| hapModuleQuickFixInfo | Array\<[HapModuleQuickFixInfo](#hapmodulequickfixinfo)> | 是 | hap级别的快速修复信息。 | ## quickFixManager.applyQuickFix @@ -59,8 +59,8 @@ applyQuickFix(hapModuleQuickFixFiles: Array\, callback: AsyncCallback\ | 否 | 快速修复补丁文件(补丁文件需包含有效的文件路径)。 | - | callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | + | hapModuleQuickFixFiles | Array\ | 是 | 快速修复补丁文件(补丁文件需包含有效的文件路径)。 | + | callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | **示例:** @@ -97,7 +97,7 @@ applyQuickFix(hapModuleQuickFixFiles: Array\): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | hapModuleQuickFixFiles | Array\ | 否 | 快速修复补丁文件(补丁文件需包含有效的文件路径)。 | + | hapModuleQuickFixFiles | Array\ | 是 | 快速修复补丁文件(补丁文件需包含有效的文件路径)。 | **返回值:** @@ -138,8 +138,8 @@ getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback\ | 否 | 应用的快速修复信息。 | + | bundleName | string | 是 |应用的包名。 | + | callback | AsyncCallback\<[ApplicationQuickFixInfo](#applicationquickfixinfo)> | 是 | 应用的快速修复信息。 | **示例:** @@ -176,7 +176,7 @@ getApplicationQuickFixInfo(bundleName: string): Promise\): Array\; +onDump(params: Array\): Array\; 转储客户端信息时调用。 @@ -244,7 +244,7 @@ dump(params: Array\): Array\; ```ts class ServiceExt extends ServiceExtension { - dump(params) { + onDump(params) { console.log('dump, params:' + JSON.stringify(params)); return ["params"] } diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-startOptions.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-startOptions.md index 585316f4f40f7ccfa687e2634eec537c06721c5a..4b13c1aaea72b8b1b9c0209b78e724e81be952e0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-startOptions.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-startOptions.md @@ -18,7 +18,7 @@ import StartOptions from '@ohos.app.ability.StartOptions'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -------- | -| [windowMode](js-apis-application-abilityConstant.md#abilityconstantwindowmode) | 是 | 否 | number | 否 | 窗口模式。 | -| displayId | 是 | 否 | number | 否 | 显示ID。 | +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| [windowMode](js-apis-application-abilityConstant.md#abilityconstantwindowmode) | number | 否 | 窗口模式。 | +| displayId | number | 否 | 显示ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md index 48fcf3e231a36873253bc5d46827a5262d71515c..52dbfec46bc28a8e36d3f59f1ea4110b09fa7e07 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-uiAbility.md @@ -22,7 +22,7 @@ import Ability from '@ohos.app.ability.UIAbility'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.AbilityCore -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | context | [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md) | 是 | 否 | 上下文。 | | launchWant | [Want](js-apis-app-ability-want.md) | 是 | 否 | Ability启动时的参数。 | @@ -240,9 +240,9 @@ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; } ``` -## Ability.dump +## Ability.onDump -dump(params: Array\): Array\; +onDump(params: Array\): Array\; 转储客户端信息时调用。 @@ -258,7 +258,7 @@ dump(params: Array\): Array\; ```ts class myAbility extends Ability { - dump(params) { + onDump(params) { console.log('dump, params:' + JSON.stringify(params)); return ["params"] } @@ -332,11 +332,8 @@ call(method: string, data: rpc.Sequenceable): Promise<void>; | 错误码ID | 错误信息 | | ------- | -------------------------------- | -| 201 | The application does not have permission to call the interface. | -| 401 | Invalid input parameter. | -| 16200001 | Caller released. The caller has been released. | -| 16200002 | Callee invalid. The callee does not exist. | -| 16000050 | Internal Error. | +| 401 | If the input parameter is not valid parameter. | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -416,11 +413,8 @@ callWithResult(method: string, data: rpc.Sequenceable): Promise<rpc.MessagePa | 错误码ID | 错误信息 | | ------- | -------------------------------- | -| 201 | The application does not have permission to call the interface. | -| 401 | Invalid input parameter. | -| 16200001 | Caller released. The caller has been released. | -| 16200002 | Callee invalid. The callee does not exist. | -| 16000050 | Internal Error. | +| 401 | If the input parameter is not valid parameter. | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -541,9 +535,8 @@ release(): void; | 错误码ID | 错误信息 | | ------- | -------------------------------- | -| 401 | Invalid input parameter. | -| 16200001 | Caller released. The caller has been released. | -| 16000050 | Internal Error. | +| 401 | If the input parameter is not valid parameter. | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -581,7 +574,7 @@ release(): void; ## Callee.on -on(method: string, callback: CalleeCallBack): void; +on(method: string, callback: CalleeCallback): void; 通用组件服务端注册消息通知callback。 @@ -592,15 +585,14 @@ on(method: string, callback: CalleeCallBack): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | method | string | 是 | 与客户端约定的通知消息字符串。 | - | callback | CalleeCallBack | 是 | 一个rpc.MessageParcel类型入参的js通知同步回调函数, 回调函数至少要返回一个空的rpc.Sequenceable数据对象, 其他视为函数执行错误。 | + | callback | CalleeCallback | 是 | 一个rpc.MessageParcel类型入参的js通知同步回调函数, 回调函数至少要返回一个空的rpc.Sequenceable数据对象, 其他视为函数执行错误。 | **错误码:** | 错误码ID | 错误信息 | | ------- | -------------------------------- | -| 401 | Invalid input parameter. | -| 16200004 | Method registered. The method has registered. | -| 16000050 | Internal Error. | +| 401 | If the input parameter is not valid parameter. | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -665,9 +657,8 @@ off(method: string): void; | 错误码ID | 错误信息 | | ------- | -------------------------------- | -| 401 | Invalid input parameter. | -| 16200005 | Method not registered. The method has not registered. | -| 16000050 | Internal Error. | +| 401 | If the input parameter is not valid parameter. | +其他ID见[元能力子系统错误码](../errorcodes/errorcode-ability.md) **示例:** @@ -694,9 +685,9 @@ off(method: string): void; **系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 可读 | 可写 | 类型 | 说明 | | -------- | -------- | -------- | -------- | -------- | -| (msg: string) | function | 是 | 否 | 调用者注册的侦听器函数接口的原型。 | +| (msg: string) | 是 | 否 | function | 调用者注册的侦听器函数接口的原型。 | ## CalleeCallback @@ -704,6 +695,6 @@ off(method: string): void; **系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 可读 | 可写 | 类型 | 说明 | | -------- | -------- | -------- | -------- | -------- | -| (indata: rpc.MessageParcel) | rpc.Sequenceable | 是 | 否 | 被调用方注册的消息侦听器函数接口的原型。 | +| (indata: rpc.MessageParcel) | 是 | 否 | rpc.Sequenceable | 被调用方注册的消息侦听器函数接口的原型。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-want.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-want.md index 5883fa0f25a90da259077335f81f8eadbb212aa1..006fa77174247cffc574fe386db4ee7e7ded5431 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-want.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-want.md @@ -6,7 +6,7 @@ Want是对象间信息传递的载体, 可以用于应用组件间的信息传 > > 本模块首批接口从API version 9 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 -## 导入类 +## 导入模块 ```ts import Want from '@ohos.app.ability.Want'; @@ -16,18 +16,18 @@ import Want from '@ohos.app.ability.Want'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | -| bundleName | 只读 | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | -| abilityName | 只读 | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 | -| uri | 只读 | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | -| type | 只读 | string | 否 | 表示MIME type类型描述,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 | -| flags | 只读 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-ability-wantConstant.md#wantConstant.Flags)。 | -| action | 只读 | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 | -| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述,由开发者自行决定传入的键值对。默认会携带以下key值:
ohos.aafwk.callerPid 表示拉起方的pid。
ohos.aafwk.param.callerToken 表示拉起方的token。
ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 | -| entities | 只读 | Array\ | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 | -| moduleName | 只读 | string | 否 | 表示待启动的Ability所属的模块(module)。 | +| 名称 | 类型 | 必填 | 说明 | +| ----------- | -------------------- | ---- | ------------------------------------------------------------ | +| deviceId | string | 否 | 表示运行指定Ability的设备ID。 | +| bundleName | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| abilityName | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 | +| uri | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | +| type | string | 否 | 表示MIME type类型描述,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 | +| flags | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-ability-wantConstant.md#wantConstant.Flags)。 | +| action | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 | +| parameters | {[key: string]: any} | 否 | 表示WantParams描述,由开发者自行决定传入的键值对。默认会携带以下key值:
ohos.aafwk.callerPid 表示拉起方的pid。
ohos.aafwk.param.callerToken 表示拉起方的token。
ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 | +| entities | Array\ | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 | +| moduleName | string | 否 | 表示待启动的Ability所属的模块(module)。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md index a9bb35105043b6c6fbfe533c715750e307b13c29..55f6b9b286e49ddbb8e875a47f4e5eb9602f3f81 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantAgent.md @@ -22,10 +22,10 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\): void **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| -------- | --- | ---- | -------------------------- | ---- | ----------------------- | -| info | 是 | 否 | WantAgentInfo | 是 | WantAgent信息。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 创建WantAgent的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------- | ---- | ----------------------- | +| info | WantAgentInfo | 是 | WantAgent信息。 | +| callback | AsyncCallback\ | 是 | 创建WantAgent的回调方法。 | **示例:** @@ -83,9 +83,9 @@ getWantAgent(info: WantAgentInfo): Promise\ **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ---- | --- | ---- | ------------- | ---- | ------------- | -| info | 是 | 否 | WantAgentInfo | 是 | WantAgent信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------------- | ---- | ------------- | +| info | WantAgentInfo | 是 | WantAgent信息。 | **返回值:** @@ -148,10 +148,10 @@ getBundleName(agent: WantAgent, callback: AsyncCallback\): void **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| -------- | --- | ---- | ----------------------- | ---- | --------------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取WantAgent实例的包名的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------- | ---- | --------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 获取WantAgent实例的包名的回调方法。 | **示例:** @@ -224,9 +224,9 @@ getBundleName(agent: WantAgent): Promise\ **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ----- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -297,10 +297,10 @@ getUid(agent: WantAgent, callback: AsyncCallback\): void **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| -------- | --- | ---- | ----------------------- | ---- | ----------------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取WantAgent实例的用户ID的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------- | ---- | ----------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 获取WantAgent实例的用户ID的回调方法。 | **示例:** @@ -373,9 +373,9 @@ getUid(agent: WantAgent): Promise\ **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ----- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -448,10 +448,10 @@ getWant(agent: WantAgent, callback: AsyncCallback\): void **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| -------- | --- | ---- | --------------------- | ---- | ------------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取WantAgent对象want的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | ------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 获取WantAgent对象want的回调方法。 | **示例:** @@ -526,9 +526,9 @@ getWant(agent: WantAgent): Promise\ **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ----- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -599,10 +599,10 @@ cancel(agent: WantAgent, callback: AsyncCallback\): void **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| -------- | --- | ---- | --------------------- | ---- | --------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 取消WantAgent实例的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | --------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 取消WantAgent实例的回调方法。 | **示例:** @@ -675,9 +675,9 @@ cancel(agent: WantAgent): Promise\ **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ----- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -740,7 +740,7 @@ try { ## WantAgent.trigger -trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback\): void +trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback\): void 主动激发WantAgent实例(callback形式)。 @@ -748,11 +748,11 @@ trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback\ | 是 | 主动激发WantAgent实例的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ----------------------------- | ---- | ------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| triggerInfo | TriggerInfo | 是 | TriggerInfo对象。 | +| callback | AsyncCallback\ | 否 | 主动激发WantAgent实例的回调方法。 | **示例:** @@ -830,11 +830,11 @@ equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback\ | 是 | 判断两个WantAgent实例是否相等的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------ | ---- | --------------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| otherAgent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 判断两个WantAgent实例是否相等的回调方法。 | **示例:** @@ -909,10 +909,10 @@ equal(agent: WantAgent, otherAgent: WantAgent): Promise\ **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ---------- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| otherAgent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| otherAgent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -983,10 +983,10 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\): void; **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ---------- | --- | ---- | ------------------------ | ---- | --------------------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取一个WantAgent的OperationType信息的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------ | ---- | --------------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 获取一个WantAgent的OperationType信息的回调方法。 | **示例:** @@ -1048,9 +1048,9 @@ getOperationType(agent: WantAgent): Promise\; **参数:** -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ---------- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -1116,13 +1116,13 @@ try { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| -------------- | --- | ---- | ------------------------------- | ---- | ---------------------- | -| wants | 是 | 是 | Array\ | 是 | 将被执行的动作列表。 | -| operationType | 是 | 是 | wantAgent.OperationType | 是 | 动作类型。 | -| requestCode | 是 | 是 | number | 是 | 使用者定义的一个私有值。 | -| wantAgentFlags | 是 | 是 | Array | 否 | 动作执行属性。 | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | +| 名称 | 类型 | 必填 | 说明 | +| -------------- | ------------------------------- | ---- | ---------------------- | +| wants | Array\ | 是 | 将被执行的动作列表。 | +| operationType | wantAgent.OperationType | 是 | 动作类型。 | +| requestCode | number | 是 | 使用者定义的一个私有值。 | +| wantAgentFlags | Array | 否 | 动作执行属性。 | +| extraInfo | {[key: string]: any} | 否 | 额外数据。 | @@ -1132,16 +1132,16 @@ try { | 名称 | 值 | 说明 | | ------------------- | -------------- | ------------------------------------------------------------ | -| ONE_TIME_FLAG | WantAgentFlags | WantAgent仅能使用一次。 | -| NO_BUILD_FLAG | WantAgentFlags | 如果描述WantAgent对象不存在,则不创建它,直接返回null。 | -| CANCEL_PRESENT_FLAG | WantAgentFlags | 在生成一个新的WantAgent对象前取消已存在的一个WantAgent对象。 | -| UPDATE_PRESENT_FLAG | WantAgentFlags | 使用新的WantAgent的额外数据替换已存在的WantAgent中的额外数据。 | -| CONSTANT_FLAG | WantAgentFlags | WantAgent是不可变的。 | -| REPLACE_ELEMENT | WantAgentFlags | 当前Want中的element属性可被WantAgent.trigger()中Want的element属性取代 | -| REPLACE_ACTION | WantAgentFlags | 当前Want中的action属性可被WantAgent.trigger()中Want的action属性取代 | -| REPLACE_URI | WantAgentFlags | 当前Want中的uri属性可被WantAgent.trigger()中Want的uri属性取代 | -| REPLACE_ENTITIES | WantAgentFlags | 当前Want中的entities属性可被WantAgent.trigger()中Want的entities属性取代 | -| REPLACE_BUNDLE | WantAgentFlags | 当前Want中的bundleName属性可被WantAgent.trigger()中Want的bundleName属性取代 | +| ONE_TIME_FLAG | 0 | WantAgent仅能使用一次。 | +| NO_BUILD_FLAG | 1 | 如果描述WantAgent对象不存在,则不创建它,直接返回null。 | +| CANCEL_PRESENT_FLAG | 2 | 在生成一个新的WantAgent对象前取消已存在的一个WantAgent对象。 | +| UPDATE_PRESENT_FLAG | 3 | 使用新的WantAgent的额外数据替换已存在的WantAgent中的额外数据。 | +| CONSTANT_FLAG | 4 | WantAgent是不可变的。 | +| REPLACE_ELEMENT | 5 | 当前Want中的element属性可被WantAgent.trigger()中Want的element属性取代 | +| REPLACE_ACTION | 6 | 当前Want中的action属性可被WantAgent.trigger()中Want的action属性取代 | +| REPLACE_URI | 7 | 当前Want中的uri属性可被WantAgent.trigger()中Want的uri属性取代 | +| REPLACE_ENTITIES | 8 | 当前Want中的entities属性可被WantAgent.trigger()中Want的entities属性取代 | +| REPLACE_BUNDLE | 9 | 当前Want中的bundleName属性可被WantAgent.trigger()中Want的bundleName属性取代 | @@ -1151,11 +1151,11 @@ try { | 名称 | 值 | 说明 | | ----------------- | ------------- | ------------------------- | -| UNKNOWN_TYPE | OperationType | 不识别的类型。 | -| START_ABILITY | OperationType | 开启一个有页面的Ability。 | -| START_ABILITIES | OperationType | 开启多个有页面的Ability。 | -| START_SERVICE | OperationType | 开启一个无页面的ability。 | -| SEND_COMMON_EVENT | OperationType | 发送一个公共事件。 | +| UNKNOWN_TYPE | 0 | 不识别的类型。 | +| START_ABILITY | 1 | 开启一个有页面的Ability。 | +| START_ABILITIES | 2 | 开启多个有页面的Ability。 | +| START_SERVICE | 3 | 开启一个无页面的ability。 | +| SEND_COMMON_EVENT | 4 | 发送一个公共事件。 | @@ -1163,13 +1163,13 @@ try { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| -------------- | --- | ---- | ------------------------------ | ---- | ---------------------- | -| info | 是 | 是 | WantAgent | 是 | 触发的wantAgent。 | -| want | 是 | 是 | Want | 是 | 存在的被触发的want。 | -| finalCode | 是 | 是 | number | 是 | 触发wantAgent的请求代码。| -| finalData | 是 | 是 | string | 否 | 公共事件收集的最终数据。 | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | +| 名称 | 类型 | 必填 | 说明 | +| -------------- | ------------------------------ | ---- | ---------------------- | +| info | WantAgent | 是 | 触发的wantAgent。 | +| want | Want | 是 | 存在的被触发的want。 | +| finalCode | number | 是 | 触发wantAgent的请求代码。| +| finalData | string | 否 | 公共事件收集的最终数据。 | +| extraInfo | {[key: string]: any} | 否 | 额外数据。 | @@ -1177,9 +1177,9 @@ try { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | -| ---------- | --- | ---- | -------------------- | ---- | ----------- | -| code | 是 | 是 | number | 是 | result code。 | -| want | 是 | 是 | Want | 否 | Want。 | -| permission | 是 | 是 | string | 否 | 权限定义。 | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | \ No newline at end of file +| 名称 | 类型 | 必填 | 说明 | +| ---------- | -------------------- | ---- | ----------- | +| code | number | 是 | result code。 | +| want | Want | 否 | Want。 | +| permission | string | 否 | 权限定义。 | +| extraInfo | {[key: string]: any} | 否 | 额外数据。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md index c95ea8a3194a68c4da94813170e1f6681832605b..603a0ce3a0a4c71da7e18e9cad23e61fe72a1972 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md @@ -33,8 +33,8 @@ want操作的常数。 | ACTION_DISMISS_TIMER | ohos.want.action.dismissTimer | 指示启动页面功能以关闭计时器的操作。 | | ACTION_SEND_SMS | ohos.want.action.sendSms | 指示启动发送sms的页面功能的操作。 | | ACTION_CHOOSE | ohos.want.action.choose | 指示启动页面功能以打开联系人或图片的操作。 | -| ACTION_IMAGE_CAPTURE8+ | ohos.want.action.imageCapture | 指示启动页面拍照功能的操作。 | -| ACTION_VIDEO_CAPTURE8+ | ohos.want.action.videoCapture | 指示启动页面功能以拍摄视频的操作。 | +| ACTION_IMAGE_CAPTURE | ohos.want.action.imageCapture | 指示启动页面拍照功能的操作。 | +| ACTION_VIDEO_CAPTURE | ohos.want.action.videoCapture | 指示启动页面功能以拍摄视频的操作。 | | ACTION_SELECT | ohos.want.action.select | 指示显示应用程序选择对话框的操作。 | | ACTION_SEND_DATA | ohos.want.action.sendData | 指示发送单个数据记录的操作。 | | ACTION_SEND_MULTIPLE_DATA | ohos.want.action.sendMultipleData | 指示发送多个数据记录的操作。 | @@ -43,17 +43,16 @@ want操作的常数。 | ACTION_EDIT_DATA | ohos.want.action.editData | 指示编辑数据的操作。 | | INTENT_PARAMS_INTENT | ability.want.params.INTENT | 指示用行为选择器来展示选择的操作。 | | INTENT_PARAMS_TITLE | ability.want.params.TITLE | 指示与行为选择器一起使用时的字符序列对话框标题。 | -| ACTION_FILE_SELECT7+ | ohos.action.fileSelect | 指示选择文件的操作。 | -| PARAMS_STREAM7+ | ability.params.stream | 指示发送数据时与目标关联的数据流的URI | -| ACTION_APP_ACCOUNT_OAUTH 8+ | ohos.account.appAccount.action.oauth | 指示提供oauth服务的操作。 | -| ACTION_APP_ACCOUNT_AUTH 9+ | account.appAccount.action.auth | 指示提供auth服务的操作。 | -| ACTION_MARKET_DOWNLOAD 9+ | ohos.want.action.marketDownload | 表示从应用程序市场下载应用程序的的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | -| ACTION_MARKET_CROWDTEST 9+ | ohos.want.action.marketCrowdTest | 指示从应用程序市场众测应用程序的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | -| DLP_PARAMS_SANDBOX9+ |ohos.dlp.params.sandbox | 指示沙盒标志的参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | -| DLP_PARAMS_BUNDLE_NAME9+ |ohos.dlp.params.bundleName |指示DLP包名称的参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | -| DLP_PARAMS_MODULE_NAME9+ |ohos.dlp.params.moduleName |指示DLP模块名称的参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | -| DLP_PARAMS_ABILITY_NAME9+ |ohos.dlp.params.abilityName |指示DLP能力名称的参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | -| DLP_PARAMS_INDEX9+ |ohos.dlp.params.index |指示DLP索引参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | +| ACTION_FILE_SELECT | ohos.action.fileSelect | 指示选择文件的操作。 | +| PARAMS_STREAM | ability.params.stream | 指示发送数据时与目标关联的数据流的URI | | +| ACTION_APP_ACCOUNT_AUTH | account.appAccount.action.auth | 指示提供auth服务的操作。 | +| ACTION_MARKET_DOWNLOAD | ohos.want.action.marketDownload | 表示从应用程序市场下载应用程序的的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | +| ACTION_MARKET_CROWDTEST | ohos.want.action.marketCrowdTest | 指示从应用程序市场众测应用程序的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | +| DLP_PARAMS_SANDBOX |ohos.dlp.params.sandbox | 指示沙盒标志的参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | +| DLP_PARAMS_BUNDLE_NAME |ohos.dlp.params.bundleName |指示DLP包名称的参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | +| DLP_PARAMS_MODULE_NAME |ohos.dlp.params.moduleName |指示DLP模块名称的参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | +| DLP_PARAMS_ABILITY_NAME |ohos.dlp.params.abilityName |指示DLP能力名称的参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | +| DLP_PARAMS_INDEX |ohos.dlp.params.index |指示DLP索引参数的操作。
**系统API**:该接口为系统接口,三方应用不支持调用。 | ## wantConstant.Entity diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-form-formbindingdata.md b/zh-cn/application-dev/reference/apis/js-apis-app-form-formbindingdata.md index f363af617eef010ab0061ec3c2e2d24f77ae3c22..b4fb8ec0721903bfd1593390c2e737b645ab6ae5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-form-formbindingdata.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-form-formbindingdata.md @@ -18,9 +18,9 @@ FormBindingData相关描述。 **系统能力**:SystemCapability.Ability.Form -| 名称 | 可读 | 可写 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -------- | -| data | 是 | 否 | Object | 是 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。| +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| data | Object | 是 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。| ## createFormBindingData @@ -35,7 +35,7 @@ createFormBindingData(obj?: Object | string): FormBindingData | 参数名 | 类型 | 必填 | 说明 | | ------ | -------------- | ---- | ------------------------------------------------------------ | -| obj | Object或string | 否 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。其中图片数据以"formImages"作为标识,内容为图片标识与图片文件描述符的键值对{"formImages": {"key1": fd1, "key2": fd2}} | +| obj | Object\|string | 否 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。其中图片数据以"formImages"作为标识,内容为图片标识与图片文件描述符的键值对{"formImages": {"key1": fd1, "key2": fd2}} | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-form-formextensionability.md b/zh-cn/application-dev/reference/apis/js-apis-app-form-formextensionability.md index dbc8583a880bbee9b370b7e6f0617fb04d4e2f5d..e5555f3e0c5977014e086499e0a501291f562d0b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-form-formextensionability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-form-formextensionability.md @@ -17,7 +17,7 @@ import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'; **系统能力**:SystemCapability.Ability.Form -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ------- | ------------------------------------------------------- | ---- | ---- | --------------------------------------------------- | | context | [FormExtensionContext](js-apis-inner-application-formExtensionContext.md) | 是 | 否 | FormExtensionAbility的上下文环境,继承自ExtensionContext。 | @@ -197,7 +197,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility { ## onConfigurationUpdate -onConfigurationUpdate(config: Configuration): void; +onConfigurationUpdate(newConfig: Configuration): void; 当系统配置更新时调用。 @@ -207,7 +207,7 @@ onConfigurationUpdate(config: Configuration): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| config | [Configuration](js-apis-configuration.md) | 是 | 表示需要更新的配置信息。 | +| newConfig | [Configuration](js-apis-configuration.md) | 是 | 表示需要更新的配置信息。 | **示例:** @@ -231,7 +231,7 @@ onAcquireFormState?(want: Want): formInfo.FormState; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | 否 | want表示获取卡片状态的描述。描述包括包名称、能力名称、模块名称、卡片名和卡片维度。 | +| want | [Want](js-apis-application-want.md) | 是 | want表示获取卡片状态的描述。描述包括包名称、能力名称、模块名称、卡片名和卡片维度。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-form-formhost.md b/zh-cn/application-dev/reference/apis/js-apis-app-form-formhost.md index aaa541da76d1d588589ee4e9b7b186cf3ad30e78..21017c8932f32ba3146f784026647c3c78945f87 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-form-formhost.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-form-formhost.md @@ -32,11 +32,10 @@ deleteForm(formId: string, callback: AsyncCallback<void>): void **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -81,11 +80,10 @@ deleteForm(formId: string): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **参数:** @@ -121,11 +119,10 @@ releaseForm(formId: string, callback: AsyncCallback<void>): void **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -162,11 +159,10 @@ releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback< **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -208,11 +204,10 @@ releaseForm(formId: string, isReleaseCache?: boolean): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -248,11 +243,10 @@ requestForm(formId: string, callback: AsyncCallback<void>): void **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -293,11 +287,10 @@ requestForm(formId: string): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -315,9 +308,9 @@ try { ``` -## castTempForm +## castToNormalForm -castTempForm(formId: string, callback: AsyncCallback<void>): void +castToNormalForm(formId: string, callback: AsyncCallback<void>): void 将指定的临时卡片转换为普通卡片。使用callback异步回调。 @@ -334,18 +327,17 @@ castTempForm(formId: string, callback: AsyncCallback<void>): void **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** ```ts try { var formId = "12400633174999288"; - formHost.castTempForm(formId, (error, data) => { + formHost.castToNormalForm(formId, (error, data) => { if (error) { console.log('formHost castTempForm, error:' + JSON.stringify(error)); } @@ -355,9 +347,9 @@ try { } ``` -## castTempForm +## castToNormalForm -castTempForm(formId: string): Promise<void> +castToNormalForm(formId: string): Promise<void> 将指定的临时卡片转换为普通卡片。使用Promise异步回调。 @@ -379,18 +371,17 @@ castTempForm(formId: string): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** ```ts try { var formId = "12400633174999288"; - formHost.castTempForm(formId).then(() => { + formHost.castToNormalForm(formId).then(() => { console.log('formHost castTempForm success'); }).catch((error) => { console.log('formHost castTempForm, error:' + JSON.stringify(error)); @@ -419,10 +410,10 @@ notifyVisibleForms(formIds: Array<string>, callback: AsyncCallback<void **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -463,10 +454,10 @@ notifyVisibleForms(formIds: Array<string>): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -502,10 +493,10 @@ notifyInvisibleForms(formIds: Array<string>, callback: AsyncCallback<vo **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -546,10 +537,10 @@ notifyInvisibleForms(formIds: Array<string>): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -585,11 +576,10 @@ enableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void& **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -630,11 +620,10 @@ enableFormsUpdate(formIds: Array<string>): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -670,11 +659,10 @@ disableFormsUpdate(formIds: Array<string>, callback: AsyncCallback<void **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -715,11 +703,10 @@ disableFormsUpdate(formIds: Array<string>): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -875,10 +862,10 @@ getFormsInfo(bundleName: string, callback: AsyncCallback<Array<formInfo.Fo **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -916,10 +903,10 @@ getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback< **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -962,10 +949,10 @@ getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<formI **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -1071,10 +1058,10 @@ acquireFormState(want: Want, callback: AsyncCallback<formInfo.FormStateInfo&g **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -1126,10 +1113,10 @@ acquireFormState(want: Want): Promise<formInfo.FormStateInfo> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -1223,10 +1210,10 @@ notifyFormsVisible(formIds: Array<string>, isVisible: boolean, callback: A **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -1268,10 +1255,10 @@ notifyFormsVisible(formIds: Array<string>, isVisible: boolean): Promise< **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -1308,10 +1295,10 @@ notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean, c **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -1353,10 +1340,10 @@ notifyFormsEnableUpdate(formIds: Array<string>, isEnableUpdate: boolean): **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -1378,7 +1365,7 @@ shareForm(formId: string, deviceId: string, callback: AsyncCallback<void>) 指定formId和远程设备Id进行卡片分享。使用callback异步回调。 -**需要权限**:ohos.permission.REQUIRE_FORM +**需要权限**:ohos.permission.REQUIRE_FORM 和 ohos.permission.DISTRIBUTED_DATASYNC **系统能力**:SystemCapability.Ability.Form @@ -1392,11 +1379,10 @@ shareForm(formId: string, deviceId: string, callback: AsyncCallback<void>) **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -1421,7 +1407,7 @@ shareForm(formId: string, deviceId: string): Promise<void> 指定formId和远程设备Id进行卡片分享。使用Promise异步回调。 -**需要权限**:ohos.permission.REQUIRE_FORM +**需要权限**:ohos.permission.REQUIRE_FORM 和 ohos.permission.DISTRIBUTED_DATASYNC **系统能力**:SystemCapability.Ability.Form @@ -1440,11 +1426,10 @@ shareForm(formId: string, deviceId: string): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **参数:** @@ -1464,7 +1449,7 @@ try { ## notifyFormsPrivacyProtected -notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback): void +notifyFormsPrivacyProtected(formIds: Array\, isProtected: boolean, callback: AsyncCallback\): void **需要权限**:ohos.permission.REQUIRE_FORM diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-form-forminfo.md b/zh-cn/application-dev/reference/apis/js-apis-app-form-forminfo.md index e6b41c61cc7c44846687c122a67b851582972bfc..b19dc03d379beae42c381f15353646f569559951 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-form-forminfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-form-forminfo.md @@ -18,26 +18,26 @@ import formInfo from '@ohos.app.form.formInfo'; **系统能力**:SystemCapability.Ability.Form -| 名称 | 可读 | 可写 | 类型 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ | -| bundleName | 是 | 否 | string | 卡片所属包的包名。 | -| moduleName | 是 | 否 | string | 卡片所属模块的模块名。 | -| abilityName | 是 | 否 | string | 卡片所属的Ability名称。 | -| name | 是 | 否 | string | 卡片名称。 | -| description | 是 | 否 | string | 卡片描述。 | -| type | 是 | 否 | [FormType](#formtype) | 卡片类型。当前支持JS卡片。 | -| jsComponentName | 是 | 否 | string | js卡片的组件名。 | -| colorMode | 是 | 否 | [ColorMode](#colormode) | 卡片颜色模式。 | -| isDefault | 是 | 否 | boolean | 卡片是否是默认卡片。 | -| updateEnabled | 是 | 否 | boolean | 卡片是否使能更新。 | -| formVisibleNotify | 是 | 否 | string | 卡片是否使能可见通知。 | -| relatedBundleName | 是 | 否 | string | 卡片所属的相关联包名。 | -| scheduledUpdateTime | 是 | 否 | string | 卡片更新时间。 | -| formConfigAbility | 是 | 否 | string | 卡片配置ability。指定长按卡片弹出的选择框内,编辑选项所对应的ability。 | -| updateDuration | 是 | 否 | string | 卡片更新周期。 | -| defaultDimension | 是 | 否 | number | 表示卡片规格 | -| supportDimensions | 是 | 否 | Array<number> | 卡片支持的规格。具体可选规格参考[FormDimension](#formdimension) | -| customizeData | 是 | 否 | {[key: string]: [value: string]} | 卡片用户数据。 | +| bundleName | string | 是 | 否 | 卡片所属包的包名。 | +| moduleName | string | 是 | 否 | 卡片所属模块的模块名。 | +| abilityName | string | 是 | 否 | 卡片所属的Ability名称。 | +| name | string | 是 | 否 | 卡片名称。 | +| description | string | 是 | 否 | 卡片描述。 | +| type | [FormType](#formtype) | 是 | 否 | 卡片类型。当前支持JS卡片。 | +| jsComponentName | string | 是 | 否 | js卡片的组件名。 | +| colorMode | [ColorMode](#colormode) | 是 | 否 | 卡片颜色模式。 | +| isDefault | boolean | 是 | 否 | 卡片是否是默认卡片。 | +| updateEnabled | boolean | 是 | 否 | 卡片是否使能更新。 | +| formVisibleNotify | string | 是 | 否 | 卡片是否使能可见通知。 | +| relatedBundleName | string | 是 | 否 | 卡片所属的相关联包名。 | +| scheduledUpdateTime | string | 是 | 否 | 卡片更新时间。 | +| formConfigAbility | string | 是 | 否 | 卡片配置ability。指定长按卡片弹出的选择框内,编辑选项所对应的ability。 | +| updateDuration | string | 是 | 否 | 卡片更新周期。 | +| defaultDimension | number | 是 | 否 | 表示卡片规格 | +| supportDimensions | Array<number> | 是 | 否 | 卡片支持的规格。具体可选规格参考[FormDimension](#formdimension) | +| customizeData | {[key: string]: [value: string]} | 是 | 否 | 卡片用户数据。 | ## FormType @@ -68,10 +68,10 @@ import formInfo from '@ohos.app.form.formInfo'; **系统能力**:SystemCapability.Ability.Form -| 名称 | 可读 | 可写 | 类型 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ | -| formState | 是 | 否 | [FormState](#formstate) | 卡片状态。 | -| want | 是 | 否 | Want | Want文本内容。 | +| formState | [FormState](#formstate) | 是 | 否 | 卡片状态。 | +| want | Want | 是 | 否 | Want文本内容。 | ## FormState @@ -93,7 +93,7 @@ import formInfo from '@ohos.app.form.formInfo'; | 名称 | 值 | 说明 | | ----------- | ---- | ------------ | -| IDENTITY_KEY | "ohos.extra.param.key.form_identity" | 卡片标识。
**系统接口**: 此接口为系统接口。 | +| IDENTITY_KEY | "ohos.extra.param.key.form_identity" | 卡片标识。 | | DIMENSION_KEY | "ohos.extra.param.key.form_dimension" | 卡片规格样式。 | | NAME_KEY | "ohos.extra.param.key.form_name" | 卡片名称。 | | MODULE_NAME_KEY | "ohos.extra.param.key.module_name" | 卡片所属模块名称。 | @@ -125,9 +125,9 @@ import formInfo from '@ohos.app.form.formInfo'; **系统能力**:SystemCapability.Ability.Form -| 名称 | 必选 | 说明 | -| ----------- | ---- | ------------ | -| moduleName | 否 | 仅保留moduleName与提供值相符的卡片信息。 | +| 名称 | 说明 | +| ----------- | ------------ | +| moduleName | 仅保留moduleName与提供值相符的卡片信息。 | ## VisibilityType @@ -137,5 +137,5 @@ import formInfo from '@ohos.app.form.formInfo'; | 名称 | 值 | 说明 | | ----------- | ---- | ------------ | -| FORM_VISIBLE | 否 | 表示卡片为可见。 | -| FORM_INVISIBLE | 否 | 表示卡片为不可见。 | \ No newline at end of file +| FORM_VISIBLE | 1 | 表示卡片为可见。 | +| FORM_INVISIBLE | 2 | 表示卡片为不可见。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-form-formprovider.md b/zh-cn/application-dev/reference/apis/js-apis-app-form-formprovider.md index ac9781806c9c763e443c10de1ec780eaa4b278da..8a3149afde470a52b5c7f6f9dd854a9c2dbbd3f2 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-app-form-formprovider.md +++ b/zh-cn/application-dev/reference/apis/js-apis-app-form-formprovider.md @@ -27,13 +27,12 @@ setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback&l | minute | number | 是 | 指定多久之后更新,单位分钟,大于等于5。 | | callback | AsyncCallback<void> | 是 | 回调函数。 | -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 +**错误码:** + | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501002 | The number of forms exceeds the upper bound. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -75,13 +74,10 @@ setFormNextRefreshTime(formId: string, minute: number): Promise<void> **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | -| 16501001 | The ID of the form to be operated does not exist. | -| 16501002 | The number of forms exceeds the upper bound. | -| 16501003 | The form can not be operated by the current application. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -111,15 +107,15 @@ updateForm(formId: string, formBindingData: formBindingData.FormBindingData,call | 参数名 | 类型 | 必填 | 说明 | | ------ | ---------------------------------------------------------------------- | ---- | ---------------- | | formId | string | 是 | 请求更新的卡片标识。 | -| formBindingData | [FormBindingData](js-apis-app-form-formbindingdata.md#formbindingdata) | 是 | 用于更新的数据。 | +| formBindingData.FormBindingData | [FormBindingData](js-apis-app-form-formbindingdata.md#formbindingdata) | 是 | 用于更新的数据。 | | callback | AsyncCallback<void> | 是 | 回调函数。 | **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -153,7 +149,7 @@ updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Pr | 参数名 | 类型 | 必填 | 说明 | | ------ | ---------------------------------------------------------------------- | ---- | ---------------- | | formId | string | 是 | 请求更新的卡片标识。 | -| formBindingData | [FormBindingData](js-apis-app-form-formbindingdata.md#formbindingdata) | 是 | 用于更新的数据。 | +| formBindingData.FormBindingData | [FormBindingData](js-apis-app-form-formbindingdata.md#formbindingdata) | 是 | 用于更新的数据。 | **返回值:** @@ -163,10 +159,10 @@ updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Pr **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16501001 | The ID of the form to be operated does not exist. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -201,10 +197,10 @@ getFormsInfo(callback: AsyncCallback<Array<formInfo.FormInfo>>): voi **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -239,10 +235,10 @@ getFormsInfo(filter: formInfo.FormInfoFilter, callback: AsyncCallback<Array&l **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -287,10 +283,10 @@ getFormsInfo(filter?: formInfo.FormInfoFilter): Promise<Array<formInfo.For **错误码:** -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 | 错误码ID | 错误信息 | | -------- | -------- | -| 16500100 | Failed to obtain configuration information. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -326,13 +322,15 @@ requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, | 参数名 | 类型 | 必填 | 说明 | | ------ | ---------------------------------------------------------------------- | ---- | ---------------- | | want | [Want](js-apis-application-want.md) | 是 | 发布请求。需包含以下字段。
abilityName: 目标卡片ability
parameters:
"ohos.extra.param.key.form_dimension"
"ohos.extra.param.key.form_name"
"ohos.extra.param.key.module_name" | -| formBindingData | [FormBindingData](js-apis-app-form-formbindingdata.md#formbindingdata) | 是 | 创建卡片的数据。 | +| formBindingData.FormBindingData | [FormBindingData](js-apis-app-form-formbindingdata.md#formbindingdata) | 是 | 创建卡片的数据。 | | callback | AsyncCallback<string> | 是 | 回调函数。返回卡片标识。 | -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 +**错误码:** + | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -377,10 +375,12 @@ requestPublishForm(want: Want, callback: AsyncCallback<string>): void | want | [Want](js-apis-application-want.md) | 是 | 发布请求。需包含以下字段。
abilityName: 目标卡片ability
parameters:
"ohos.extra.param.key.form_dimension"
"ohos.extra.param.key.form_name"
"ohos.extra.param.key.module_name" | | callback | AsyncCallback<string> | 是 | 回调函数。返回卡片标识。 | -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 +**错误码:** + | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** @@ -422,7 +422,7 @@ requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData | 参数名 | 类型 | 必填 | 说明 | | --------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | want | [Want](js-apis-application-want.md) | 是 | 发布请求。需包含以下字段。
abilityName: 目标卡片ability
parameters:
"ohos.extra.param.key.form_dimension"
"ohos.extra.param.key.form_name"
"ohos.extra.param.key.module_name" | -| formBindingData | [FormBindingData](js-apis-app-form-formbindingdata.md#formbindingdata) | 否 | 创建卡片的数据。 | +| formBindingData.FormBindingData | [FormBindingData](js-apis-app-form-formbindingdata.md#formbindingdata) | 否 | 创建卡片的数据。 | **返回值:** @@ -430,10 +430,12 @@ requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData | :------------ | :---------------------------------- | | Promise<string> | Promise对象。返回卡片标识。 | -以下错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 +**错误码:** + | 错误码ID | 错误信息 | | -------- | -------- | -| 16501000 | A functional error occurred. | +| 401 | If the input parameter is not valid parameter. | +以上错误码的详细介绍请参见[卡片错误码](../errorcodes/errorcode-form.md)。 **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-ability.md b/zh-cn/application-dev/reference/apis/js-apis-application-ability.md index 1d741d09b918bdd6b4f690044642f0ffd7c641ca..599bdfcc6c372882d0cd8816b26b9c3aea14ffda 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-ability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-ability.md @@ -22,7 +22,7 @@ import Ability from '@ohos.application.Ability'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.AbilityCore -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | context | [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md) | 是 | 否 | 上下文。 | | launchWant | [Want](js-apis-app-ability-want.md) | 是 | 否 | Ability启动时的参数。 | @@ -341,7 +341,7 @@ call(method: string, data: rpc.Sequenceable): Promise<void>; **示例:** ```ts - import Ability from '@ohos.app.ability.UIAbility'; + import Ability from '@ohos.application.Ability'; class MyMessageAble{ // 自定义的Sequenceable数据结构 name:"" str:"" @@ -425,7 +425,7 @@ callWithResult(method: string, data: rpc.Sequenceable): Promise<rpc.MessagePa **示例:** ```ts - import Ability from '@ohos.app.ability.UIAbility'; + import Ability from '@ohos.application.Ability'; class MyMessageAble{ name:"" str:"" @@ -497,7 +497,7 @@ release(): void; **示例:** ```ts - import Ability from '@ohos.app.ability.UIAbility'; + import Ability from '@ohos.application.Ability'; var caller; export default class MainAbility extends Ability { onWindowStageCreate(windowStage) { @@ -521,10 +521,9 @@ release(): void; } ``` +## Caller.onRelease -## Caller.on - - on(type: "release", callback: OnReleaseCallback): void; + onRelease(callback: OnReleaseCallBack): void; 注册通用组件服务端Stub(桩)断开监听通知。 @@ -534,21 +533,12 @@ release(): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | type | string | 是 | 监听releaseCall事件,固定为'release'。 | | callback | OnReleaseCallBack | 是 | 返回onRelease回调结果。 | -**错误码:** - -| 错误码ID | 错误信息 | -| ------- | -------------------------------- | -| 401 | Invalid input parameter. | -| 16200001 | Caller released. The caller has been released. | -| 16000050 | Internal Error. | - **示例:** ```ts - import Ability from '@ohos.app.ability.UIAbility'; + import Ability from '@ohos.application.Ability'; var caller; export default class MainAbility extends Ability { onWindowStageCreate(windowStage) { @@ -559,7 +549,7 @@ release(): void; }).then((obj) => { caller = obj; try { - caller.on("release", (str) => { + caller.onRelease((str) => { console.log(' Caller OnRelease CallBack is called ' + str); }); } catch (error) { @@ -605,7 +595,7 @@ on(method: string, callback: CalleeCallBack): void; **示例:** ```ts - import Ability from '@ohos.app.ability.UIAbility'; + import Ability from '@ohos.application.Ability'; class MyMessageAble{ name:"" str:"" @@ -673,7 +663,7 @@ off(method: string): void; **示例:** ```ts - import Ability from '@ohos.app.ability.UIAbility'; + import Ability from '@ohos.application.Ability'; var method = 'call_Function'; export default class MainAbility extends Ability { onCreate(want, launchParam) { @@ -687,23 +677,23 @@ off(method: string): void; } } ``` - -## OnReleaseCallback + +## OnReleaseCallBack (msg: string): void; **系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | (msg: string) | function | 是 | 否 | 调用者注册的侦听器函数接口的原型。 | -## CalleeCallback +## CalleeCallBack (indata: rpc.MessageParcel): rpc.Sequenceable; **系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | (indata: rpc.MessageParcel) | rpc.Sequenceable | 是 | 否 | 被调用方注册的消息侦听器函数接口的原型。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-abilityConstant.md b/zh-cn/application-dev/reference/apis/js-apis-application-abilityConstant.md index 163a0b0495c058fa7f1dc2b72093433df006d609..cee27c5054fa6cf05511fa668f25f376bf2fbed1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-abilityConstant.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-abilityConstant.md @@ -70,7 +70,7 @@ import AbilityConstant from '@ohos.application.AbilityConstant'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 取值 | 说明 | +| 名称 | 值 | 说明 | | --- | --- | --- | | WINDOW_MODE_UNDEFINED | 0 | 未定义窗口模式。 | | WINDOW_MODE_FULLSCREEN | 1 | 全屏模式。 | @@ -84,7 +84,7 @@ import AbilityConstant from '@ohos.application.AbilityConstant'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 取值 | 说明 | +| 名称 | 值 | 说明 | | --- | --- | --- | | MEMORY_LEVEL_MODERATE | 0 | 内存占用适中。 | | MEMORY_LEVEL_LOW | 1 | 内存占用低。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-abilityManager.md b/zh-cn/application-dev/reference/apis/js-apis-application-abilityManager.md index 0128d821ce6030d7d6bb4443298228d1918305ea..18509a193c3c0836190c2c595b9e0ba96ddb7fa4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-abilityManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-abilityManager.md @@ -41,7 +41,7 @@ updateConfiguration(config: Configuration, callback: AsyncCallback\): void **参数**: -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | --------- | ---------------------------------------- | ---- | -------------- | | config | [Configuration](js-apis-application-configuration.md) | 是 | 新的配置项。 | | callback | AsyncCallback\ | 是 | 被指定的回调方法。 | @@ -72,7 +72,7 @@ updateConfiguration(config: Configuration): Promise\ **参数**: -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | --------- | ---------------------------------------- | ---- | -------------- | | config | [Configuration](js-apis-application-configuration.md) | 是 | 新的配置项。 | @@ -110,7 +110,7 @@ getAbilityRunningInfos(callback: AsyncCallback\>): vo **参数**: -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | --------- | ---------------------------------------- | ---- | -------------- | | callback | AsyncCallback\> | 是 | 被指定的回调方法。 | @@ -164,7 +164,7 @@ getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\> | 是 | 被指定的回调方法。 | @@ -193,7 +193,7 @@ getExtensionRunningInfos(upperLimit: number): Promise\): void; **参数**: -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | --------- | ---------------------------------------- | ---- | -------------- | | callback | AsyncCallback\ | 是 | 被指定的回调方法。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-appManager.md b/zh-cn/application-dev/reference/apis/js-apis-application-appManager.md index 5bb8c2a7075be12ed6a39ad52065324f8ad88ca3..31360a8b4f2135f41b0429224fc3c372bae6a88a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-appManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-appManager.md @@ -4,7 +4,7 @@ appManager模块提供App管理的能力,包括查询当前是否处于稳定 > **说明:** > -> 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> 本模块首批接口从API version 7 开始支持,从API version 9废弃,替换模块为[@ohos.app.ability.appManager](js-apis-app-ability-appManager.md)。后续版本的新增接口,采用上角标单独标记接口的起始版本。 ## 导入模块 @@ -24,7 +24,7 @@ static isRunningInStabilityTest(callback: AsyncCallback<boolean>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<boolean> | 否 | 返回当前是否处于稳定性测试场景。 | + | callback | AsyncCallback<boolean> | 是 | 返回当前是否处于稳定性测试场景。 | **示例:** @@ -98,7 +98,7 @@ isRamConstrainedDevice(callback: AsyncCallback\): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<boolean> | 否 | 返回当前是否是ram受限设备。 | + | callback | AsyncCallback<boolean> | 是 | 返回当前是否是ram受限设备。 | **示例:** @@ -145,7 +145,7 @@ getAppMemorySize(callback: AsyncCallback\): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<number> | 否 | 应用程序内存大小。 | + | callback | AsyncCallback<number> | 是 | 应用程序内存大小。 | **示例:** @@ -199,7 +199,7 @@ getProcessRunningInfos(callback: AsyncCallback\>): vo | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\> | 否 | 获取有关运行进程的信息。 | +| callback | AsyncCallback\> | 是 | 获取有关运行进程的信息。 | **示例:** @@ -250,7 +250,7 @@ getProcessRunningInformation(callback: AsyncCallback\> | 否 | 获取有关运行进程的信息。 | +| callback | AsyncCallback\> | 是 | 获取有关运行进程的信息。 | **示例:** @@ -277,7 +277,7 @@ registerApplicationStateObserver(observer: ApplicationStateObserver): number; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observer | [ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md) | 否 | 返回观察者的数字代码。 | +| observer | [ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md) | 是 | 返回观察者的数字代码。 | **示例:** @@ -319,8 +319,8 @@ registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameL | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observer | [ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md) | 否 | 返回观察者的数字代码。 | -| bundleNameList | Array | 否 | 表示需要注册监听的bundleName数组。最大值128。 | +| observer | [ApplicationStateObserver](js-apis-inner-application-applicationStateObserver.md) | 是 | 返回观察者的数字代码。 | +| bundleNameList | Array | 是 | 表示需要注册监听的bundleName数组。最大值128。 | **示例:** @@ -362,8 +362,8 @@ unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback\ | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observerId | number | 否 | 表示观察者的编号代码。 | -| callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | +| observerId | number | 是 | 表示观察者的编号代码。 | +| callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | **示例:** @@ -394,7 +394,7 @@ unregisterApplicationStateObserver(observerId: number): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observerId | number | 否 | 表示观察者的编号代码。 | +| observerId | number | 是 | 表示观察者的编号代码。 | **返回值:** @@ -432,7 +432,7 @@ getForegroundApplications(callback: AsyncCallback\>): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | AsyncCallback\> | 否 | 表示应用的状态数据。 | +| callback | AsyncCallback\> | 是 | 表示应用的状态数据。 | **示例:** @@ -562,8 +562,8 @@ killProcessesByBundleName(bundleName: string, callback: AsyncCallback\); | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| bundleName | string | 否 | 表示包名。 | -| callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | +| bundleName | string | 是 | 表示包名。 | +| callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | **示例:** @@ -595,7 +595,7 @@ killProcessesByBundleName(bundleName: string): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| bundleName | string | 否 | 表示包名。 | +| bundleName | string | 是 | 表示包名。 | **返回值:** @@ -632,8 +632,8 @@ clearUpApplicationData(bundleName: string, callback: AsyncCallback\); | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| bundleName | string | 否 | 表示包名。 | -| callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | +| bundleName | string | 是 | 表示包名。 | +| callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | **示例:** @@ -665,7 +665,7 @@ clearUpApplicationData(bundleName: string): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| bundleName | string | 否 | 表示包名。 | +| bundleName | string | 是 | 表示包名。 | **返回值:** @@ -686,213 +686,13 @@ clearUpApplicationData(bundleName: string): Promise\; }) ``` -## ApplicationStateObserver.onForegroundApplicationChanged8+ - -onForegroundApplicationChanged(appStateData: AppStateData): void; - -将在前台或后台应用程序更改时调用。 - -**系统能力**:SystemCapability.Ability.AbilityRuntime.Core - -**系统API**:该接口为系统接口,三方应用不支持调用。 - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| appStateData | [AppStateData](js-apis-inner-application-appStateData.md) | 否 | 状态更改的应用程序信息。 | - -**示例:** - -```ts -var applicationStateObserver = { - onForegroundApplicationChanged(appStateData) { - console.log('------------ onForegroundApplicationChanged -----------', appStateData); - }, - onAbilityStateChanged(abilityStateData) { - console.log('------------ onAbilityStateChanged -----------', abilityStateData); - }, - onProcessCreated(processData) { - console.log('------------ onProcessCreated -----------', processData); - }, - onProcessDied(processData) { - console.log('------------ onProcessDied -----------', processData); - }, - onProcessStateChanged(processData) { - console.log('------------ onProcessStateChanged -----------', processData); - } -} -const observerCode = app.registerApplicationStateObserver(applicationStateObserver); -console.log('-------- observerCode: ---------', observerCode); -``` - -## ApplicationStateObserver.onAbilityStateChanged8+ - -onAbilityStateChanged(abilityStateData: AbilityStateData): void; - -将在能力状态更改时调用。 - -**系统能力**:SystemCapability.Ability.AbilityRuntime.Core - -**系统API**:该接口为系统接口,三方应用不支持调用。 - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| abilityStateData | [AbilityStateData](js-apis-inner-application-abilityStateData.md) | 否 | 状态更改的能力信息。 | - -**示例:** - -```ts -var applicationStateObserver = { - onForegroundApplicationChanged(appStateData) { - console.log('------------ onForegroundApplicationChanged -----------', appStateData); - }, - onAbilityStateChanged(abilityStateData) { - console.log('------------ onAbilityStateChanged -----------', abilityStateData); - }, - onProcessCreated(processData) { - console.log('------------ onProcessCreated -----------', processData); - }, - onProcessDied(processData) { - console.log('------------ onProcessDied -----------', processData); - }, - onProcessStateChanged(processData) { - console.log('------------ onProcessStateChanged -----------', processData); - } -} -const observerCode = app.registerApplicationStateObserver(applicationStateObserver); -console.log('-------- observerCode: ---------', observerCode); -``` - -## ApplicationStateObserver.onProcessCreated8+ - -onProcessCreated(processData: ProcessData): void; - -将在创建进程时调用。 - -**系统能力**:SystemCapability.Ability.AbilityRuntime.Core - -**系统API**:该接口为系统接口,三方应用不支持调用。 - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| processData | [ProcessData](js-apis-inner-application-processData.md) | 否 | 进程信息。 | - -**示例:** - -```ts -var applicationStateObserver = { - onForegroundApplicationChanged(appStateData) { - console.log('------------ onForegroundApplicationChanged -----------', appStateData); - }, - onAbilityStateChanged(abilityStateData) { - console.log('------------ onAbilityStateChanged -----------', abilityStateData); - }, - onProcessCreated(processData) { - console.log('------------ onProcessCreated -----------', processData); - }, - onProcessDied(processData) { - console.log('------------ onProcessDied -----------', processData); - }, - onProcessStateChanged(processData) { - console.log('------------ onProcessStateChanged -----------', processData); - } -} -const observerCode = app.registerApplicationStateObserver(applicationStateObserver); -console.log('-------- observerCode: ---------', observerCode); -``` - -## ApplicationStateObserver.onProcessDied8+ - -onProcessDied(processData: ProcessData): void; - -将在进程终止时调用。 - -**系统能力**:SystemCapability.Ability.AbilityRuntime.Core - -**系统API**:该接口为系统接口,三方应用不支持调用。 - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| processData | [ProcessData](js-apis-inner-application-processData.md) | 否 | 进程信息。 | - -**示例:** - -```ts -var applicationStateObserver = { - onForegroundApplicationChanged(appStateData) { - console.log('------------ onForegroundApplicationChanged -----------', appStateData); - }, - onAbilityStateChanged(abilityStateData) { - console.log('------------ onAbilityStateChanged -----------', abilityStateData); - }, - onProcessCreated(processData) { - console.log('------------ onProcessCreated -----------', processData); - }, - onProcessDied(processData) { - console.log('------------ onProcessDied -----------', processData); - }, - onProcessStateChanged(processData) { - console.log('------------ onProcessStateChanged -----------', processData); - } -} -const observerCode = app.registerApplicationStateObserver(applicationStateObserver); -console.log('-------- observerCode: ---------', observerCode); -``` - -## ApplicationStateObserver.onProcessStateChanged9+ - - onProcessStateChanged(processData: ProcessData): void; - -当进程状态更改时调用。 - -**系统能力**:SystemCapability.Ability.AbilityRuntime.Core - -**系统API**:该接口为系统接口,三方应用不支持调用。 - -**参数:** - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| processData | [ProcessData](js-apis-inner-application-processData.md) | 否 | 进程信息。 | - -**示例:** - -```ts -var applicationStateObserver = { - onForegroundApplicationChanged(appStateData) { - console.log('------------ onForegroundApplicationChanged -----------', appStateData); - }, - onAbilityStateChanged(abilityStateData) { - console.log('------------ onAbilityStateChanged -----------', abilityStateData); - }, - onProcessCreated(processData) { - console.log('------------ onProcessCreated -----------', processData); - }, - onProcessDied(processData) { - console.log('------------ onProcessDied -----------', processData); - }, - onProcessStateChanged(processData) { - console.log('------------ onProcessStateChanged -----------', processData); - } -} -const observerCode = app.registerApplicationStateObserver(applicationStateObserver); -console.log('-------- observerCode: ---------', observerCode); -``` - ## ApplicationState9+ **系统能力**:SystemCapability.Ability.AbilityRuntime.Core **系统API**: 此接口为系统接口,三方应用不支持调用。 -| 名称 | 值 | 描述 | +| 名称 | 值 | 说明 | | -------------------- | --- | --------------------------------- | | STATE_CREATE | 1 | 当应用在创建中的时候处于的状态。 | | STATE_FOREGROUND | 2 | 当应用切换到前台的时候处于的状态。 | @@ -906,7 +706,7 @@ console.log('-------- observerCode: ---------', observerCode); **系统API**: 此接口为系统接口,三方应用不支持调用。 -| 名称 | 值 | 描述 | +| 名称 | 值 | 说明 | | -------------------- | --- | --------------------------------- | | STATE_CREATE | 1 | 当进程在创建中的时候处于的状态。 | | STATE_FOREGROUND | 2 | 当进程切换到前台的时候处于的状态。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-configuration.md b/zh-cn/application-dev/reference/apis/js-apis-application-configuration.md index d6fd7f7c4e2c367c1679e9e8350423fdc03a0f82..200f8fda9e41c77d910415c8b85b89b6e34b678d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-configuration.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-configuration.md @@ -2,9 +2,16 @@ 定义环境变化信息。 -**说明:** +> **说明:** +> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块从API version 9废弃,替换模块为[@ohos.application.Configuration (Configuration)](js-apis-app-ability-configuration.md) +## 导入模块 + +```ts +import Configuration from '@ohos.application.Configuration' +``` + **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase | 名称 | 类型 | 可读 | 可写 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-errorManager.md b/zh-cn/application-dev/reference/apis/js-apis-application-errorManager.md index 7a6808787ecf9fe783a1f1aa73b75e9a0a0ee540..07fec114eb304e896db830f0bedfc1a59e3fb80d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-errorManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-errorManager.md @@ -23,7 +23,7 @@ registerErrorObserver(observer: ErrorObserver): number; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observer | [ErrorObserver](js-apis-inner-application-errorObserver.md) | 否 | 返回观察者的数字代码。 | +| observer | [ErrorObserver](js-apis-inner-application-errorObserver.md) | 是 | 返回观察者的数字代码。 | **示例:** @@ -48,8 +48,8 @@ unregisterErrorObserver(observerId: number, callback: AsyncCallback\): vo | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observerId | number | 否 | 返回观察者的数字代码。 | -| callback | AsyncCallback\ | 否 | 表示指定的回调方法。 | +| observerId | number | 是 | 返回观察者的数字代码。 | +| callback | AsyncCallback\ | 是 | 表示指定的回调方法。 | **示例:** @@ -77,7 +77,7 @@ unregisterErrorObserver(observerId: number): Promise\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| observerId | number | 否 | 返回观察者的数字代码。 | +| observerId | number | 是 | 返回观察者的数字代码。 | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-extensionAbility.md b/zh-cn/application-dev/reference/apis/js-apis-application-extensionAbility.md index fee97bca7c5679c2c4b5a32cd49b70fbc3aa264a..f0ded5d8c559fe46e8a2b1aaf1f1c2882a277e4e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-extensionAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-extensionAbility.md @@ -15,17 +15,17 @@ import ExtensionAbility from '@ohos.application.ExtensionAbility'; ## ExtensionAbility.onConfigurationUpdated -onConfigurationUpdated(config: Configuration): void; +onConfigurationUpdated(newConfig: Configuration): void; 当系统配置更新时调用。 -**系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | config | [Configuration](js-apis-application-configuration.md) | 是 | 表示需要更新的配置信息。 | + | newConfig | [Configuration](js-apis-application-configuration.md) | 是 | 表示需要更新的配置信息。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-formBindingData.md b/zh-cn/application-dev/reference/apis/js-apis-application-formBindingData.md index 74a007cb2c4f6792b1e6a46cd4c188e6116780a7..cecc7bacab564555893f5468c239260887202391 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-formBindingData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-formBindingData.md @@ -18,9 +18,9 @@ FormBindingData相关描述。 **系统能力**:SystemCapability.Ability.Form -| 名称 | 可读 | 可写 | 参数类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -------- | -| data | 是 | 否 | Object | 是 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。| +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| data | Object | 是 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。| ## createFormBindingData @@ -35,7 +35,7 @@ createFormBindingData(obj?: Object | string): FormBindingData | 参数名 | 类型 | 必填 | 说明 | | ------ | -------------- | ---- | ------------------------------------------------------------ | -| obj | Object或string | 否 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。其中图片数据以"formImages"作为标识,内容为图片标识与图片文件描述符的键值对{"formImages": {"key1": fd1, "key2": fd2}} | +| obj | Object\|string | 否 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。其中图片数据以"formImages"作为标识,内容为图片标识与图片文件描述符的键值对{"formImages": {"key1": fd1, "key2": fd2}} | **返回值:** @@ -60,4 +60,4 @@ context.getOrCreateLocalDir((err,data)=>{ }; let formBindingDataObj = formBindingData.createFormBindingData(obj); }) -``` \ No newline at end of file +``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-formExtension.md b/zh-cn/application-dev/reference/apis/js-apis-application-formExtension.md index c9ccaa7b4fb3241ecff11f43ffcecbed9fecc0e3..a3de47ace0238979eb91999bfe67b377f8ee5099 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-formExtension.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-formExtension.md @@ -232,7 +232,7 @@ onAcquireFormState?(want: Want): formInfo.FormState; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| want | [Want](js-apis-application-want.md) | 否 | want表示获取卡片状态的描述。描述包括包名称、能力名称、模块名称、卡片名和卡片维度。 | +| want | [Want](js-apis-application-want.md) | 是 | want表示获取卡片状态的描述。描述包括包名称、能力名称、模块名称、卡片名和卡片维度。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-formHost.md b/zh-cn/application-dev/reference/apis/js-apis-application-formHost.md index 48cc6d2e596c94bac98b5065a4307a2c30d7af83..ad32683220ce9a8907999a9a4358ef51797f2d1b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-formHost.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-formHost.md @@ -1112,7 +1112,7 @@ formHost.shareForm(formId, deviceId).then(() => { ## notifyFormsPrivacyProtected9+ -notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback): void +notifyFormsPrivacyProtected(formIds: Array\, isProtected: boolean, callback: AsyncCallback\): void **需要权限**:ohos.permission.REQUIRE_FORM diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-formInfo.md b/zh-cn/application-dev/reference/apis/js-apis-application-formInfo.md index 6c069cec5b4df3dc3212a16f7bc86e93d3c9f17a..0b470aaacbd4ceb3b078b69947865bdd93db009c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-formInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-formInfo.md @@ -19,26 +19,26 @@ import formInfo from '@ohos.application.formInfo'; **系统能力**:SystemCapability.Ability.Form -| 名称 | 可读 | 可写 | 类型 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------- |-------- | -------------------- | ------------------------------------------------------------ | -| bundleName | 是 | 否 | string | 表示卡片所属包的包名。 | -| moduleName | 是 | 否 | string | 表示卡片所属模块的模块名。 | -| abilityName | 是 | 否 | string | 表示卡片所属的Ability名称。 | -| name | 是 | 否 | string | 表示卡片名称。 | -| description | 是 | 否 | string | 表示卡片描述。 | -| type | 是 | 否 | [FormType](#formtype) | 表示卡片类型,当前支持JS卡片。 | -| jsComponentName | 是 | 否 | string | 表示js卡片的组件名。 | -| colorMode | 是 | 否 | [ColorMode](#colormode) | 表示卡片颜色模式。 | -| isDefault | 是 | 否 | boolean | 表示是否是默认卡片。 | -| updateEnabled | 是 | 否 | boolean | 表示卡片是否使能更新。 | -| formVisibleNotify | 是 | 否 | string | 表示卡片是否使能可见通知。 | -| relatedBundleName | 是 | 否 | string | 表示卡片所属的相关联包名。 | -| scheduledUpdateTime | 是 | 否 | string | 表示卡片更新时间。 | -| formConfigAbility | 是 | 否 | string | 表示卡片配置ability。 | -| updateDuration | 是 | 否 | string | 表示卡片更新周期。 | -| defaultDimension | 是 | 否 | number | 表示卡片规格 | -| supportDimensions | 是 | 否 | Array<number> | 表示卡片支持的规格。 | -| customizeData | 是 | 否 | {[key: string]: [value: string]} | 表示卡片用户数据。 | +| bundleName | string | 是 | 否 | 表示卡片所属包的包名。 | +| moduleName | string | 是 | 否 | 表示卡片所属模块的模块名。 | +| abilityName | string | 是 | 否 | 表示卡片所属的Ability名称。 | +| name | string | 是 | 否 | 表示卡片名称。 | +| description | string | 是 | 否 | 表示卡片描述。 | +| type | [FormType](#formtype) | 是 | 否 | 表示卡片类型,当前支持JS卡片。 | +| jsComponentName | string | 是 | 否 | 表示js卡片的组件名。 | +| colorMode | [ColorMode](#colormode) | 是 | 否 | 表示卡片颜色模式。 | +| isDefault | boolean | 是 | 否 | 表示是否是默认卡片。 | +| updateEnabled | boolean | 是 | 否 | 表示卡片是否使能更新。 | +| formVisibleNotify | string | 是 | 否 | 表示卡片是否使能可见通知。 | +| relatedBundleName | string | 是 | 否 | 表示卡片所属的相关联包名。 | +| scheduledUpdateTime | string | 是 | 否 | 表示卡片更新时间。 | +| formConfigAbility | string | 是 | 否 | 表示卡片配置ability。 | +| updateDuration | string | 是 | 否 | 表示卡片更新周期。 | +| defaultDimension | number | 是 | 否 | 表示卡片规格 | +| supportDimensions | Array<number> | 是 | 否 | 表示卡片支持的规格。 | +| customizeData | {[key: string]: [value: string]} | 是 | 否 | 表示卡片用户数据。 | ## FormType @@ -49,7 +49,7 @@ import formInfo from '@ohos.application.formInfo'; | 名称 | 值 | 说明 | | ----------- | ---- | ------------ | | JS | 1 | 卡片类型为JS。 | -| eTS | 2 | 卡片类型为eTS。 | +| eTS9+ | 2 | 卡片类型为eTS。 | ## ColorMode @@ -69,10 +69,10 @@ import formInfo from '@ohos.application.formInfo'; **系统能力**:SystemCapability.Ability.Form -| 名称 | 可读 | 可写 | 类型 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | -------- |-------- | -------------------- | ------------------------------------------------------------ | -| formState | 是 | 否 | [FormState](#formstate) | 表示卡片状态。 | -| want | 是 | 否 | Want | Want文本内容。 | +| formState | [FormState](#formstate) | 是 | 否 | 表示卡片状态。 | +| want | Want | 是 | 否 | Want文本内容。 | ## FormState @@ -105,7 +105,7 @@ import formInfo from '@ohos.application.formInfo'; | DEVICE_ID_KEY9+ | "ohos.extra.param.key.device_id" | 设备标识。
**系统接口**: 此接口为系统接口。 | | BUNDLE_NAME_KEY9+ | "ohos.extra.param.key.bundle_name" | 指示指定要获取的捆绑包名称的键。| -## FormDimension +## FormDimension9+ 定义卡片尺寸枚举。 @@ -113,11 +113,11 @@ import formInfo from '@ohos.application.formInfo'; | 名称 | 值 | 说明 | | ----------- | ---- | ------------ | -| Dimension_1_29+ | 1 | 1 x 2 form。 | -| Dimension_2_29+ | 2 | 2 x 2 form。 | -| Dimension_2_49+ | 3 | 2 x 4 form。 | -| Dimension_4_49+ | 4 | 4 x 4 form。 | -| Dimension_2_19+ | 5 | 2 x 1 form。 | +| Dimension_1_2 9+ | 1 | 1 x 2 form。 | +| Dimension_2_2 9+ | 2 | 2 x 2 form。 | +| Dimension_2_4 9+ | 3 | 2 x 4 form。 | +| Dimension_4_4 9+ | 4 | 4 x 4 form。 | +| Dimension_2_1 9+ | 5 | 2 x 1 form。 | ## VisibilityType @@ -127,8 +127,8 @@ import formInfo from '@ohos.application.formInfo'; | 名称 | 值 | 说明 | | ----------- | ---- | ------------ | -| FORM_VISIBLE | 1 | 卡片状态为可见。 | -| FORM_INVISIBLE | 2 | 卡片状态为不可见。 | +| FORM_VISIBLE9+ | 1 | 卡片状态为可见。 | +| FORM_INVISIBLE9+ | 2 | 卡片状态为不可见。 | ## FormInfoFilter9+ @@ -136,9 +136,9 @@ import formInfo from '@ohos.application.formInfo'; **系统能力**:SystemCapability.Ability.Form -| 名称 | 必选 | 说明 | -| ----------- | ---- | ------------ | -| moduleName9+ | 否 | 仅保留moduleName与提供值相符的卡片信息。 | +| 名称 | 说明 | +| ----------- | ------------ | +| moduleName9+ | 仅保留moduleName与提供值相符的卡片信息。 | ## VisibilityType9+ @@ -148,5 +148,5 @@ import formInfo from '@ohos.application.formInfo'; | 名称 | 值 | 说明 | | ----------- | ---- | ------------ | -| FORM_VISIBLE9+ | 否 | 表示卡片为可见。 | -| FORM_INVISIBLE9+ | 否 | 表示卡片为不可见。 | \ No newline at end of file +| FORM_VISIBLE9+ | 1 | 表示卡片为可见。 | +| FORM_INVISIBLE9+ | 2 | 表示卡片为不可见。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-formProvider.md b/zh-cn/application-dev/reference/apis/js-apis-application-formProvider.md index 2d145696b917198acdc11e47ce5bbb09862380f6..4f03e1d20ccc51fd83385a2fb4c15700e4c28430 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-formProvider.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-formProvider.md @@ -84,7 +84,7 @@ updateForm(formId: string, formBindingData: formBindingData.FormBindingData,call | 参数名 | 类型 | 必填 | 说明 | | ------ | ---------------------------------------------------------------------- | ---- | ---------------- | | formId | string | 是 | 请求更新的卡片标识。 | - | formBindingData | [FormBindingData](js-apis-application-formBindingData.md#formbindingdata) | 是 | 用于更新的数据。 | + | formBindingData.FormBindingData | [FormBindingData](js-apis-application-formBindingData.md#formbindingdata) | 是 | 用于更新的数据。 | | callback | AsyncCallback<void> | 是 | 回调函数。 | **示例:** @@ -113,7 +113,7 @@ updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Pr | 参数名 | 类型 | 必填 | 说明 | | ------ | ---------------------------------------------------------------------- | ---- | ---------------- | | formId | string | 是 | 请求更新的卡片标识。 | - | formBindingData | [FormBindingData](js-apis-application-formBindingData.md#formbindingdata) | 是 | 用于更新的数据。 | + | formBindingData.FormBindingData | [FormBindingData](js-apis-application-formBindingData.md#formbindingdat) | 是 | 用于更新的数据。 | **返回值:** @@ -241,7 +241,7 @@ requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, | 参数名 | 类型 | 必填 | 说明 | | ------ | ---------------------------------------------------------------------- | ---- | ---------------- | | want | [Want](js-apis-application-want.md) | 是 | 发布请求。需包含以下字段。
abilityName: 目标卡片ability
parameters:
"ohos.extra.param.key.form_dimension"
"ohos.extra.param.key.form_name"
"ohos.extra.param.key.module_name" | -| formBindingData | [FormBindingData](js-apis-application-formBindingData.md#formbindingdata) | 是 | 创建卡片的数据。 | +| formBindingData.FormBindingData | [FormBindingData](js-apis-application-formBindingData.md#formbindingdata) | 是 | 创建卡片的数据。 | | callback | AsyncCallback<string> | 是 | 回调函数。返回卡片标识。 | **示例:** @@ -318,7 +318,7 @@ requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData | 参数名 | 类型 | 必填 | 说明 | | --------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | want | [Want](js-apis-application-want.md) | 是 | 发布请求。需包含以下字段。
abilityName: 目标卡片ability
parameters:
"ohos.extra.param.key.form_dimension"
"ohos.extra.param.key.form_name"
"ohos.extra.param.key.module_name" | -| formBindingData | [FormBindingData](js-apis-application-formBindingData.md#formbindingdata) | 否 | 创建卡片的数据。 | +| formBindingData.FormBindingData | [FormBindingData](js-apis-application-formBindingData.md#formbindingdata) | 否 | 创建卡片的数据。 | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-serviceExtensionAbility.md b/zh-cn/application-dev/reference/apis/js-apis-application-serviceExtensionAbility.md index 5d4d89bd0dbca0feef693febb5fa250ad20c1986..2dd73056585223bd78fc684797d31fec79e7ac6e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-serviceExtensionAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-serviceExtensionAbility.md @@ -23,7 +23,7 @@ import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'; **系统API**: 此接口为系统接口,三方应用不支持调用。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | context | [ServiceExtensionContext](js-apis-inner-application-serviceExtensionContext.md) | 是 | 否 | ServiceExtension的上下文环境,继承自ExtensionContext。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-startOptions.md b/zh-cn/application-dev/reference/apis/js-apis-application-startOptions.md index 32c6d82a3537c5cc045d80a850b503149942ab0e..4582decb2918ed6f21707329d8f9384526f1577f 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-startOptions.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-startOptions.md @@ -17,7 +17,7 @@ import StartOptions from '@ohos.application.StartOptions'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -------- | -| [windowMode](js-apis-application-abilityConstant.md#abilityconstantwindowmode) | 是 | 否 | number | 否 | 窗口模式。 | -| displayId | 是 | 否 | number | 否 | 显示ID。 | +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| [windowMode](js-apis-application-abilityConstant.md#abilityconstantwindowmode) | number | 否 | 窗口模式。 | +| displayId | number | 否 | 显示ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-want.md b/zh-cn/application-dev/reference/apis/js-apis-application-want.md index af1375a57f066e731127d05f2c6ead27596c7897..d1698794f90d41adaa1b5b19bf49527333741fb2 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-want.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-want.md @@ -16,18 +16,18 @@ import Want from '@ohos.application.Want'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | -| bundleName | 只读 | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | -| abilityName | 只读 | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 | -| uri | 只读 | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | -| type | 只读 | string | 否 | 表示MIME type类型描述,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 | -| flags | 只读 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-ability-wantConstant.md#wantConstant.Flags)。 | -| action | 只读 | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 | -| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述,由开发者自行决定传入的键值对。默认会携带以下key值:
ohos.aafwk.callerPid 表示拉起方的pid。
ohos.aafwk.param.callerToken 表示拉起方的token。
ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 | -| entities | 只读 | Array\ | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 | -| moduleName9+ | 只读 | string | 否 | 表示待启动的Ability所属的模块(module)。 | +| 名称 | 类型 | 必填 | 说明 | +| ----------- | -------------------- | ---- | ------------------------------------------------------------ | +| deviceId | string | 否 | 表示运行指定Ability的设备ID。 | +| bundleName | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| abilityName | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 | +| uri | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | +| type | string | 否 | 表示MIME type类型描述,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 | +| flags | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-ability-wantConstant.md#wantConstant.Flags)。 | +| action | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 | +| parameters | {[key: string]: any} | 否 | 表示WantParams描述,由开发者自行决定传入的键值对。默认会携带以下key值:
ohos.aafwk.callerPid 表示拉起方的pid。
ohos.aafwk.param.callerToken 表示拉起方的token。
ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 | +| entities | Array\ | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 | +| moduleName9+ | string | 否 | 表示待启动的Ability所属的模块(module)。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-abilityResult.md b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-abilityResult.md index 48c23fa975c5eb49a1e97d68545d3708a6262fef..54542e2f77a567559e0db4dac829c5d1c4e5c5d8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-abilityResult.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-abilityResult.md @@ -2,12 +2,16 @@ 定义ability拉起、销毁之后返回的结果码和数据。 +> **说明:** +> +> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| resultCode | 只读 | number | 否 | 表示ability拉起、销毁之后返回的结果码。 | -| want | 只读 | [Want](js-apis-application-want.md) | 否 | 表示ability销毁之后返回的数据。 | +| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | +| ----------- | -------- |-------- | -------------------- | ---- | ------------------------------------------------------------ | +| resultCode | 是 | 否 | number | 否 | 表示ability拉起、销毁之后返回的结果码。 | +| want | 是 | 否 | [Want](./js-apis-app-ability-want.md) | 否 | 表示ability销毁之后返回的数据。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-connectOptions.md b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-connectOptions.md index ed0bda9b3be8b210bdd44cef3fd0a29182c82aaa..5fdbf7bf0f5ca970c1eefd2c0a23d71832749b20 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-connectOptions.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-connectOptions.md @@ -4,11 +4,11 @@ ConnectOptions类型说明 **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 参数名 | 可读|可写 | 类型 | 必填 | 说明 | -| ------------ | -- | -- | -------- | ---- | ------------------------- | -| onConnect7+ | 是|否 | function | 是 | 连接成功时的回调函数。 | -| onDisconnect7+ | 是|否 | function | 是 | 连接失败时的回调函数。 | -| onFailed7+ | 是|否 | function | 是 | ConnectAbility调用失败时的回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------ | -------- | ---- | ------------------------- | +| onConnect7+ | function | 是 | 连接成功时的回调函数。 | +| onDisconnect7+ | function | 是 | 连接失败时的回调函数。 | +| onFailed7+ | function | 是 | ConnectAbility调用失败时的回调函数。 | **返回值:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityOperation.md b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityOperation.md index 9c6d2fef45f1fb4e6de6f7494685abe1a20dd1d5..59849ff98a79762a7af0f620b857638c15fba284 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityOperation.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityOperation.md @@ -9,16 +9,16 @@ **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel -| 名称 | 类型 | 可读 | 可写 | 必填| 说明 | -| -------- | -------- | -------- | -------- | --------| -------- | -| uri | string | 是 | 否 | 是 | 指定待处理的DataAbility。例:"dataability:///com.example.xxx.xxxx"。 | -| type | featureAbility.DataAbilityOperationType | 是 | 否 | 是 | 指示操作类型。 | -| valuesBucket? | rdb.ValuesBucket | 是 | 否 | 否 | 指示要设置的数据值。 | -| valueBackReferences? | rdb.ValuesBucket | 是 | 否 | 否 | 指示包含一组键值对的valuesBucket对象。 | -| predicates? | dataAbility.DataAbilityPredicates | 是 | 否 | 否 | 指示要设置的筛选条件。如果此参数为空,则所有数据记录。 | -| predicatesBackReferences? | Map\ | 是 | 否 | 否 | 指示用作谓词中筛选条件的反向引用。 | -| interrupted? | boolean | 是 | 否 | 否 | 指定是否可以中断批处理操作。 | -| expectedCount? | number | 是 | 否 | 否 | 指示要更新或删除的预期行数。 | +| 名称 | 类型 | 必填| 说明 | +| -------- | -------- | --------| -------- | +| uri | string | 是 | 指定待处理的DataAbility。例:"dataability:///com.example.xxx.xxxx"。 | +| type | featureAbility.DataAbilityOperationType | 是 | 指示操作类型。 | +| valuesBucket? | rdb.ValuesBucket | 否 | 指示要设置的数据值。 | +| valueBackReferences? | rdb.ValuesBucket | 否 | 指示包含一组键值对的valuesBucket对象。 | +| predicates? | dataAbility.DataAbilityPredicates | 否 | 指示要设置的筛选条件。如果此参数为空,则所有数据记录。 | +| predicatesBackReferences? | Map\ | 否 | 指示用作谓词中筛选条件的反向引用。 | +| interrupted? | boolean | 否 | 指定是否可以中断批处理操作。 | +| expectedCount? | number | 否 | 指示要更新或删除的预期行数。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityResult.md b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityResult.md index 12a1f14d591ace22fbdd0413c111964f250eaa98..612b883d06029d37b14349c910f28dadbd3aa7e4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityResult.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-dataAbilityResult.md @@ -9,10 +9,10 @@ **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel -| 名称 | 类型 | 可读 | 可写 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -------- | -| uri? | string | 是 | 否 | 否 | 指定待处理的DataAbility。例:"dataability:///com.example.xxx.xxxx"。 | -| count? | number | 是 | 否 | 否 | 指示受操作影响的行数。 | +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| uri? | string | 否 | 指定待处理的DataAbility。例:"dataability:///com.example.xxx.xxxx"。 | +| count? | number | 否 | 指示受操作影响的行数。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-startAbilityParameter.md b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-startAbilityParameter.md index c360a0c570b433c4cb31e6a70cd11958e716d686..166b220546ee4a2f4bfdecc298ff279e9ba17bc8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-startAbilityParameter.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-startAbilityParameter.md @@ -9,10 +9,10 @@ **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.FAModel -| 名称 | 类型 | 可读| 可写 | 必填 | 说明 | -| ------------------- | -------- | -------------------- | ---- | -------------------------------------- | -| want | [Want](js-apis-application-want.md)| 是 | 否 | 是 | 表示需要包含有关目标启动能力的信息。 | -| abilityStartSetting | {[key: string]: any} | 是 |否 | 否 | 表示能力的特殊属性,当开发者启动能力时,该属性可以作为调用中的输入参数传递。 | +| 名称 | 类型 | 必填 | 说明 | +| ------------------- | -------- | ---- | -------------------------------------- | +| want | [Want](js-apis-application-want.md)| 是 | 表示需要包含有关目标启动能力的信息。 | +| abilityStartSetting | {[key: string]: any} | 否 | 表示能力的特殊属性,当开发者启动能力时,该属性可以作为调用中的输入参数传递。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md index c085a208e27e35369d1b6bb7a274aac04be652f5..98eacbd321c20046adaac24b1181ba36f169b6a5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-ability-want.md @@ -8,18 +8,18 @@ Want是对象间信息传递的载体, 可以用于应用组件间的信息传 **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | -| bundleName | 只读 | string | 否 | 表示包名。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | -| abilityName | 只读 | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 | -| uri | 只读 | string | 否 | 表示Uri。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | -| type | 只读 | string | 否 | 表示MIME type类型,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 | -| flags | 只读 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-ability-wantConstant.md#wantConstant.Flags)。 | -| action | 只读 | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 | -| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams,由开发者自行决定传入的键值对。默认会携带以下key值:
ohos.aafwk.callerPid 表示拉起方的pid。
ohos.aafwk.param.callerToken 表示拉起方的token。
ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 | -| entities | 只读 | Array\ | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 | -| moduleName9+ | 只读 | string | 否 | 表示待启动的Ability所属的模块(module)。 | +| 名称 | 类型 | 必填 | 说明 | +| ----------- | -------------------- | ---- | ------------------------------------------------------------ | +| deviceId | string | 否 | 表示运行指定Ability的设备ID。 | +| bundleName | string | 否 | 表示包名。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| abilityName | string | 否 | 表示待启动的Ability名称。如果在Want中该字段同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。AbilityName需要在一个应用的范围内保证唯一。 | +| uri | string | 否 | 表示Uri。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | +| type | string | 否 | 表示MIME type类型,打开文件的类型,主要用于文管打开文件。比如:"text/xml" 、 "image/*"等,MIME定义参考:https://www.iana.org/assignments/media-types/media-types.xhtml?utm_source=ld246.com。 | +| flags | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](js-apis-ability-wantConstant.md#wantConstant.Flags)。 | +| action | string | 否 | 表示要执行的通用操作(如:查看、分享、应用详情)。在隐式Want中,您可以定义该字段,配合uri或parameters来表示对数据要执行的操作。 | +| parameters | {[key: string]: any} | 否 | 表示WantParams,由开发者自行决定传入的键值对。默认会携带以下key值:
ohos.aafwk.callerPid 表示拉起方的pid。
ohos.aafwk.param.callerToken 表示拉起方的token。
ohos.aafwk.param.callerUid 表示[bundleInfo](js-apis-bundle-BundleInfo.md#bundleinfo-1)中的uid,应用包里应用程序的uid。 | +| entities | Array\ | 否 | 表示目标Ability额外的类别信息(如:浏览器、视频播放器),在隐式Want中是对action字段的补充。在隐式Want中,您可以定义该字段,来过滤匹配Ability类型。 | +| moduleName9+ | string | 否 | 表示待启动的Ability所属的模块(module)。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-app-context.md b/zh-cn/application-dev/reference/apis/js-apis-inner-app-context.md index 6ea83e05b6ab9ef2e2873f3ecd2ce1d8cf0a13eb..1cd3edb29b0bd612c7d140ff1d58a63d993d29b0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-app-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-app-context.md @@ -31,7 +31,7 @@ getOrCreateLocalDir(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------- | | callback | AsyncCallback\ | 是 | 返回应用程序的本地根目录。 | @@ -83,7 +83,7 @@ verifyPermission(permission: string, options: PermissionOptions, callback: Async **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | ---------- | --------------------------------------- | ---- | -------------------- | | permission | string | 是 | 指定权限的名称。 | | options | [PermissionOptions](#permissionoptions7) | 是 | 权限选项。 | @@ -114,7 +114,7 @@ verifyPermission(permission: string, callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | ---------- | ---------------------- | ---- | -------------------- | | permission | string | 是 | 指定权限的名称。 | | callback | AsyncCallback\ | 是 | 返回权限验证结果,0有权限,-1无权限。 | @@ -139,7 +139,7 @@ verifyPermission(permission: string, options?: PermissionOptions): Promise\, requestCode: number, res **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------------- | ---------------------------------------- | ---- | ----------------------------------- | | permissions | Array\ | 是 | 指示要请求的权限列表。此参数不能为null。 | | requestCode | number | 是 | 指示要传递给PermissionRequestResult的请求代码。 | @@ -208,7 +208,7 @@ requestPermissionsFromUser(permissions: Array\, requestCode: number): Pr **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------------- | ------------------- | ----- | -------------------------------------------- | | permissions | Array\ | 是 | 指示要请求的权限列表。此参数不能为null。 | | requestCode | number | 是 | 指示要传递给PermissionRequestResult的请求代码。 | @@ -248,7 +248,7 @@ getApplicationInfo(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------- | ---- | ------------ | | callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | 是 | 返回当前应用程序的信息。 | @@ -300,7 +300,7 @@ getBundleName(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------------ | | callback | AsyncCallback\ | 是 | 返回当前ability的捆绑包名称。 | @@ -350,7 +350,7 @@ getDisplayOrientation(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------------------ | ---- | ------------------ | | callback | AsyncCallback\<[bundle.DisplayOrientation](js-apis-Bundle.md#displayorientation)> | 是 | 表示屏幕显示方向。 | @@ -398,7 +398,7 @@ getExternalCacheDir(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------------ | | callback | AsyncCallback\ | 是 | 返回应用程序的缓存目录的绝对路径。 | @@ -446,7 +446,7 @@ setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCal **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | ----------- | ---------------------------------------- | ---- | ------------ | | orientation | [bundle.DisplayOrientation](js-apis-Bundle.md#displayorientation) | 是 | 指示当前能力的新方向。。 | | callback | AsyncCallback\ | 是 | 表示屏幕显示方向。 | @@ -500,7 +500,7 @@ setShowOnLockScreen(show: boolean, callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------- | ---- | ---------------------------------------- | | show | boolean | 是 | 指定是否在锁屏顶部显示此功能。值true表示在锁屏上显示,值false表示不显示。 | | callback | AsyncCallback\ | 是 | 返回回调结果。 | @@ -526,7 +526,7 @@ setShowOnLockScreen(show: boolean): Promise\; **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | ---- | ------- | ---- | ---------------------------------------- | | show | boolean | 是 | 指定是否在锁屏顶部显示此功能。值true表示在锁屏上显示,值false表示不显示。 | @@ -557,7 +557,7 @@ setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------- | ---- | --------------------------------- | | wakeUp | boolean | 是 | 指定是否唤醒屏幕。值true表示唤醒它,值false表示不唤醒它。 | | callback | AsyncCallback\ | 是 | 返回回调结果。 | @@ -583,7 +583,7 @@ setWakeUpScreen(wakeUp: boolean): Promise\; **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | ------ | ------- | ---- | --------------------------------- | | wakeUp | boolean | 是 | 指定是否唤醒屏幕。值true表示唤醒它,值false表示不唤醒它。 | @@ -617,7 +617,7 @@ getProcessInfo(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------- | ---- | ---------- | | callback | AsyncCallback\<[ProcessInfo](js-apis-inner-app-processInfo.md)> | 是 | 返回当前进程的信息。 | @@ -671,7 +671,7 @@ getElementName(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | --------------------------- | ---- | -------------------------------------- | | callback | AsyncCallback\<[ElementName](js-apis-bundle-ElementName.md)> | 是 | 返回当前ability的ohos.bundle.ElementName对象。 | @@ -723,7 +723,7 @@ getProcessName(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ---------- | | callback | AsyncCallback\ | 是 | 返回当前进程的名称。 | @@ -775,7 +775,7 @@ getCallingBundle(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ---------------- | | callback | AsyncCallback\ | 是 | 返回调用ability的包名称。 | @@ -825,7 +825,7 @@ getCacheDir(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | --------------- | | callback | AsyncCallback\ | 是 | 返回该应用程序的内部存储目录。 | @@ -873,7 +873,7 @@ getFilesDir(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------------- | | callback | AsyncCallback\ | 是 | 返回内部存储器上此应用程序的文件目录。 | @@ -923,7 +923,7 @@ getOrCreateDistributedDir(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ---------------------------------------- | | callback | AsyncCallback\ | 是 | 回调函数,可以在回调函数中处理接口返回值,返回Ability或应用的分布式文件路径。如果分布式文件路径不存在,系统将创建一个路径并返回创建的路径。 | @@ -973,7 +973,7 @@ getAppType(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | -------------------------------- | | callback | AsyncCallback\ | 是 | 回调函数,可以在回调函数中处理接口返回值,返回此应用程序的类型。 | @@ -1021,7 +1021,7 @@ getHapModuleInfo(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | --------------------------------------- | | callback | AsyncCallback\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)> | 是 | 回调函数,可以在回调函数中处理接口返回值,返回应用的ModuleInfo对象。 | @@ -1069,7 +1069,7 @@ getAppVersionInfo(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ------------------------------ | | callback | AsyncCallback\<[AppVersionInfo](js-apis-inner-app-appVersionInfo.md)> | 是 | 回调函数,可以在回调函数中处理接口返回值,返回应用版本信息。 | @@ -1117,7 +1117,7 @@ getAbilityInfo(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | --------------------------------------- | | callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | 是 | 回调函数,可以在回调函数中处理接口返回值,返回当前归属Ability详细信息。 | @@ -1186,7 +1186,7 @@ isUpdatingConfigurations(callback: AsyncCallback\): void; **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------- | ---- | ----------------------------- | | callback | AsyncCallback\ | 是 | 如果该能力的配置正在更改,则为true,否则为false。 | @@ -1234,7 +1234,7 @@ printDrawnCompleted(callback: AsyncCallback\): void; **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 参数名 | 类型 | 必填 | 说明 | | -------- | -------------------- | ---- | ----------- | | callback | AsyncCallback\ | 是 | 表示被指定的回调方法。 | @@ -1277,7 +1277,7 @@ context.printDrawnCompleted().then((data) => { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| 名称 | 读写属性 | 类型 | 必填 | 说明 | | ---- | ---- | ------ | ---- | ----- | | pid | 只读 | number | 否 | 进程id。 | | uid | 只读 | number | 否 | 用户id。 | @@ -1286,7 +1286,7 @@ context.printDrawnCompleted().then((data) => { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| 名称 | 读写属性 | 类型 | 必填 | 说明 | | ----------- | ---- | -------------- | ---- | ---------- | | requestCode | 只读 | number | 是 | 用户传入的请求代码。 | | permissions | 只读 | Array\ | 是 | 用户传入的权限。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-app-processInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-app-processInfo.md index f45359dbb35c5599ce41d13b6f119488846ea12e..c1a5f7775001b63b698fc515934d03adb3281d4d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-app-processInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-app-processInfo.md @@ -4,7 +4,7 @@ **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | pid | number | 是 | 否 | 进程ID。 | | processName | string | 是 | 否 | 进程名称。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-accessibilityExtensionContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-accessibilityExtensionContext.md index 36caaa3b196bb3a98d3685573c3e36726b267e62..fab1b1897b8cbedb85d7f8b2f8945fe69ad95f1e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-accessibilityExtensionContext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-accessibilityExtensionContext.md @@ -30,7 +30,7 @@ class MainAbility extends AccessibilityExtensionAbility { **系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core -| 名称 | 描述 | +| 名称 | 说明 | | -------- | ------- | | up | 表示向上查询。 | | down | 表示向上查询。 | @@ -45,7 +45,7 @@ class MainAbility extends AccessibilityExtensionAbility { **系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core -| 名称 | 描述 | +| 名称 | 说明 | | ------------- | ----------- | | accessibility | 表示无障碍的焦点类型。 | | normal | 表示普通的焦点类型。 | @@ -69,7 +69,7 @@ class MainAbility extends AccessibilityExtensionAbility { **系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core -| 名称 | 描述 | +| 名称 | 说明 | | ----------- | --------- | | application | 表示应用窗口类型。 | | system | 表示系统窗口类型。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md index 81fcf0b545911d7e7d7f88e1b655a584f9e67c21..f19fc4166a6c2d6e484792ce2c122ed9468b4063 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-appStateData.md @@ -6,11 +6,11 @@ **系统API**:该接口为系统接口,三方应用不支持调用。 -| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| 名称 | 类型 | 必填 | 说明 | | ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| bundleName8+ | 只读 | string | 否 | 包名。 | -| uid8+ | 只读 | number | 否 | 用户ID。 | -| state8+ | 只读 | number | 否 | 应用状态。 | +| bundleName8+ | string | 否 | 包名。 | +| uid8+ | number | 否 | 用户ID。 | +| state8+ | number | 否 | 应用状态。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-baseContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-baseContext.md index 4606a97674664afaddad48091e63ef79cc23905b..6c6d4c3eeea213c8ce372ac4a9f59c0181d344ed 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-baseContext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-baseContext.md @@ -8,7 +8,7 @@ BaseContext抽象类用于表示继承的子类Context是Stage模型还是FA模 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | ------ | ---- | ---- | ------- | | stageMode | boolean | 是 | 是 | 表示Stage模型还是FA模型。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md index bb2b658d7e04a1c99e91d3d02097c50923beba07..a52eafe94507278864fc23467501e89213fc1fa5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-context.md @@ -36,7 +36,7 @@ createBundleContext(bundleName: string): Context; **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 名称 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------- | | bundleName | string | 是 | 包名。 | @@ -62,7 +62,7 @@ createModuleContext(moduleName: string): Context; **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 名称 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------- | | moduleName | string | 是 | 模块名。 | @@ -86,7 +86,7 @@ createModuleContext(bundleName: string, moduleName: string): Context; **参数:** -| 名称 | 类型 | 必填 | 描述 | +| 名称 | 类型 | 必填 | 说明 | | -------- | ---------------------- | ---- | ------------- | | bundleName | string | 是 | 包名。 | | moduleName | string | 是 | 模块名。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md index 0472ec065a9be3aecbdc1455890fab1deba4018b..0eaacb24b9a81bf6be47ef8482c383400d64fb57 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-continueDeviceInfo.md @@ -4,7 +4,7 @@ **系统能力**:SystemCapability.Ability.AbilityRuntime.Mission -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | ------ | ---- | ---- | ------- | | srcDeviceId | string | 是 | 是 | 表示任务迁移源设备ID。 | | dstDeviceId | string | 是 | 是 | 表示任务迁移目标设备ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionContext.md index 84476c12359083f5b636603fd9ccf976c2d6c07a..071b5563b7621ae381123b55bb09f90009106acb 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionContext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionContext.md @@ -13,7 +13,7 @@ ExtensionContext模块提供访问特定Extension的资源的能力,对于拓 **系统能力**:SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | currentHapModuleInfo | [HapModuleInfo](js-apis-bundle-HapModuleInfo.md) | 是 | 否 | 所属Hap包的信息。
(详见SDK目录下的 `api\bundle\hapModuleInfo.d.ts`) | | config | [Configuration](js-apis-app-ability-configuration.md) | 是 | 否 | 所属Module的配置信息。
(详见SDK目录下的 `api\@ohos.app.ability.Configuration.d.ts`) | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md index 95eca98c52e57d1b9e40e4e5c3a086443f628444..0b5a74b5cb8032c95f0871662dd0aaba3b37f488 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-extensionRunningInfo.md @@ -15,7 +15,7 @@ ExtensionRunningInfo模块提供对Extension运行的相关信息和类型进行 **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | extension | ElementName | 是 | 否 | Extension匹配信息。 | | pid | number | 是 | 否 | 进程ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionDeviceInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionDeviceInfo.md index 63e368b06559585683fb7edce83ed6949ca662ff..3dff72963d67ac1d62b94bd43bf4f588233e3e60 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionDeviceInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionDeviceInfo.md @@ -4,7 +4,7 @@ **系统能力**:SystemCapability.Ability.AbilityRuntime.Mission -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | ------ | ---- | ---- | ------- | | deviceId | string | 是 | 是 | 表示设备ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md index 23597ce02e82a82c5a5dde020ebb2dfc2f85579a..35775cd01d29a947e7aa69759114d3d9439fc56c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionInfo.md @@ -6,7 +6,7 @@ **系统API**: 此接口为系统接口,三方应用不支持调用。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | missionId | number | 是 | 是 | 表示任务ID。| | runningState | number | 是 | 是 | 表示运行状态。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionListener.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionListener.md index 52f73b7b0454e758bcff3bffe128d932a86bfed1..f3c934e8d2d2158cc89a5fed3a62b16438625e42 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionListener.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionListener.md @@ -4,15 +4,15 @@ **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission -| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| 名称 | 类型 | 必填 | 说明 | | ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| onMissionCreated | 只读 | function | 否 | 表示当系统创建任务时回调执行。 | -| onMissionDestroyed | 只读 | function | 否 | 表示当系统销毁任务时回调执行。 | -| onMissionSnapshotChanged | 只读 | function | 否 | 表示当系统更新任务缩略图时回调执行。 | -| onMissionMovedToFront | 只读 | function | 否 | 表示当系统将任务移动到前台时回调执行。 | -| onMissionLabelUpdated | 只读 | function | 否 | 表示当系统更新任务标签时回调执行。 | -| onMissionIconUpdated | 只读 | function | 否 | 表示当系统更新任务图标时回调执行。 | -| onMissionClosed | 只读 | function | 否 | 表示当系统关闭任务时回调执行。 | +| onMissionCreated | function | 否 | 表示当系统创建任务时回调执行。 | +| onMissionDestroyed | function | 否 | 表示当系统销毁任务时回调执行。 | +| onMissionSnapshotChanged | function | 否 | 表示当系统更新任务缩略图时回调执行。 | +| onMissionMovedToFront | function | 否 | 表示当系统将任务移动到前台时回调执行。 | +| onMissionLabelUpdated | function | 否 | 表示当系统更新任务标签时回调执行。 | +| onMissionIconUpdated | function | 否 | 表示当系统更新任务图标时回调执行。 | +| onMissionClosed | function | 否 | 表示当系统关闭任务时回调执行。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionParameter.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionParameter.md index 2f167caca698f4eb208293e678a20f7931e57102..2c3fd769ab3b2e54388449f43c720539e813e3cf 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionParameter.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionParameter.md @@ -4,7 +4,7 @@ **系统能力**:SystemCapability.Ability.AbilityRuntime.Mission -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | ----------- | ------- | ---- | ---- | ----------- | | deviceId | string | 是 | 是 | 表示设备ID。 | | fixConflict | boolean | 是 | 是 | 表示是否存在版本冲突。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md index c8a5d3907450b4eb8e0e4a1ddd083820bbfa2158..dd5120ea69778e2c17bcfd5e27680c8fa9a6f2e5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-missionSnapshot.md @@ -9,7 +9,7 @@ MissionSnapshot模块提供设置与任务对应的任务快照的任务元素 **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | ability | ElementName | 是 | 是 | 表示Ability任务元素名称。 | | snapshot | [image.PixelMap](js-apis-image.md) | 是 | 是 | 表示任务快照。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-permissionRequestResult.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-permissionRequestResult.md index 1dd1af18b976eb0d8389d1cf2a1d974fb4c644fa..661c6d76178d7b835e2170ccf42bb122e56cfa19 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-permissionRequestResult.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-permissionRequestResult.md @@ -11,7 +11,7 @@ PermissionRequestResult模块提供了权限请求结果的能力。 **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core - | 名称 | 参数类型 | 可读 | 可写 | 说明 | + | 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | permissions | Array<string> | 是 | 否 | 用户传入的权限。| | authResults | Array<number> | 是 | 否 | 相应请求权限的结果。0表示授权成功,非0表示失败。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-processRunningInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-processRunningInfo.md index 9c19172e7bb5a54f8df9f3518ddc4fe976ad9f41..9be2b7cd87fc6a53e45a6077641a37f29a58b2e8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-processRunningInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-processRunningInfo.md @@ -10,7 +10,7 @@ **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Mission -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | pid | number | 是 | 否 | 进程ID。 | | uid | number | 是 | 否 | 用户ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-processRunningInformation.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-processRunningInformation.md index da74cd661412a5a4d3365d0d39e6201c74e041e6..373f4aa4c8a60b9e9498372219ecf909b3602d43 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-processRunningInformation.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-processRunningInformation.md @@ -21,7 +21,7 @@ appManager.getProcessRunningInformation((error,data) => { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | pid | number | 是 | 否 | 进程ID。 | | uid | number | 是 | 否 | 用户ID。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md index 3ec88f1453ae06c40d8f8990b37d1dfbcd0b3e70..bd3cb09328549807c191f13d586b06241b057358 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md @@ -13,7 +13,7 @@ UIAbilityContext模块提供允许访问特定Ability的资源的能力,包括 **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | abilityInfo | [AbilityInfo](js-apis-bundleManager-abilityInfo.md) | 是 | 否 | Abilityinfo相关信息 | | currentHapModuleInfo | [HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) | 是 | 否 | 当前hap包的信息 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-wantAgent-triggerInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-wantAgent-triggerInfo.md index 2589d0a1935303324bc8698626e79ee72d3aa02d..1574a001f9afd5c6154b01a49383c037f6b19e53 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-wantAgent-triggerInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-wantAgent-triggerInfo.md @@ -4,12 +4,12 @@ **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | +| 名称 | 类型 | 必填 | 说明 | | ---------- | --- | ---- | -------------------- | ---- | ----------- | -| code | 是 | 是 | number | 是 | result code。 | -| want | 是 | 是 | Want | 否 | Want。 | -| permission | 是 | 是 | string | 否 | 权限定义。 | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | +| code | number | 是 | result code。 | +| want | Want | 否 | Want。 | +| permission | string | 否 | 权限定义。 | +| extraInfo | {[key: string]: any} | 否 | 额外数据。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md b/zh-cn/application-dev/reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md index 0db04d1a8b7dd6c0936d757e3e1dfa4c73bcdb52..aaf328c337c9c927d699ab8d9c70828a950db2c4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md @@ -4,13 +4,13 @@ **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------------- | --- | ---- | ------------------------------- | ---- | ---------------------- | -| wants | 是 | 是 | Array\ | 是 | 将被执行的动作列表。 | -| operationType | 是 | 是 | wantAgent.OperationType | 是 | 动作类型。 | -| requestCode | 是 | 是 | number | 是 | 使用者定义的一个私有值。 | -| wantAgentFlags | 是 | 是 | Array<[wantAgent.WantAgentFlags](js-apis-wantAgent.md#WantAgentFlags)> | 否 | 动作执行属性。 | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | +| 名称 | 类型 | 必填 | 说明 | +| -------------- | ------------------------------- | ---- | ---------------------- | +| wants | Array\ | 是 | 将被执行的动作列表。 | +| operationType | wantAgent.OperationType | 是 | 动作类型。 | +| requestCode | number | 是 | 使用者定义的一个私有值。 | +| wantAgentFlags | Array<[wantAgent.WantAgentFlags](js-apis-wantAgent.md#WantAgentFlags)> | 否 | 动作执行属性。 | +| extraInfo | {[key: string]: any} | 否 | 额外数据。 | **示例:** ```ts diff --git a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md index 32e4d97605859cb01a9cd51496c34974d1bcd998..d40853b5e03c7328c71b0ecc444f3fc022fa82dd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @@ -22,10 +22,10 @@ getWantAgent(info: WantAgentInfo, callback: AsyncCallback\): void **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------- | --- | ---- | -------------------------- | ---- | ----------------------- | -| info | 是 | 否 | WantAgentInfo | 是 | WantAgent信息。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 创建WantAgent的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------- | ---- | ----------------------- | +| info | WantAgentInfo | 是 | WantAgent信息。 | +| callback | AsyncCallback\ | 是 | 创建WantAgent的回调方法。 | **示例:** @@ -79,9 +79,9 @@ getWantAgent(info: WantAgentInfo): Promise\ **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ---- | --- | ---- | ------------- | ---- | ------------- | -| info | 是 | 否 | WantAgentInfo | 是 | WantAgent信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------------- | ---- | ------------- | +| info | WantAgentInfo | 是 | WantAgent信息。 | **返回值:** @@ -140,10 +140,10 @@ getBundleName(agent: WantAgent, callback: AsyncCallback\): void **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------- | --- | ---- | ----------------------- | ---- | --------------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取WantAgent实例的包名的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------- | ---- | --------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 获取WantAgent实例的包名的回调方法。 | **示例:** @@ -212,9 +212,9 @@ getBundleName(agent: WantAgent): Promise\ **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ----- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -281,10 +281,10 @@ getUid(agent: WantAgent, callback: AsyncCallback\): void **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------- | --- | ---- | ----------------------- | ---- | ----------------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取WantAgent实例的用户ID的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------- | ---- | ----------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 获取WantAgent实例的用户ID的回调方法。 | **示例:** @@ -353,9 +353,9 @@ getUid(agent: WantAgent): Promise\ **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ----- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -424,10 +424,10 @@ getWant(agent: WantAgent, callback: AsyncCallback\): void **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------- | --- | ---- | --------------------- | ---- | ------------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取WantAgent对象want的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | ------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 获取WantAgent对象want的回调方法。 | **示例:** @@ -498,9 +498,9 @@ getWant(agent: WantAgent): Promise\ **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ----- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -567,10 +567,10 @@ cancel(agent: WantAgent, callback: AsyncCallback\): void **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------- | --- | ---- | --------------------- | ---- | --------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 取消WantAgent实例的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | --------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 取消WantAgent实例的回调方法。 | **示例:** @@ -639,9 +639,9 @@ cancel(agent: WantAgent): Promise\ **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ----- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -708,11 +708,11 @@ trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback\ | 是 | 主动激发WantAgent实例的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ----------------------------- | ---- | ------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| triggerInfo | TriggerInfo | 是 | TriggerInfo对象。 | +| callback | AsyncCallback\ | 否 | 主动激发WantAgent实例的回调方法。 | **示例:** @@ -785,11 +785,11 @@ equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback\ | 是 | 判断两个WantAgent实例是否相等的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------ | ---- | --------------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| otherAgent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 判断两个WantAgent实例是否相等的回调方法。 | **示例:** @@ -860,10 +860,10 @@ equal(agent: WantAgent, otherAgent: WantAgent): Promise\ **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ---------- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| otherAgent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| otherAgent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -930,10 +930,10 @@ getOperationType(agent: WantAgent, callback: AsyncCallback\): void; **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ---------- | --- | ---- | ------------------------ | ---- | --------------------------------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | -| callback | 是 | 否 | AsyncCallback\ | 是 | 获取一个WantAgent的OperationType信息的回调方法。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------ | ---- | --------------------------------------- | +| agent | WantAgent | 是 | WantAgent对象。 | +| callback | AsyncCallback\ | 是 | 获取一个WantAgent的OperationType信息的回调方法。 | **示例:** @@ -991,9 +991,9 @@ getOperationType(agent: WantAgent): Promise\; **参数:** -| 参数名 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ---------- | --- | ---- | --------- | ---- | ------------- | -| agent | 是 | 否 | WantAgent | 是 | WantAgent对象。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | --------- | ---- | ------------- | +| agent | WantAgent | 是 | WantAgent对象。 | **返回值:** @@ -1053,13 +1053,13 @@ WantAgent.getOperationType(wantAgent).then((OperationType) => { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------------- | --- | ---- | ------------------------------- | ---- | ---------------------- | -| wants | 是 | 是 | Array\ | 是 | 将被执行的动作列表。 | -| operationType | 是 | 是 | wantAgent.OperationType | 是 | 动作类型。 | -| requestCode | 是 | 是 | number | 是 | 使用者定义的一个私有值。 | -| wantAgentFlags | 是 | 是 | Array | 否 | 动作执行属性。 | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | +| 名称 | 类型 | 必填 | 说明 | +| -------------- | ------------------------------- | ---- | ---------------------- | +| wants | Array\ | 是 | 将被执行的动作列表。 | +| operationType | wantAgent.OperationType | 是 | 动作类型。 | +| requestCode | number | 是 | 使用者定义的一个私有值。 | +| wantAgentFlags | Array | 否 | 动作执行属性。 | +| extraInfo | {[key: string]: any} | 否 | 额外数据。 | ## WantAgentFlags @@ -1094,21 +1094,10 @@ WantAgent.getOperationType(wantAgent).then((OperationType) => { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | -| -------------- | --- | ---- | ------------------------------ | ---- | ---------------------- | -| info | 是 | 是 | WantAgent | 是 | 触发的wantAgent。 | -| want | 是 | 是 | Want | 是 | 存在的被触发的want。 | -| finalCode | 是 | 是 | number | 是 | 触发wantAgent的请求代码。| -| finalData | 是 | 是 | string | 否 | 公共事件收集的最终数据。 | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | - -## TriggerInfo - -**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core - -| 名称 | 可读 | 可写 | 类型 | 必填 | 说明 | -| ---------- | --- | ---- | -------------------- | ---- | ----------- | -| code | 是 | 是 | number | 是 | result code。 | -| want | 是 | 是 | Want | 否 | Want。 | -| permission | 是 | 是 | string | 否 | 权限定义。 | -| extraInfo | 是 | 是 | {[key: string]: any} | 否 | 额外数据。 | \ No newline at end of file +| 名称 | 类型 | 必填 | 说明 | +| -------------- | ------------------------------ | ---- | ---------------------- | +| info | WantAgent | 是 | 触发的wantAgent。 | +| want | Want | 是 | 存在的被触发的want。 | +| finalCode | number | 是 | 触发wantAgent的请求代码。| +| finalData | string | 否 | 公共事件收集的最终数据。 | +| extraInfo | {[key: string]: any} | 否 | 额外数据。 |