diff --git a/BUILD.gn b/BUILD.gn index f120e5ee08a451dfc3befbfb41b3c6d9f562ae6c..735000f5be05504a381da91de572826d9c6d021b 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", @@ -165,6 +166,7 @@ ohos_copy("internal_full") { sources = [ "api/common/full/console.d.ts", "api/common/full/dom.d.ts", + "api/common/full/featureability.d.ts", "api/common/full/global.d.ts", "api/common/full/index.d.ts", "api/common/full/viewmodel.d.ts", @@ -177,6 +179,7 @@ ohos_copy("internal_full") { ohos_copy("internal_lite") { sources = [ "api/common/lite/console.d.ts", + "api/common/lite/featureability.d.ts", "api/common/lite/global.d.ts", "api/common/lite/index.d.ts", "api/common/lite/viewmodel.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 0000000000000000000000000000000000000000..40751b2d28b0228f41b5266b250b72122e8cc0e6 --- /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 837564798187d813417d51a49edc57caafbb9b16..25e737704ec1431e8d9a54197941dfc40709c9f0 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 b36823a36d1932125f91f8bc7c21eb851b4ca90d..1672760d4bdd348513d46b9c2fcacd842593e3e0 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 0000000000000000000000000000000000000000..1827ba6cc2d3fd01b2adbe824560fba9b8570d60 --- /dev/null +++ b/api/common/@internal/featureability.d.ts @@ -0,0 +1,393 @@ +/* + * 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 + * @deprecated since 8 + */ +export interface Result { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + data: object; +} + +/** + * @since 5 + * @deprecated since 8 + */ +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 + * @deprecated since 8 + */ +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; +} + +/** + * @since 5 + * @deprecated since 8 + */ +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; +} + +/** + * @since 5 + * @deprecated since 8 + */ +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 + * @deprecated since 8 + */ +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 + * @deprecated since 8 + */ +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. + * @since 5 + */ + 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; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export interface FinishWithResultParams { + /** + * Result code. + * @since 5 + */ + code: number; + + /** + * Returned data. + * @since 5 + */ + result: object; +} + +/** + * @since 5 + * @deprecated since 8 + */ +export declare class FeatureAbility { + /** + * Start a FA without callback result. + * @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; + + /** + * Start a FA with callback result. + * @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; + + /** + * FA call the interface to destory itself and set the result as parameters. + * @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; + + /** + + * Get device information list. + * @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; + + /** + + * Calls an AA. + * @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; + + /** + * 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; + + /** + * Subscribes to events of an AA. + * @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 + * @deprecated since 8 + */ + static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; + + /** + * Unsubscribes from events of an AA. + * @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; + + /** + * Sends messages to the destination device. + * @param options Options. + * @since 5 + * @deprecated since 8 + */ + static sendMsg(options: SendMessageOptions): void; + + /** + * 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/common/full/global.d.ts b/api/common/full/global.d.ts index a4e0509c1188e90def85ad0bc3980b1112d06858..87ac2dedd5a9ed057859c8412471c42f4a055088 100644 --- a/api/common/full/global.d.ts +++ b/api/common/full/global.d.ts @@ -67,6 +67,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/common/lite/global.d.ts b/api/common/lite/global.d.ts index 343958fdad1ee8c7d637ad20e16f218c194a9783..6cbf02151395406fda488f085ae8688f813538d3 100644 --- a/api/common/lite/global.d.ts +++ b/api/common/lite/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 */ diff --git a/api/liteWearable/@internal/featureability.d.ts b/api/liteWearable/@internal/featureability.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9726fa6eed5953db9e174f35723a1608de172551 --- /dev/null +++ b/api/liteWearable/@internal/featureability.d.ts @@ -0,0 +1,141 @@ +/* + * 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 + * @deprecated since 8 + */ +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 + * @deprecated since 8 + */ +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 + * @deprecated since 8 + */ +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 + * @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; + + /** + * 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; +}