From abddf878c6c7ee133651437043f4b90c9186d4be Mon Sep 17 00:00:00 2001 From: kukixi Date: Tue, 15 Mar 2022 12:46:44 +0800 Subject: [PATCH 1/6] add before APIs Signed-off-by: kukixi --- BUILD.gn | 1 + api/@internal/component/ets/hyperlink.d.ts | 43 +++ api/@internal/component/ets/index-full.d.ts | 1 + api/@internal/component/ets/video.d.ts | 19 +- api/common/@internal/featureability.d.ts | 392 ++++++++++++++++++++ 5 files changed, 455 insertions(+), 1 deletion(-) create mode 100644 api/@internal/component/ets/hyperlink.d.ts create mode 100644 api/common/@internal/featureability.d.ts diff --git a/BUILD.gn b/BUILD.gn index d0736d097f..646c34af58 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -60,6 +60,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/grid.d.ts", "api/@internal/component/ets/gridItem.d.ts", "api/@internal/component/ets/grid_container.d.ts", + "api/@internal/component/ets/hyperlink.d.ts", "api/@internal/component/ets/image.d.ts", "api/@internal/component/ets/image_animator.d.ts", "api/@internal/component/ets/index-full.d.ts", diff --git a/api/@internal/component/ets/hyperlink.d.ts b/api/@internal/component/ets/hyperlink.d.ts new file mode 100644 index 0000000000..40751b2d28 --- /dev/null +++ b/api/@internal/component/ets/hyperlink.d.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021 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. + */ + +/** + * Defines the hyperlink interface. + * @since 7 + */ +interface HyperlinkInterface { + /** + * Return to get Hyperlink. + * adress: Web page redirected by the hyperlink component. + * content: Hyperlinks in the hyperlink component display text. + * @since 7 + */ + (address: string | Resource, content?: string | Resource): HyperlinkAttribute; +} + +/** + * Defines the hyperlink attibute functions + * @since 7 + */ +declare class HyperlinkAttribute extends CommonMethod { + /** + * Set Color + * @since 7 + */ + color(value: Color | number | string | Resource): HyperlinkAttribute; +} + +declare const Hyperlink: HyperlinkInterface; +declare const HyperlinkInterface: HyperlinkAttribute; diff --git a/api/@internal/component/ets/index-full.d.ts b/api/@internal/component/ets/index-full.d.ts index 8375647981..25e737704e 100644 --- a/api/@internal/component/ets/index-full.d.ts +++ b/api/@internal/component/ets/index-full.d.ts @@ -44,6 +44,7 @@ /// /// /// +/// /// /// /// diff --git a/api/@internal/component/ets/video.d.ts b/api/@internal/component/ets/video.d.ts index b36823a36d..1672760d4b 100644 --- a/api/@internal/component/ets/video.d.ts +++ b/api/@internal/component/ets/video.d.ts @@ -98,7 +98,7 @@ declare interface VideoOptions { /** * preview uri of video. - * @since 8 + * @since 7 */ previewUri?: string | PixelMap | Resource; @@ -144,6 +144,18 @@ declare class VideoController { */ setCurrentTime(value: number); + /** + * Provides a full screen playback method. + * @since 7 + */ + requestFullscreen(value: boolean); + + /** + * Provides a method to exit full screen playback. + * @since 7 + */ + exitFullscreen(); + /** * Provide the progress method of video playback. * @since 8 @@ -216,6 +228,11 @@ declare class VideoAttribute extends CommonMethod { */ onFinish(event: () => void): VideoAttribute; + /** + * Called when the video enters and exits the full screen. + * @since 7 + */ + onFullscreenChange(callback: (event?: { fullscreen: boolean }) => void): VideoAttribute; /** * Called when the video preparation is complete. * @since 7 diff --git a/api/common/@internal/featureability.d.ts b/api/common/@internal/featureability.d.ts new file mode 100644 index 0000000000..42622715aa --- /dev/null +++ b/api/common/@internal/featureability.d.ts @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2020 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. + */ + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 5 + */ +export interface Result { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + data: object; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + */ +export interface SubscribeMessageResponse { + /** + * Peer device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the bundle where the peer ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Peer ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages received from the device. + * @since 5 + */ + message: string; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 5 + */ +export interface CallAbilityParam { + /** + * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + bundleName: string; + + /** + * Ability name, which is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + abilityName: string; + + /** + * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. + * @since 5 + */ + messageCode: number; + + /** + * Ability type. Different types of abilities have different implementation on the AA side. + * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. + * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. + * @since 5 + */ + abilityType: number; + + /** + * Data sent to the ability. The data to carry differs depending on the service to be processed and its field name must be consistent with the AA side. + * @since 5 + */ + data?: object; + + /** + * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. + * 0: Synchronous mode (default value) + * 1: Asynchronous mode + * @since 5 + */ + syncOption?: number; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 5 + */ +export interface SubscribeAbilityEventParam { + /** + * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + bundleName: string; + + /** + * Ability name, which is case sensitive and must be the same as that on the AA side. + * @since 5 + */ + abilityName: string; + + /** + * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. + * @since 5 + */ + messageCode: number; + + /** + * Ability type. Different types of abilities have different implementation on the AA side. + * 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background. + * 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs. + * @since 5 + */ + abilityType: number; + + /** + * Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities. + * 0: Synchronous mode (default value) + * 1: Asynchronous mode + * @since 5 + */ + syncOption?: number; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + */ +export interface SendMessageOptions { + /** + * Destination device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the destination bundle where the ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Destination ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages sent to the destination device. + * A maximum of 1 KB of data can be transmitted at a time. + * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. + * @since 5 + */ + message?: string; + + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: () => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 5 + */ + complete?: () => void; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + */ +export interface SubscribeMessageOptions { + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: (data: SubscribeMessageResponse) => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 5 + */ +export interface RequestParams { + /** + * The name of the bundle to start. It should be used with abilityname and case sensitive. + * @since 5 + */ + bundleName?: string; + + /** + * Ability name, which is case sensitive. + */ + abilityName?: string; + + /** + * The list of entities to which the FA to be called. If it is not filled in, all entity lists will be found by default. It should be used with action. + * @since 5 + */ + entities?: Array; + + /** + * Without specifying the bundle name and ability name, you can start the application according to other properties with action. + * @since 5 + */ + action?: string; + + /** + * If more than one FA meets the conditions, the user can select the device from the popup. + * 0: Default. Select the FA to start from the local and remote devices. + * 1: start FA from the local device. + * @since 5 + */ + deviceType?: number; + + /** + * Data sent to the ability which need to be serializable. + * @since 5 + */ + data?: object; + + /** + * Configuration switch when start FA. + * @since 5 + */ + flag?: number; + + /** + * Specify the url of the page which the FA to be called. Use home page directly by default. + * @since 5 + */ + url?: string; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 5 + */ +export interface FinishWithResultParams { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + result: object; +} + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + */ +export declare class FeatureAbility { + /** + * Start a FA without callback result. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. + * @since 5 + */ + static startAbility(request: RequestParams): Promise; + + /** + * Start a FA with callback result. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result of the data FA returned. + * @since 5 + */ + static startAbilityForResult(request: RequestParams): Promise; + + /** + * FA call the interface to destory itself and set the result as parameters. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param request Indicates the request param. + * @returns A Promise object is returned, which contains the result whether to callback successfully. + * @since 5 + */ + static finishWithResult(param: FinishWithResultParams): Promise; + + /** + + * Get device information list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param flag Default 0, get the information list of all devices in the network. + * @returns A Promise object is returned, which contains the result whether the device information list is obtained successfully. + * @since 5 + */ + static getDeviceList(flag: number): Promise; + + /** + + * Calls an AA. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param param Indicates the request param. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + */ + static callAbility(param: CallAbilityParam): Promise; + + /** + * Start FA migration. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + */ + static continueAbility(): Promise; + + /** + * Subscribes to events of an AA. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param param Indicates the request param. + * @param func Indicates the event reporting callback. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + */ + static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; + + /** + * Unsubscribes from events of an AA. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @param param Indicates the request param. + * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. + * @since 5 + */ + static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; + + /** + * Sends messages to the destination device. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @param options Options. + * @since 5 + */ + static sendMsg(options: SendMessageOptions): void; + + /** + * Listens for messages sent from other devices. + * @param options Options. + * @devices liteWearable + * @since 5 + */ + static subscribeMsg(options: SubscribeMessageOptions): void; + + /** + * Cancels the listening for messages sent from other devices. + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @since 5 + */ + static unsubscribeMsg(): void; +} -- Gitee From 87b4401e92ece4aff6e24e6e72709ce3b21155e5 Mon Sep 17 00:00:00 2001 From: kukixi Date: Tue, 15 Mar 2022 16:19:27 +0800 Subject: [PATCH 2/6] add syscap Signed-off-by: kukixi --- api/common/@internal/featureability.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/common/@internal/featureability.d.ts b/api/common/@internal/featureability.d.ts index 42622715aa..24a697ca2e 100644 --- a/api/common/@internal/featureability.d.ts +++ b/api/common/@internal/featureability.d.ts @@ -377,8 +377,8 @@ export declare class FeatureAbility { /** * Listens for messages sent from other devices. + * @syscap SystemCapability.ArkUI.ArkUI.Lite * @param options Options. - * @devices liteWearable * @since 5 */ static subscribeMsg(options: SubscribeMessageOptions): void; -- Gitee From b776ce494163dfd1f6f775272ae50197851ad4ab Mon Sep 17 00:00:00 2001 From: kukixi Date: Tue, 15 Mar 2022 18:12:37 +0800 Subject: [PATCH 3/6] add feature ability at litewearable Signed-off-by: kukixi --- api/common/@internal/featureability.d.ts | 20 --- api/common/@internal/global.d.ts | 9 ++ .../@internal/featureability.d.ts | 134 ++++++++++++++++++ api/liteWearable/@internal/global.d.ts | 9 ++ 4 files changed, 152 insertions(+), 20 deletions(-) create mode 100644 api/liteWearable/@internal/featureability.d.ts diff --git a/api/common/@internal/featureability.d.ts b/api/common/@internal/featureability.d.ts index 24a697ca2e..f886be15b6 100644 --- a/api/common/@internal/featureability.d.ts +++ b/api/common/@internal/featureability.d.ts @@ -14,7 +14,6 @@ */ /** - * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 5 */ export interface Result { @@ -32,7 +31,6 @@ export interface Result { } /** - * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 5 */ export interface SubscribeMessageResponse { @@ -62,7 +60,6 @@ export interface SubscribeMessageResponse { } /** - * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 5 */ export interface CallAbilityParam { @@ -108,7 +105,6 @@ export interface CallAbilityParam { } /** - * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 5 */ export interface SubscribeAbilityEventParam { @@ -148,7 +144,6 @@ export interface SubscribeAbilityEventParam { } /** - * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 5 */ export interface SendMessageOptions { @@ -198,7 +193,6 @@ export interface SendMessageOptions { } /** - * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 5 */ export interface SubscribeMessageOptions { @@ -216,7 +210,6 @@ export interface SubscribeMessageOptions { } /** - * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 5 */ export interface RequestParams { @@ -271,7 +264,6 @@ export interface RequestParams { } /** - * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 5 */ export interface FinishWithResultParams { @@ -289,13 +281,11 @@ export interface FinishWithResultParams { } /** - * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 5 */ export declare class FeatureAbility { /** * Start a FA without callback result. - * @syscap SystemCapability.ArkUI.ArkUI.Full * @param request Indicates the request param. * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. * @since 5 @@ -304,7 +294,6 @@ export declare class FeatureAbility { /** * Start a FA with callback result. - * @syscap SystemCapability.ArkUI.ArkUI.Full * @param request Indicates the request param. * @returns A Promise object is returned, which contains the result of the data FA returned. * @since 5 @@ -313,7 +302,6 @@ export declare class FeatureAbility { /** * FA call the interface to destory itself and set the result as parameters. - * @syscap SystemCapability.ArkUI.ArkUI.Full * @param request Indicates the request param. * @returns A Promise object is returned, which contains the result whether to callback successfully. * @since 5 @@ -323,7 +311,6 @@ export declare class FeatureAbility { /** * Get device information list. - * @syscap SystemCapability.ArkUI.ArkUI.Full * @param flag Default 0, get the information list of all devices in the network. * @returns A Promise object is returned, which contains the result whether the device information list is obtained successfully. * @since 5 @@ -333,7 +320,6 @@ export declare class FeatureAbility { /** * Calls an AA. - * @syscap SystemCapability.ArkUI.ArkUI.Full * @param param Indicates the request param. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @since 5 @@ -342,7 +328,6 @@ export declare class FeatureAbility { /** * Start FA migration. - * @syscap SystemCapability.ArkUI.ArkUI.Full * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @since 5 */ @@ -350,7 +335,6 @@ export declare class FeatureAbility { /** * Subscribes to events of an AA. - * @syscap SystemCapability.ArkUI.ArkUI.Full * @param param Indicates the request param. * @param func Indicates the event reporting callback. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. @@ -360,7 +344,6 @@ export declare class FeatureAbility { /** * Unsubscribes from events of an AA. - * @syscap SystemCapability.ArkUI.ArkUI.Full * @param param Indicates the request param. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @since 5 @@ -369,7 +352,6 @@ export declare class FeatureAbility { /** * Sends messages to the destination device. - * @syscap SystemCapability.ArkUI.ArkUI.Lite * @param options Options. * @since 5 */ @@ -377,7 +359,6 @@ export declare class FeatureAbility { /** * Listens for messages sent from other devices. - * @syscap SystemCapability.ArkUI.ArkUI.Lite * @param options Options. * @since 5 */ @@ -385,7 +366,6 @@ export declare class FeatureAbility { /** * Cancels the listening for messages sent from other devices. - * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 5 */ static unsubscribeMsg(): void; diff --git a/api/common/@internal/global.d.ts b/api/common/@internal/global.d.ts index 23fe8c0eb5..a51fbd09c4 100644 --- a/api/common/@internal/global.d.ts +++ b/api/common/@internal/global.d.ts @@ -51,6 +51,15 @@ export declare function clearInterval(intervalID?: number): void; */ export declare function clearTimeout(timeoutID?: number): void; +/** + * Get the java interface instance. The java instance needs to register, otherwise it cannot be obtained. + * After obtaining the instance, you can call the function with the same name on the Java side. + * @param name Java interface name, including package path, such as com.example.test.timeinterfaceimpl. + * @returns A promise object is returned. The resolve callback is the object of PA. The reject callback returns the object containing code and error data. + * @since 5 + */ +export declare function createLocalParticleAbility(name?: string): any; + /** * Defining syscap function. * @since 8 diff --git a/api/liteWearable/@internal/featureability.d.ts b/api/liteWearable/@internal/featureability.d.ts new file mode 100644 index 0000000000..1e9fac667e --- /dev/null +++ b/api/liteWearable/@internal/featureability.d.ts @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2020 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. + */ + +/** + * @since 5 + */ +export interface SubscribeMessageResponse { + /** + * Peer device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the bundle where the peer ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Peer ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages received from the device. + * @since 5 + */ + message: string; +} + +/** + * @since 5 + */ +export interface SendMessageOptions { + /** + * Destination device ID. + * @since 5 + */ + deviceId: string; + + /** + * Name of the destination bundle where the ability locates. The name is case sensitive. + * @since 5 + */ + bundleName: string; + + /** + * Destination ability name, which is case sensitive. + * @since 5 + */ + abilityName: string; + + /** + * Messages sent to the destination device. + * A maximum of 1 KB of data can be transmitted at a time. + * If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit. + * @since 5 + */ + message?: string; + + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: () => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 5 + */ + complete?: () => void; +} + +/** + * @since 5 + */ +export interface SubscribeMessageOptions { + /** + * Called when the messages are sent successfully. + * @since 5 + */ + success?: (data: SubscribeMessageResponse) => void; + + /** + * Called when the messages fail to be sent. + * @since 5 + */ + fail?: (data: string, code: number) => void; +} + +/** + * @since 5 + */ +export declare class FeatureAbility { + /** + * Sends messages to the destination device. + * @param options Options. + * @since 5 + */ + static sendMsg(options: SendMessageOptions): void; + + /** + * Listens for messages sent from other devices. + * @param options Options. + * @since 5 + */ + static subscribeMsg(options: SubscribeMessageOptions): void; + + /** + * Cancels the listening for messages sent from other devices. + * @since 5 + */ + static unsubscribeMsg(): void; +} diff --git a/api/liteWearable/@internal/global.d.ts b/api/liteWearable/@internal/global.d.ts index f0013e4bfc..6bffe18a1a 100644 --- a/api/liteWearable/@internal/global.d.ts +++ b/api/liteWearable/@internal/global.d.ts @@ -51,6 +51,15 @@ export declare function clearInterval(intervalID?: number): void; */ export declare function clearTimeout(timeoutID?: number): void; +/** + * Get the java interface instance. The java instance needs to register, otherwise it cannot be obtained. + * After obtaining the instance, you can call the function with the same name on the Java side. + * @param name Java interface name, including package path, such as com.example.test.timeinterfaceimpl. + * @returns A promise object is returned. The resolve callback is the object of PA. The reject callback returns the object containing code and error data. + * @since 5 + */ +export declare function createLocalParticleAbility(name?: string): any; + /** * Conditional compilation for rich equipment */ -- Gitee From a8ee698c8471ceab37d44c431f2175663912aa39 Mon Sep 17 00:00:00 2001 From: kukixi Date: Tue, 15 Mar 2022 19:24:36 +0800 Subject: [PATCH 4/6] add featureability.d.ts to BUILD.gn Signed-off-by: kukixi --- BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BUILD.gn b/BUILD.gn index 646c34af58..17eb962a9b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -168,6 +168,7 @@ ohos_copy("internal_full") { "api/common/@internal/global.d.ts", "api/common/@internal/index.d.ts", "api/common/@internal/viewmodel.d.ts", + "api/common/@internal/featureability.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" @@ -180,6 +181,7 @@ ohos_copy("internal_lite") { "api/liteWearable/@internal/global.d.ts", "api/liteWearable/@internal/index.d.ts", "api/liteWearable/@internal/viewmodel.d.ts", + "api/liteWearable/@internal/featureability.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" -- Gitee From 72a2896d75992338ce289c29400888ec847c0a37 Mon Sep 17 00:00:00 2001 From: kukixi Date: Tue, 15 Mar 2022 20:52:46 +0800 Subject: [PATCH 5/6] format BUILD.gn Signed-off-by: kukixi --- BUILD.gn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 17eb962a9b..a87d5d4aff 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -165,10 +165,10 @@ ohos_declaration_template("ohos_declaration_common") { ohos_copy("internal_full") { sources = [ "api/common/@internal/console.d.ts", + "api/common/@internal/featureability.d.ts", "api/common/@internal/global.d.ts", "api/common/@internal/index.d.ts", "api/common/@internal/viewmodel.d.ts", - "api/common/@internal/featureability.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" @@ -178,10 +178,10 @@ ohos_copy("internal_full") { ohos_copy("internal_lite") { sources = [ "api/liteWearable/@internal/console.d.ts", + "api/liteWearable/@internal/featureability.d.ts", "api/liteWearable/@internal/global.d.ts", "api/liteWearable/@internal/index.d.ts", "api/liteWearable/@internal/viewmodel.d.ts", - "api/liteWearable/@internal/featureability.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" -- Gitee From 2383aa36d36222436662be2cc17c2944dd9727e7 Mon Sep 17 00:00:00 2001 From: kukixi Date: Wed, 16 Mar 2022 09:42:49 +0800 Subject: [PATCH 6/6] @deprecated featureability at API8 Signed-off-by: kukixi --- api/common/@internal/featureability.d.ts | 21 +++++++++++++++++++ .../@internal/featureability.d.ts | 7 +++++++ 2 files changed, 28 insertions(+) diff --git a/api/common/@internal/featureability.d.ts b/api/common/@internal/featureability.d.ts index f886be15b6..1827ba6cc2 100644 --- a/api/common/@internal/featureability.d.ts +++ b/api/common/@internal/featureability.d.ts @@ -15,6 +15,7 @@ /** * @since 5 + * @deprecated since 8 */ export interface Result { /** @@ -32,6 +33,7 @@ export interface Result { /** * @since 5 + * @deprecated since 8 */ export interface SubscribeMessageResponse { /** @@ -61,6 +63,7 @@ export interface SubscribeMessageResponse { /** * @since 5 + * @deprecated since 8 */ export interface CallAbilityParam { /** @@ -106,6 +109,7 @@ export interface CallAbilityParam { /** * @since 5 + * @deprecated since 8 */ export interface SubscribeAbilityEventParam { /** @@ -145,6 +149,7 @@ export interface SubscribeAbilityEventParam { /** * @since 5 + * @deprecated since 8 */ export interface SendMessageOptions { /** @@ -194,6 +199,7 @@ export interface SendMessageOptions { /** * @since 5 + * @deprecated since 8 */ export interface SubscribeMessageOptions { /** @@ -211,6 +217,7 @@ export interface SubscribeMessageOptions { /** * @since 5 + * @deprecated since 8 */ export interface RequestParams { /** @@ -221,6 +228,7 @@ export interface RequestParams { /** * Ability name, which is case sensitive. + * @since 5 */ abilityName?: string; @@ -265,6 +273,7 @@ export interface RequestParams { /** * @since 5 + * @deprecated since 8 */ export interface FinishWithResultParams { /** @@ -282,6 +291,7 @@ export interface FinishWithResultParams { /** * @since 5 + * @deprecated since 8 */ export declare class FeatureAbility { /** @@ -289,6 +299,7 @@ export declare class FeatureAbility { * @param request Indicates the request param. * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. * @since 5 + * @deprecated since 8 */ static startAbility(request: RequestParams): Promise; @@ -297,6 +308,7 @@ export declare class FeatureAbility { * @param request Indicates the request param. * @returns A Promise object is returned, which contains the result of the data FA returned. * @since 5 + * @deprecated since 8 */ static startAbilityForResult(request: RequestParams): Promise; @@ -305,6 +317,7 @@ export declare class FeatureAbility { * @param request Indicates the request param. * @returns A Promise object is returned, which contains the result whether to callback successfully. * @since 5 + * @deprecated since 8 */ static finishWithResult(param: FinishWithResultParams): Promise; @@ -314,6 +327,7 @@ export declare class FeatureAbility { * @param flag Default 0, get the information list of all devices in the network. * @returns A Promise object is returned, which contains the result whether the device information list is obtained successfully. * @since 5 + * @deprecated since 8 */ static getDeviceList(flag: number): Promise; @@ -323,6 +337,7 @@ export declare class FeatureAbility { * @param param Indicates the request param. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @since 5 + * @deprecated since 8 */ static callAbility(param: CallAbilityParam): Promise; @@ -330,6 +345,7 @@ export declare class FeatureAbility { * Start FA migration. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @since 5 + * @deprecated since 8 */ static continueAbility(): Promise; @@ -339,6 +355,7 @@ export declare class FeatureAbility { * @param func Indicates the event reporting callback. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @since 5 + * @deprecated since 8 */ static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; @@ -347,6 +364,7 @@ export declare class FeatureAbility { * @param param Indicates the request param. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @since 5 + * @deprecated since 8 */ static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; @@ -354,6 +372,7 @@ export declare class FeatureAbility { * Sends messages to the destination device. * @param options Options. * @since 5 + * @deprecated since 8 */ static sendMsg(options: SendMessageOptions): void; @@ -361,12 +380,14 @@ export declare class FeatureAbility { * Listens for messages sent from other devices. * @param options Options. * @since 5 + * @deprecated since 8 */ static subscribeMsg(options: SubscribeMessageOptions): void; /** * Cancels the listening for messages sent from other devices. * @since 5 + * @deprecated since 8 */ static unsubscribeMsg(): void; } diff --git a/api/liteWearable/@internal/featureability.d.ts b/api/liteWearable/@internal/featureability.d.ts index 1e9fac667e..9726fa6eed 100644 --- a/api/liteWearable/@internal/featureability.d.ts +++ b/api/liteWearable/@internal/featureability.d.ts @@ -15,6 +15,7 @@ /** * @since 5 + * @deprecated since 8 */ export interface SubscribeMessageResponse { /** @@ -44,6 +45,7 @@ export interface SubscribeMessageResponse { /** * @since 5 + * @deprecated since 8 */ export interface SendMessageOptions { /** @@ -93,6 +95,7 @@ export interface SendMessageOptions { /** * @since 5 + * @deprecated since 8 */ export interface SubscribeMessageOptions { /** @@ -110,12 +113,14 @@ export interface SubscribeMessageOptions { /** * @since 5 + * @deprecated since 8 */ export declare class FeatureAbility { /** * Sends messages to the destination device. * @param options Options. * @since 5 + * @deprecated since 8 */ static sendMsg(options: SendMessageOptions): void; @@ -123,12 +128,14 @@ export declare class FeatureAbility { * Listens for messages sent from other devices. * @param options Options. * @since 5 + * @deprecated since 8 */ static subscribeMsg(options: SubscribeMessageOptions): void; /** * Cancels the listening for messages sent from other devices. * @since 5 + * @deprecated since 8 */ static unsubscribeMsg(): void; } -- Gitee