From 80aed415ef02187ec2df04ade26ccc4ddd907ba7 Mon Sep 17 00:00:00 2001 From: dy_stuty Date: Mon, 7 Mar 2022 21:27:59 +0800 Subject: [PATCH] =?UTF-8?q?IssueNo:#I4V1I2:=E8=83=BD=E5=8A=9B=E8=A1=A5?= =?UTF-8?q?=E9=BD=90=E6=8F=90=E4=BA=A4=20Description:=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E8=A1=A5=E9=BD=90=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4=20Sig:SI?= =?UTF-8?q?G=5FApplicationFramework=20Feature=20or=20Bugfix:=20Feature=20B?= =?UTF-8?q?inary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: dy_study Change-Id: I0e32fc734ecc9c9d35301f0fe3fa172bbff16339 --- api/@internal/ets/lifecycle.d.ts | 30 +- api/@ohos.ability.abilityAgent.d.ts | 101 ++++ ...s.ability.continuationRegisterManager.d.ts | 134 +++++ api/@ohos.ability.featureAbility.d.ts | 227 +++++++- api/@ohos.ability.formManager.d.ts | 548 ++++++++++++++++++ api/@ohos.ability.particleAbility.d.ts | 13 +- api/@ohos.ability.wantConstant.d.ts | 2 +- api/ability/connectOptions.d.ts | 8 +- api/ability/continuationExtraParams.d.ts | 60 ++ api/ability/continuationResult.d.ts | 50 ++ api/ability/dataAbilityHelper.d.ts | 27 +- api/ability/startAbilityParameter.d.ts | 6 +- api/app/activeServiceAbilityInfo.d.ts | 54 ++ api/app/appVersionInfo.d.ts | 1 + api/app/context.d.ts | 45 +- 15 files changed, 1285 insertions(+), 21 deletions(-) create mode 100644 api/@ohos.ability.abilityAgent.d.ts create mode 100644 api/@ohos.ability.continuationRegisterManager.d.ts create mode 100644 api/@ohos.ability.formManager.d.ts create mode 100644 api/ability/continuationExtraParams.d.ts create mode 100644 api/ability/continuationResult.d.ts create mode 100644 api/app/activeServiceAbilityInfo.d.ts diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 18cff8475e..c38bec42c7 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.abilityAgent.d.ts b/api/@ohos.ability.abilityAgent.d.ts new file mode 100644 index 0000000000..63182a3b0d --- /dev/null +++ b/api/@ohos.ability.abilityAgent.d.ts @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { AsyncCallback } from './basic'; +import { Callback } from './basic'; + +/** + * Provides methods to listen for the lifecycle of and send messages to the peer ability. After your application. + * + * @name abilityAgent + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ +declare namespace abilityAgent { + + /** + * Subscribe send message event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param type event type. + */ + function on(type: 'message', callback: Callback): void; + + /** + * Subscribe listen lifeCycle event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param type event type. + */ + function on(type: 'stateChange', callback: Callback): void; + + /** + * Unsubscribe send message event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param type event type. + */ + function off(type: 'message', callback?: Callback): void; + + /** + * Unsubscribe listen lifeCycle event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param type event type. + */ + function off(type: 'stateChange', callback?: Callback): void; + + /** + * Send message. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param data message content. + */ + function postMessage(data: Message, callback:AsyncCallback): void; + function postMessage(data: Message): Promise; + + /** + * Message data structure. + * + * @name Message + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + interface Message { + /** + * message type. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + type: string; + + /** + * message content. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + data: {[key: string]: Object}; + } +} + +export default abilityAgent; \ No newline at end of file diff --git a/api/@ohos.ability.continuationRegisterManager.d.ts b/api/@ohos.ability.continuationRegisterManager.d.ts new file mode 100644 index 0000000000..b149c089cb --- /dev/null +++ b/api/@ohos.ability.continuationRegisterManager.d.ts @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Callback } from './basic'; +import { AsyncCallback } from './basic'; +import { ContinuationResult } from './ability/continuationResult' +import { ContinuationExtraParams } from './ability/continuationExtraParams' + +/** + * Provides methods for interacting with the hop task management service, including methods for registering and + * unregistering the ability to hop, updating the device connection state, and showing the list of devices + * that can be selected for hopping. + * + * @name continuationRegisterManager + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ +declare namespace continuationRegisterManager { + /** + * Called when the user selects a device from the candidate device list. + * You can implement your own processing logic in this callback to initiate the hop process. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param type deviceConnect. + * @return callback Indicates the information about the selected device. + */ + function on(type: "deviceConnect", callback: Callback): void; + function off(type: "deviceConnect",callback?: Callback): void; + + /** + * Called when a device is disconnected from the hop task management service. + * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param type deviceDisconnect. + * @return callback Indicates the ID of the disconnected device. + */ + function on(type: "deviceDisconnect", callback: Callback): void; + function off(type: "deviceDisconnect", callback?: Callback): void; + + /** + * Registers an ability to be hopped with the hop task management service and obtains the registration token + * assigned to the ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @param bundle Indicates the bundle name of the application whose ability is to be hopped. + * @param extraParams Indicates the {@link ContinuationExtraParams} object containing the extra parameters used to filter + * the list of available devices. + * @return callback Indicates the callback to be invoked when the hop task management service is connected. + */ + function register(bundle: string, callback: AsyncCallback): void; + function register(bundle: string, extraParams: ContinuationExtraParams, callback: AsyncCallback): void; + function register(bundle: string, extraParams?: ContinuationExtraParams): Promise; + + /** + * Unregisters a specified ability from the hop task management service based on the token obtained during ability + * registration. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param token Indicates the registration token of the ability. + * @return callback Indicates the callback to be invoked when the hop task management service is connected. + */ + function unregister(token: number, callback: AsyncCallback): void; + function unregister(token: number): Promise; + + /** + * Updates the connection state of the device where the specified ability is successfully hopped. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param token Indicates the registration token of the ability. + * @param deviceId Indicates the ID of the device whose connection state is to be updated. + * @param status Indicates the connection state to update. + * @return callback Indicates the callback to be invoked when the hop task management service is connected. + */ + function updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState, callback: AsyncCallback): void; + function updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState): Promise; + + /** + * Shows the list of devices that can be selected for ability hopping on the distributed network. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param token Indicates the registration token of the ability. + * @param parameter Indicates the {@link ContinuationExtraParams} object containing the extra parameters used to filter + * the list of available devices. This parameter can be null. + * @param status Indicates the connection state to update. + * @return callback Indicates the callback to be invoked when the hop task management service is connected. + */ + function showDeviceList(token: number, callback: AsyncCallback): void; + function showDeviceList(token: number, extraParams: ContinuationExtraParams, callback: AsyncCallback): void; + function showDeviceList(token: number, extraParams?: ContinuationExtraParams): Promise; + + /** + * Disconnects from the hop task management service. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return - + */ + function disconnect(callback: AsyncCallback): void; + function disconnect(): Promise; + + /** + * Device connection status data structure. + * @name DeviceConnectState + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export enum DeviceConnectState { + IDLE = 0, + CONNECTING = 1, + CONNECTED = 2, + DISCONNECTING = 3 + } + +} +export default continuationRegisterManager; \ No newline at end of file diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 44de8063d5..217965c835 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -21,6 +21,8 @@ import { Context } from './app/context'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; import { ContinueAbilityOptions } from './ability/continueAbilityOptions'; +import { AbilityAgent } from './@ohos.ability.abilityAgent'; +import window from './@ohos.window'; /** * A Feature Ability represents an ability with a UI and is designed to interact with users. @@ -151,12 +153,145 @@ declare namespace featureAbility { * @default - * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @permission ohos.permission.DISTRIBUTED_DATASYNC. * @return - * @FAModelOnly */ - function continueAbility(options: ContinueAbilityOptions, callback: AsyncCallback): void; - function continueAbility(options: ContinueAbilityOptions): Promise; + function continueAbility(options: ContinueAbilityOptions, callback: AsyncCallback): void; + function continueAbility(options: ContinueAbilityOptions): 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; + + /** + * Obtains the migration state of this ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return Returns the migration state {@link ContinuationState}. + * @FAModelOnly + */ + function getContinuationState(callback: AsyncCallback): void; + function getContinuationState(): Promise; + + /** + * Obtains the ID of the source device from which this ability is migrated. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return Returns the source device ID. + * @FAModelOnly + */ + function getOriginalDeviceId(callback: AsyncCallback): void; + function getOriginalDeviceId(): Promise; + + /** + * Migrates this ability from another device on the same distributed network back to the local device. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return - + * @FAModelOnly + */ + function reverseContinueAbility(callback: AsyncCallback): void; + function reverseContinueAbility(): Promise; + + /** + * Start assist ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @permission ohos.permission.DISTRIBUTED_DATASYNC, com.huawei.hwddmp.servicebus.BIND_SERVICE + * @param want want. + * @FAModelOnly + */ + function startAssistAbility(want: Want): void; + + /** + * Stop assist ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + function stopAssistAbility(callback: AsyncCallback): void; + function stopAssistAbility(): Promise; + + /** + * Subscribe assist ability success event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param type event type. + * @FAModelOnly + */ + function on(type: 'assistConnect', callback: Callback): void; + + /** + * Subscribe assist ability fail event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param type event type. + * @FAModelOnly + */ + function on(type: 'assistConnectFailed', callback: Callback): void; + + /** + * Subscribe disconnect assist ability event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param type event type. + * @FAModelOnly + */ + function on(type: 'assistDisconnect', callback: Callback): void; + + /** + * Unsubscribe assist ability success event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param type event type. + * @FAModelOnly + */ + function off(type: 'assistConnect', callback?: Callback): void; + + /** + * Unsubscribe assist ability fail event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param type event type. + * @FAModelOnly + */ + function off(type: 'assistConnectFailed', callback?: Callback): void; + + /** + * Unsubscribe disconnect assist ability event. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param type event type. + * @FAModelOnly + */ + function off(type: 'assistDisconnect', callback?: Callback): void; + + /** + * Obtain the window configuration. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ export enum AbilityWindowConfiguration { WINDOW_MODE_UNDEFINED = 0, WINDOW_MODE_FULLSCREEN = 1, @@ -165,12 +300,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, @@ -178,11 +327,85 @@ 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, TYPE_DELETE = 3, TYPE_ASSERT = 4, } + + /** + * Indicates the state of continuation. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + */ + export enum ContinuationState { + LOCAL_RUNNING = 0, + REMOTE_RUNNING = 1, + REPLICA_RUNNING = 2 + } + + /** + * Indicates the data structure of lifecycle. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + */ + export enum LifecycleEvent { + UNDEFINED = 0, + ON_START = 1, + ON_INACTIVE = 2, + ON_ACTIVE = 3, + ON_BACKGROUND = 4, + ON_FOREGROUND = 5, + ON_STOP = 6 + } + + /** + * Collaboration status code. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + */ + export enum AssistantCode { + OK = 0, + ERR_UNCONNECTED = 1, + ERR_INVALID_PARAMETER = 2, + ERR_SYSTEM_ERROR = 3, + ERR_EVENT_HANDLER_IS_NOT_SET_UP = 4, + ERR_ABILITY_TYPE_NOT_SUPPORTED = 5, + ERR_SIGNATURE_IS_NOT_CONSISTENT = 6, + ERR_ABILITY_NOT_MATCHED = 7, + ERR_ABILITY_TERMINATED = 8, + ERR_DEVICE_OFFLINE = 9, + ERR_PROCESS_DIED = 10, + ERR_ABILITY_START_FAILED = 11, + ERR_VERSION_INCOMPATIBLE = 12, + ERR_DISTRIBUTED_COMMUNICATION_PERMISSION_DENIED = 13, + ERR_TIMEOUT = 14, + ERR_IN_ASSISTING_MODE = 15, + ERR_NETWORK_TYPE_NOT_SUPPORTED = 16 + } + + /** + * Indicates the connection status of Collaboration devices. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + */ + export enum DeviceConnectState { + IDLE = 0, + CONNECTING = 1, + CONNECTED = 2, + DISCONNECTING = 3 + } } export default featureAbility; diff --git a/api/@ohos.ability.formManager.d.ts b/api/@ohos.ability.formManager.d.ts new file mode 100644 index 0000000000..48c9c36c86 --- /dev/null +++ b/api/@ohos.ability.formManager.d.ts @@ -0,0 +1,548 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +import { Want } from './ability/want'; +import formBindingData from './@ohos.application.formBindingData'; + +/** + * Client to communication with FormManagerService. + * + * @name formManager + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ +declare namespace formManager { + /** + * update the given form. + * + *

You can use this method to update the given form

+ * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @permission ohos.permission.REQUIRE_FORM. + * @param formId Indicates the given form. + * @param formBindingData Indicates the form data. + * @return - + */ + function updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void; + function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; + + /** + * Provides information about a form. + * + * @name FormInfo + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + interface FormInfo { + /** + * Obtains the bundle name of the application to which this form belongs. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + bundleName: string; + + /** + * Obtains the name of the application module to which this form belongs. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + moduleName: string; + + /** + * Obtains the class name of the ability to which this form belongs. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + abilityName: string; + + /** + * Obtains the name of this form. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + name: string; + + /** + * Obtains the description of this form. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + description?: string; + + /** + * Obtains the type of this form. Currently, Java and JS forms are supported. + * a constant value, one of [FormType.JAVA, FormType.JS]. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + type: FormType; + + /** + * Obtains the JS component name of this JS form. + *

This method is valid only when the type of this form is JS.

+ * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + jsComponentName: string; + + /** + * Obtains the color mode of this form. + * A constant value, one of ColorMode.MODE_AUTO, ColorMode.MODE_DARK, ColorMode.MODE_LIGHT. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + colorMode: ColorMode; + + /** + * Checks whether this form is a default form. + *

A form is considered a default form if no form name is specified. Specifically, the system determines + * whether a form is a default form based on the value of the isDefault attribute defined under + * forms in the config.json file of the Harmony application.

+ * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + isDefault: boolean; + + /** + * Obtains whether notify visible of this form. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + formVisibleNotify: boolean; + + /** + * Obtains the form config ability about this form. + *

A form config ability is a user-defined ability.

+ * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + formConfigAbility: string; + + /** + * Obtains the default grid style of this form. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + defaultDimension: number; + + /** + * Obtains the grid styles supported by this form. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + supportDimensions: Array; + + /** + * Obtains the custom data defined in this form. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + customizeData: {[key: string]: [value: string]}; + + /** + * Indicates the compatibility object. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + * @default - + */ + jsonObject: object; + } + + /** + * Provides state information about a form. + * + * @name FormStateInfo + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + interface FormStateInfo { + /** + * Obtains the form state. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + formState: FormState; + + /** + * Obtains the want form . + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + want: Want; + } + + /** + * Provides state about a form. + * + * @name FormState + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + enum FormState { + /** + * Indicates that the form status is unknown due to an internal error. + * + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + UNKNOWN = -1, + + /** + * Indicates that the form is in the default state. + * + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + DEFAULT = 0, + + /** + * Indicates that the form is ready. + * + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + READY = 1, + } + + /** + * Type of form. + * + * @name FormType + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + enum FormType { + /** + * Java form. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + JAVA = 0, + + /** + * Js form. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + JS = 1 + } + + /** + * Visibility type of form. + * + * @name FormType + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + enum VisibilityType { + /** + * form visibility type. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + FORM_VISIBLE = 1, + + /** + * form invisibility type. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + FORM_INVISIBLE = 2 + } + + /** + * Error of form. + * + * @name FormError + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + enum FormError { + /** + * A common internal error occurs during form processing. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_COMMON = 1, + + /** + * The application does not have permission to use forms. + * Ensure that the application is granted with the ohos.permission.REQUIRE_FORM + * and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED permissions. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_PERMISSION_DENY = 2, + + /** + * Failed to obtain the configuration information about the form specified by the + * request parameters. Ensure that the parameters of the form to be added are + * consistent with those provided by the form provider. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_GET_INFO_FAILED = 4, + + /** + * Failed to obtain the bundle to which the form belongs based on the request parameters. + * Ensure that the bundle to which the form to be added belongs is available. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_GET_BUNDLE_FAILED = 5, + + /** + * Failed to initialize the form layout based on the request parameters. + * Ensure that the grid style of the form is supported by the form provider. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_GET_LAYOUT_FAILED = 6, + + /** + * Invalid input parameter during form operation. Ensure that all input + * parameters are valid. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_ADD_INVALID_PARAM = 7, + + /** + * The form configuration to be obtained using an existing form ID is + * different from that obtained for the first time. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_CFG_NOT_MATCH_ID = 8, + + /** + * The ID of the form to be operated does not exist in the Form Manager Service. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_NOT_EXIST_ID = 9, + + /** + * Failed to bind the Form Manager Service to the provider service. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_BIND_PROVIDER_FAILED = 10, + + /** + * The total number of added forms exceeds the maximum allowed by the system. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_MAX_SYSTEM_FORMS = 11, + + /** + * The number of form instances generated using the same form configuration + * exceeds the maximum allowed by the system. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_MAX_INSTANCES_PER_FORM = 12, + + /** + * The form being requested was added by other applications and cannot be + * operated by the current application. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_OPERATION_FORM_NOT_SELF = 13, + + /** + * The Form Manager Service failed to instruct the form provider to delete the form. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_PROVIDER_DEL_FAIL = 14, + + /** + * The total number of added forms exceeds the maximum per client. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_MAX_FORMS_PER_CLIENT = 15, + + /** + * The total number of added temp forms exceeds the maximum in system. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_MAX_SYSTEM_TEMP_FORMS = 16, + + /** + * The module can not be find in system. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_FORM_NO_SUCH_MODULE = 17, + + /** + * The ability can not be find in system. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_FORM_NO_SUCH_ABILITY = 18, + + /** + * The dimension is not exist in the form. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_FORM_NO_SUCH_DIMENSION = 19, + + /** + * The ability is not installed. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_FORM_FA_NOT_INSTALLED = 20, + + /** + * Failed to obtain the RPC object of the Form Manager Service because + * the service is not started.Please try again after the service is started. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_SYSTEM_RESPONSES_FAILED = 30, + + /** + * Failed to obtain the form requested by the client because another form + * with the same form ID is in use. Forms in use cannot have the same ID. + * To obtain and display a form that has the same configuration as an in-use + * form in the same application, you are advised to set the form ID to 0 in + * the request parameters. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_FORM_DUPLICATE_ADDED = 31, + + /** + * The form is being restored. Perform operations on the form only after + * the restoration is complete. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + ERR_IN_RECOVERY = 36 + } + + /** + * Color mode. + * + * @name ColorMode + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + enum ColorMode { + /** + * Automatic mode. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + MODE_AUTO = -1, + + /** + * Dark mode. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + MODE_DARK = 0, + + /** + * Light mode. + * + * @since 7 + * @syscap SystemCapability.Ability.FormRuntime.Core + */ + MODE_LIGHT = 1 + } +} +export default formManager; 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 9248cae899..c571dbe255 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/continuationExtraParams.d.ts b/api/ability/continuationExtraParams.d.ts new file mode 100644 index 0000000000..f2f571e86e --- /dev/null +++ b/api/ability/continuationExtraParams.d.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Indicates the description of additional parameters for continuation. + * + * @name ContinuationExtraParams + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ +export interface ContinuationExtraParams { + + /** + * Indicates the type of devices to be matched. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + devTypes?: Array; + + /** + * Indicates the bundle name of the target application where the ability will be hopped. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + targetBundle?: string; + + /** + * Indicates the description used for device filtering. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + description?: string; + + /** + * Indicates the custom JSON parameters to be used as filter conditions. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + jsonParams?: string; +} \ No newline at end of file diff --git a/api/ability/continuationResult.d.ts b/api/ability/continuationResult.d.ts new file mode 100644 index 0000000000..0183b21bb3 --- /dev/null +++ b/api/ability/continuationResult.d.ts @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Indicates the description of transfer results for continuation. + * + * @name ContinuationResult + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ +export interface ContinuationResult { + /** + * the information about the selected device id. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + id: string; + + /** + * the information about the selected device type. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + type: string; + + /** + * Indicates the name of the selected device. + * + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + name: string; +} \ No newline at end of file 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/activeServiceAbilityInfo.d.ts b/api/app/activeServiceAbilityInfo.d.ts new file mode 100644 index 0000000000..f689ef6c78 --- /dev/null +++ b/api/app/activeServiceAbilityInfo.d.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ElementName } from '../bundle/elementName'; + +/** + * @name information corresponding to active service ability + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityMissionInfo from 'app/activeServiceAbilityInfo' + * @permission N/A + */ +export interface ActiveServiceAbilityInfo { + /** + * @default process id + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + pid: number; + + /** + * @default user id + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + uid: number; + + /** + * @default the name of the process + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + processName: string; + + /** + * @default The element name of the service ability + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + serviceAbility: ElementName; +} + 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