From 400ff87347d71d553b53dca019481ac8a22fc143 Mon Sep 17 00:00:00 2001 From: dy_study Date: Wed, 9 Mar 2022 19:02:51 +0800 Subject: [PATCH] =?UTF-8?q?IssueNo:=E6=8E=A5=E5=8F=A3=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E8=A1=A5=E9=BD=90=E4=B8=8E=E6=95=B4=E6=94=B9=20Description:?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=83=BD=E5=8A=9B=E8=A1=A5=E9=BD=90=E4=B8=8E?= =?UTF-8?q?=E6=95=B4=E6=94=B9=20Sig:SIG=5FApplicationFramework=20Feature?= =?UTF-8?q?=20or=20Bugfix:=20Feature=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dy_study Change-Id: Ib486aa4685a0d8184a77e1405cb9768d850e7658 --- api/@internal/ets/lifecycle.d.ts | 30 ++++++++++++++++- api/@ohos.ability.featureAbility.d.ts | 40 +++++++++++++++++++++++ api/@ohos.ability.particleAbility.d.ts | 13 +++++++- api/@ohos.ability.wantConstant.d.ts | 2 +- api/ability/connectOptions.d.ts | 8 ++--- api/ability/dataAbilityHelper.d.ts | 27 +++++++++++++--- api/ability/startAbilityParameter.d.ts | 6 ++-- api/app/appVersionInfo.d.ts | 1 + api/app/context.d.ts | 45 +++++++++++++++++++++++--- 9 files changed, 153 insertions(+), 19 deletions(-) diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 18cff8475e..e493b6a62e 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -542,5 +542,33 @@ export declare interface LifecycleData { * @return - * @FAModelOnly */ - getType?(uri: string, callback: AsyncCallback): void; + getType?(uri: string, callback: AsyncCallback): void; + + /** + * Performs batch operations on the database. This method should be implemented by a Data ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param ops Indicates the data operation list, which can contain multiple operations on the database. + * @param callback function specified by framework to receive the result, developer should call this function to + * return the result to framework. + * @return - + * @FAModelOnly + */ + executeBatch?(ops: Array, callback: AsyncCallback>): void; + + /** + * Defines a method in this Data ability (implementation depending on child classes). + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param method Indicates the method name. + * @param arg Indicates the parameter transferred by the method. + * @param extras Indicates the parameter transferred by the method. + * @param callback function specified by framework to receive the result, developer should call this function to + * return the result to framework. + * @return - + * @FAModelOnly + */ + call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; } diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index bf53635d1d..cff1e71e38 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -20,6 +20,7 @@ import { AbilityResult } from './ability/abilityResult'; import { Context } from './app/context'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; +import window from './@ohos.window'; /** * A Feature Ability represents an ability with a UI and is designed to interact with users. @@ -145,6 +146,24 @@ declare namespace featureAbility { function disconnectAbility(connection: number, callback:AsyncCallback): void; function disconnectAbility(connection: number): Promise; + /** + * Obtains the window corresponding to the current ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return Returns the window corresponding to the current ability. + * @FAModelOnly + */ + function getWindow(callback: AsyncCallback): void; + function getWindow(): Promise; + + /** + * Obtain the window configuration. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum AbilityWindowConfiguration { WINDOW_MODE_UNDEFINED = 0, WINDOW_MODE_FULLSCREEN = 1, @@ -153,12 +172,26 @@ declare namespace featureAbility { WINDOW_MODE_FLOATING = 102 } + /** + * Obtain the window properties. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum AbilityStartSetting { BOUNDS_KEY = "abilityBounds", WINDOW_MODE_KEY = "windowMode", DISPLAY_ID_KEY = "displayId" } + /** + * Obtain the errorCode. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum ErrorCode { NO_ERROR = 0, INVALID_PARAMETER = -1, @@ -166,6 +199,13 @@ declare namespace featureAbility { PERMISSION_DENY = -3 } + /** + * Indicates the operation type of data. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum DataAbilityOperationType { TYPE_INSERT = 1, TYPE_UPDATE = 2, diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts index f6d62b65b4..1b9a85b641 100644 --- a/api/@ohos.ability.particleAbility.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -98,7 +98,7 @@ declare namespace particleAbility { * @return unique identifier of the connection between the client and the service side. * @FAModelOnly */ - function connectAbility(request: Want, options:ConnectOptions ): number; + function connectAbility(request: Want, options:ConnectOptions): number; /** * Disconnects ability to a Service ability. @@ -109,5 +109,16 @@ declare namespace particleAbility { */ function disconnectAbility(connection: number, callback:AsyncCallback): void; function disconnectAbility(connection: number): Promise; + + /** + * Obtain the errorCode. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export enum ErrorCode { + INVALID_PARAMETER = -1 + } } export default particleAbility; diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts index bc93801bab..0b1933a1c4 100644 --- a/api/@ohos.ability.wantConstant.d.ts +++ b/api/@ohos.ability.wantConstant.d.ts @@ -32,7 +32,7 @@ declare namespace wantConstant { /** * Indicates the action of backing home. * - * @since 1 + * @since 6 */ ACTION_HOME = "ohos.want.action.home", diff --git a/api/ability/connectOptions.d.ts b/api/ability/connectOptions.d.ts index 8b283b0da1..0ba5280c1d 100644 --- a/api/ability/connectOptions.d.ts +++ b/api/ability/connectOptions.d.ts @@ -28,9 +28,9 @@ export interface ConnectOptions { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param elementName The element name of the service ability - * @param remoteObject The remote object instance + * @param remote The remote object instance */ - onConnect: (elementName: ElementName, remoteObject: RemoteObject) => void; + onConnect(elementName: ElementName, remote: rpc.IRemoteObject): void; /** * The callback interface was disconnect successfully. @@ -40,7 +40,7 @@ export interface ConnectOptions { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param elementName The element name of the service ability */ - onDisconnect: (elementName: ElementName) => void; + onDisconnect(elementName: ElementName): void; /** * The callback interface was connect failed. @@ -50,5 +50,5 @@ export interface ConnectOptions { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param code The error code of the failed. */ - onFailed: (code: number) => void; + onFailed(code: number): void; } diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts index 1fd91039bf..4b55b5a512 100644 --- a/api/ability/dataAbilityHelper.d.ts +++ b/api/ability/dataAbilityHelper.d.ts @@ -93,8 +93,8 @@ export interface DataAbilityHelper { * @return Returns the matched MIME types Array. * @FAModelOnly */ - getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; - getFileTypes(uri: string, mimeTypeFilter: string): Promise>; + getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; + getFileTypes(uri: string, mimeTypeFilter: string): Promise>; /** * Converts the given uri that refers to the Data ability into a normalized uri. @@ -169,7 +169,8 @@ export interface DataAbilityHelper { * @FAModelOnly */ delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - delete(uri: string, predicates: dataAbility.DataAbilityPredicates): Promise; + delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise; + delete(uri: string, callback: AsyncCallback): void; /** * Updates data records in the database. @@ -183,7 +184,8 @@ export interface DataAbilityHelper { * @FAModelOnly */ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates): Promise; + update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise; + update(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; /** * Queries data in the database. @@ -197,7 +199,10 @@ export interface DataAbilityHelper { * @FAModelOnly */ query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): Promise; + query(uri: string, callback: AsyncCallback): void; + query(uri: string, columns: Array, callback: AsyncCallback): void; + query(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + query(uri: string, columns?: Array, predicates?: dataAbility.DataAbilityPredicates): Promise; /** * Calls the extended API of the DataAbility. This method uses a promise to return the result. @@ -217,6 +222,18 @@ export interface DataAbilityHelper { */ call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; call(uri: string, method: string, arg: string, extras: PacMap): Promise; + + /** + * Queries data in the database. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of data to query. + * @param operations Indicates the data operation list, which can contain multiple operations on the database. + * @return Returns the result of each operation, in array {@link DataAbilityResult}. + */ + executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void; + executeBatch(uri: string, operations: Array): Promise>; } /** diff --git a/api/ability/startAbilityParameter.d.ts b/api/ability/startAbilityParameter.d.ts index 29a635d29c..a2a65148da 100644 --- a/api/ability/startAbilityParameter.d.ts +++ b/api/ability/startAbilityParameter.d.ts @@ -15,7 +15,7 @@ import { Want } from './want'; /** - * @since 3 + * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A */ @@ -24,7 +24,7 @@ export interface StartAbilityParameter { * Indicates the Want containing information about the target ability to start. * * @default - - * @since 3 + * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ @@ -34,7 +34,7 @@ export interface StartAbilityParameter { * Indicates the special start setting used in starting ability. * * @default - - * @since 3 + * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly */ diff --git a/api/app/appVersionInfo.d.ts b/api/app/appVersionInfo.d.ts index 9aa63fc268..16333f0d77 100644 --- a/api/app/appVersionInfo.d.ts +++ b/api/app/appVersionInfo.d.ts @@ -17,6 +17,7 @@ * Defines an AppVersionInfo object. * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission NA */ export interface AppVersionInfo { diff --git a/api/app/context.d.ts b/api/app/context.d.ts index 048c033f5d..b03bc6357a 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -21,6 +21,7 @@ import BaseContext from '../application/BaseContext'; import { HapModuleInfo } from '../bundle/hapModuleInfo'; import { AppVersionInfo } from './appVersionInfo'; import { AbilityInfo } from '../bundle/abilityInfo'; +import { DisplayOrientation } from '../@ohos.bundle'; /** @@ -76,6 +77,7 @@ export interface Context extends BaseContext { * @FAModelOnly */ requestPermissionsFromUser(permissions: Array, requestCode: number, resultCallback: AsyncCallback): void; + requestPermissionsFromUser(permissions: Array, requestCode: number): Promise; /** * Obtains information about the current application. @@ -95,6 +97,41 @@ export interface Context extends BaseContext { getBundleName(callback: AsyncCallback): void getBundleName(): Promise; + /** + * Obtains the current display orientation of this ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + getDisplayOrientation(callback: AsyncCallback): void + getDisplayOrientation(): Promise; + + /** + * Sets the display orientation of the current ability. + * @param orientation Indicates the new orientation for the current ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setDisplayOrientation(orientation: DisplayOrientation, callback: AsyncCallback): void + setDisplayOrientation(orientation: DisplayOrientation): Promise; + + /** + * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, keeping the ability in the ACTIVE state. + * @param show Specifies whether to show this ability on top of the lock screen. The value true means to show it on the lock screen, and the value false means not. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setShowOnLockScreen(show: boolean, callback: AsyncCallback): void + setShowOnLockScreen(show: boolean): Promise; + + /** + * Sets whether to wake up the screen when this ability is restored. + * @param wakeUp Specifies whether to wake up the screen. The value true means to wake it up, and the value false means not. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback): void + setWakeUpScreen(wakeUp: boolean): Promise; + /** * Obtains information about the current process, including the process ID and name. * @since 7 @@ -133,7 +170,7 @@ export interface Context extends BaseContext { /** * Obtains the file directory of this application on the internal storage. - * @since 7 + * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ @@ -142,7 +179,7 @@ export interface Context extends BaseContext { /** * Obtains the cache directory of this application on the internal storage. - * @since 7 + * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ @@ -210,8 +247,8 @@ export interface Context extends BaseContext { * @return true if the configuration of this ability is changing and false otherwise. * @FAModelOnly */ - isUpdatingConfigurations(): Promise; isUpdatingConfigurations(callback: AsyncCallback): void; + isUpdatingConfigurations(): Promise; /** * Informs the system of the time required for drawing this Page ability. @@ -219,8 +256,8 @@ export interface Context extends BaseContext { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly */ - printDrawnCompleted(): Promise; printDrawnCompleted(callback: AsyncCallback): void; + printDrawnCompleted(): Promise; } /** -- Gitee