diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 18cff8475eb22d59cca76a92c7ce6d10701ef7d7..e493b6a62e1894dc8d1f013a0fc7f88e9ea0177b 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 bf53635d1dfa93a324d5a826391ed0b55f8ad8a1..cff1e71e38cf847f3e8f11c7cbcbadebd8675666 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 f6d62b65b404768e3f2f1a8016f46eed5207da95..1b9a85b641c88372412a9b9334e160a2b21b568d 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 bc93801babdb77b434a5bfd2581da94a11819bc7..0b1933a1c4aff7427b358cb83d27fa064bb58b2a 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 8b283b0da1d8f6cfd808a204f86451702f10fcf4..0ba5280c1d40849dc19a1d19819dde7ba9d7c6a3 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 1fd91039bf98cbb768df1d8c99b11604d37986c6..4b55b5a51234882a3120541328866dbc31d0193e 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 29a635d29c12969611ff3e77d7724217684c49d4..a2a65148daaa4081dd8776276456c6ccbfe0c042 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 9aa63fc268138c05f0759e914f0964cc399061ba..16333f0d7794c63d6a39debeebd10844a30d586e 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 048c033f5d69808828fdc83738ef7efd44deaeba..b03bc6357af7db0f3dd0afbf36e8c7bede366c35 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; } /**