From 81930a6ba8ab75d7526f1b51009e888303b98251 Mon Sep 17 00:00:00 2001 From: zhaoyuan17 Date: Thu, 23 Sep 2021 19:54:26 +0800 Subject: [PATCH] modify d.ts Signed-off-by: zhaoyuan17 --- .../kits/js/@ohos.ability.featureAbility.d.ts | 55 ++++++++++++++----- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/interfaces/kits/js/@ohos.ability.featureAbility.d.ts b/interfaces/kits/js/@ohos.ability.featureAbility.d.ts index d92e73b8404..9a9170e063c 100644 --- a/interfaces/kits/js/@ohos.ability.featureAbility.d.ts +++ b/interfaces/kits/js/@ohos.ability.featureAbility.d.ts @@ -31,6 +31,7 @@ import { ConnectOptions } from './ability/connectOptions'; declare namespace featureAbility { /** * Obtain the want sended from the source ability. + * * @devices phone, tablet * @since 6 * @sysCap AAFwk @@ -42,6 +43,7 @@ declare namespace featureAbility { /** * Starts a new ability. + * * @devices phone, tablet * @since 6 * @sysCap AAFwk @@ -61,11 +63,12 @@ declare namespace featureAbility { /** * Starts an ability and returns the execution result when the ability is destroyed. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk * @param parameter Indicates the ability to start. - * @return - + * @return Returns the {@link AbilityResult}. */ function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; function startAbilityForResult(parameter: StartAbilityParameter): Promise; @@ -73,6 +76,7 @@ declare namespace featureAbility { /** * Sets the result code and data to be returned by this Page ability to the caller * and destroys this Page ability. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk @@ -84,31 +88,36 @@ declare namespace featureAbility { /** * Destroys this Page ability. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk * @return - */ function terminateSelf(callback: AsyncCallback): void; + function terminateSelf(): Promise; /** * Obtains the dataAbilityHelper. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk * @param uri Indicates the path of the file to open. * @return Returns the dataAbilityHelper. */ - function acquireDataAbilityHelper(uri: string): DataAbilityHelper; + function acquireDataAbilityHelper(uri: string): DataAbilityHelper; /** * Checks whether the main window of this ability has window focus. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk + * @return Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise. */ - function hasWindowFocus(callback: AsyncCallback): void; - function hasWindowFocus(): Promise; + function hasWindowFocus(callback: AsyncCallback): void; + function hasWindowFocus(): Promise; /** * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. @@ -118,18 +127,18 @@ declare namespace featureAbility { * @SysCap aafwk * @param request The element name of the service ability * @param options The remote object instance - * @return Returns the number of the ability connected + * @return Returns the number code of the ability connected */ function connectAbility(request: Want, options:ConnectOptions ): number; /** - * The callback interface was connect successfully. - * @default - - * @devices phone, tablet - * @since 7 - * @SysCap aafwk - * @param connection The number of the ability connected - */ + * The callback interface was connect successfully. + * @default - + * @devices phone, tablet + * @since 7 + * @SysCap aafwk + * @param connection The number code of the ability connected + */ function disconnectAbility(connection: number, callback:AsyncCallback): void; function disconnectAbility(connection: number): Promise; @@ -146,5 +155,25 @@ declare namespace featureAbility { WINDOW_MODE_KEY = "windowMode", DISPLAY_ID_KEY = "displayId" } + + export enum ErrorCode { + NO_ERROR = 0, + INVALID_PARAMETER = -1, + ABILITY_NOT_FOUND = -2, + PERMISSION_DENY = -3 + } + + export enum ContinuationState { + LOCAL_RUNNING = 0, + REMOTE_RUNNING = 1, + REPLICA_RUNNING = 2 + } + + export enum DataAbilityOperationType { + TYPE_INSERT = 1, + TYPE_UPDATE = 2, + TYPE_DELETE = 3, + TYPE_ASSERT = 4, + } } -export default featureAbility; +export default featureAbility; \ No newline at end of file -- Gitee