diff --git a/api/common/@internal/featureability.d.ts b/api/common/@internal/featureability.d.ts deleted file mode 100644 index ef50dbd4279017d74cefe1573086d1c2d6dae3cb..0000000000000000000000000000000000000000 --- a/api/common/@internal/featureability.d.ts +++ /dev/null @@ -1,352 +0,0 @@ -/* - * 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. - */ - -/** - * @devices tv, phone, tablet, wearable - */ -export interface Result { - /** - * Result code. - * @devices tv, phone, tablet, wearable - */ - code: number; - - /** - * Returned data. - * @devices tv, phone, tablet, wearable - */ - data: object; -} - -/** - * @devices liteWearable - */ -export interface SubscribeMessageResponse { - /** - * Peer device ID. - * @devices liteWearable - */ - deviceId: string; - - /** - * Name of the bundle where the peer ability locates. The name is case sensitive. - * @devices liteWearable - */ - bundleName: string; - - /** - * Peer ability name, which is case sensitive. - * @devices liteWearable - */ - abilityName: string; - - /** - * Messages received from the device. - * @devices liteWearable - */ - message: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -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. - * @devices tv, phone, tablet, wearable - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - * @devices tv, phone, tablet, wearable - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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 - * @devices tv, phone, tablet, wearable - */ - syncOption?: number; -} - -/** - * @devices tv, phone, tablet, wearable - */ -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. - * @devices tv, phone, tablet, wearable - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - * @devices tv, phone, tablet, wearable - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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 - * @devices tv, phone, tablet, wearable - */ - syncOption?: number; -} - -/** - * @devices liteWearable - */ -export interface SendMessageOptions { - /** - * Destination device ID. - * @devices liteWearable - */ - deviceId: string; - - /** - * Name of the destination bundle where the ability locates. The name is case sensitive. - * @devices liteWearable - */ - bundleName: string; - - /** - * Destination ability name, which is case sensitive. - * @devices liteWearable - */ - 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. - * @devices liteWearable - */ - message?: string; - - /** - * Called when the messages are sent successfully. - * @devices liteWearable - */ - success?: () => void; - - /** - * Called when the messages fail to be sent. - * @devices liteWearable - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices liteWearable - */ - complete?: () => void; -} - -/** - * @devices liteWearable - */ -export interface SubscribeMessageOptions { - /** - * Called when the messages are sent successfully. - * @devices liteWearable - */ - success?: (data: SubscribeMessageResponse) => void; - - /** - * Called when the messages fail to be sent. - * @devices liteWearable - */ - fail?: (data: string, code: number) => void; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface RequestParams { - /** - * The name of the bundle to start. It should be used with abilityname and case sensitive. - * @devices tv, phone, tablet, wearable - */ - bundleName?: string; - /** - * Ability name, which is case sensitive. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - entities?: Array; - /** - * Without specifying the bundle name and ability name, you can start the application according to other properties with action. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - deviceType?: number; - /** - * Data sent to the ability which need to be serializable. - * @devices tv, phone, tablet, wearable - */ - data?: object; - /** - * Configuration switch when start FA. - * @devices tv, phone, tablet, wearable - */ - flag?: number; - /** - * Specify the url of the page which the FA to be called. Use home page directly by default. - * @devices tv, phone, tablet, wearable - */ - url?: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface FinishWithResultParams { - /** - * Result code. - * @devices tv, phone, tablet, wearable - */ - code: number; - - /** - * Returned data. - * @devices tv, phone, tablet, wearable - */ - result: object; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - static finishWithResult(param: FinishWithResultParams): 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - static unsubscribeAbilityEvent( - param: SubscribeAbilityEventParam - ): Promise; - - /** - * Sends messages to the destination device. - * @param options Options. - * @devices liteWearable - */ - static sendMsg(options: SendMessageOptions): void; - - /** - * Listens for messages sent from other devices. - * @param options Options. - * @devices liteWearable - */ - static subscribeMsg(options: SubscribeMessageOptions): void; - - /** - * Cancels the listening for messages sent from other devices. - * @devices liteWearable - */ - static unsubscribeMsg(): void; -} diff --git a/api/common/@internal/global.d.ts b/api/common/@internal/global.d.ts index 5bedb79596f770fe7de03dcf7bece3377dc8a25c..04876c20ffb88c2edbbdbf7af2909af7ff31adc5 100644 --- a/api/common/@internal/global.d.ts +++ b/api/common/@internal/global.d.ts @@ -51,32 +51,6 @@ 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 - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ -export declare function createLocalParticleAbility(name?: string): any; - -/** - * Sets a vsync after which a function will be executed. - * @param handler Indicates the function to be called when the vsync trigger. - * @devices tv, phone, tablet, wearable - * @since 3 - */ -export declare function requestAnimationFrame(handler: Function): number; - -/** - * Cancels the vsync callback set by "requestAnimationFrame()". - * @param requestId Indicates the vsync callback ID returned by "requestAnimationFrame()". - * @devices tv, phone, tablet, wearable - * @since 3 - */ -export declare function cancelAnimationFrame(requestId: number): void; - /** * Obtain the objects exposed in app.js * @devices tv, phone, tablet, wearable, smartVision diff --git a/api/common/@system.app.d.ts b/api/common/@system.app.d.ts index e27ce0ba5abeee1d73392f82674d28872a4b229e..dc37ca1fd62908e94774e9dc46e59bc0aeb7f72a 100644 --- a/api/common/@system.app.d.ts +++ b/api/common/@system.app.d.ts @@ -46,19 +46,6 @@ export interface AppResponse { versionCode: number; } -/** - * @devices phone, tablet - */ -export interface RequestFullWindowOptions { - /** - * Duration for transition from non-full window to full window, in milliseconds. - * By default, the value is in direct proportion to the distance between the non-full window and the full window. - * @devices phone, tablet - * @since 3 - */ - duration?: number -} - /** * @devices wearable, liteWearable */ @@ -108,13 +95,6 @@ export default class App { */ static terminate(): void; - /** - * Keeps the application visible after the screen is woken up. - * This method prevents the system from returning to the home screen when the screen is locked. - * @devices wearable, liteWearable - */ - static screenOnVisible(options?: ScreenOnVisibleOptions): void; - /** * Requests the application to run in full window. * In some scenarios, such as semi-modal FA, the FA runs in non-full window. @@ -125,28 +105,4 @@ export default class App { * @devices phone, tablet */ static requestFullWindow(options?: RequestFullWindowOptions): void; - - /** - * Set image cache capacity of decoded image count. - * If not set, the application will not cache any decoded image. - * @param value capacity of decoded image count - * @devices tv, phone, tablet, wearable - */ - static setImageCacheCount(value: number): void; - - /** - * Set image cache capacity of raw image data size in Bytes before decode. - * If not set, the application will not cache any raw image data. - * @param value capacity of raw image data size in Bytes. - * @devices tv, phone, tablet, wearable - */ - static setImageRawDataCacheSize(value: number): void; - - /** - * Set image file cache size in Bytes on disk before decode. - * If not set, the application will not cache 100MB image files on disk. - * @param value capacity of image file size in Bytes. - * @devices tv, phone, tablet, wearable - */ - static setImageFileCacheSize(value: number): void; } diff --git a/api/common/@system.battery.d.ts b/api/common/@system.battery.d.ts deleted file mode 100644 index d02b700e0805735f68a8d144b9e88627aac46736..0000000000000000000000000000000000000000 --- a/api/common/@system.battery.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ - -/** - * @devices phone, tablet, wearable, liteWearable - */ -export interface BatteryResponse { - /** - * Whether the battery is being charged - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - charging: boolean; - - /** - * Current battery level, which ranges from 0.00 to 1.00 - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - level: number; -} - -/** - * @devices phone, tablet, wearable, liteWearable - */ -export interface GetStatusOptions { - /** - * Called when the current charging state and battery level are obtained. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - success?: (data: BatteryResponse) => void; - - /** - * Called when the current charging state and battery level fail to be obtained. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices phone, tablet, wearable, liteWearable - */ -export default class Battery { - /** - * Obtains the current charging state and battery level. - * @param options Options. - * @devices phone, tablet, wearable, liteWearable - */ - static getStatus(options?: GetStatusOptions): void; -} diff --git a/api/common/@system.brightness.d.ts b/api/common/@system.brightness.d.ts deleted file mode 100644 index 56b267086ccebae1dceb311ae955f4cf0f313771..0000000000000000000000000000000000000000 --- a/api/common/@system.brightness.d.ts +++ /dev/null @@ -1,233 +0,0 @@ -/* - * 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. - */ - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface BrightnessResponse { - /** - * Screen brightness, which ranges from 1 to 255. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - value: number; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface GetBrightnessOptions { - /** - * Called when the current screen brightness is obtained. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - success?: (data: BrightnessResponse) => void; - - /** - * Called when the current screen brightness fails to be obtained. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface SetBrightnessOptions { - /** - * Screen brightness. The value is an integer ranging from 1 to 255. - * If the value is less than or equal to 0, value 1 will be used. - * If the value is greater than 255, value 255 will be used. - * If the value contains decimals, the integral part of the value will be used. - * For example, if value 8.1 is set, value 8 will be used. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - value: number; - - /** - * Called when the setting is successful. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution os completed. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -export interface BrightnessModeResponse { - /** - * The value can be 0 or 1. - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: number; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface GetBrightnessModeOptions { - /** - * Called when the screen brightness adjustment mode is obtained. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - success?: (data: BrightnessModeResponse) => void; - - /** - * Called when the screen brightness adjustment mode fails to be obtained. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface SetBrightnessModeOptions { - /** - * The screen brightness mode. - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - mode: number; - - /** - * Called when the setting is successful. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface SetKeepScreenOnOptions { - /** - * Whether to always keep the screen on. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - keepScreenOn: boolean; - - /** - * Called when the setting is successful. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export default class Brightness { - /** - * Obtains the current screen brightness. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static getValue(options?: GetBrightnessOptions): void; - - /** - * Sets the screen brightness. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static setValue(options: SetBrightnessOptions): void; - - /** - * Obtains the screen brightness adjustment mode. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static getMode(options?: GetBrightnessModeOptions): void; - - /** - * Sets the screen brightness adjustment mode. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static setMode(options: SetBrightnessModeOptions): void; - - /** - * Sets whether to always keep the screen on. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static setKeepScreenOn(options: SetKeepScreenOnOptions): void; -} diff --git a/api/common/@system.device.d.ts b/api/common/@system.device.d.ts deleted file mode 100644 index 052a39869834d6102b74e84b3efbb06197697392..0000000000000000000000000000000000000000 --- a/api/common/@system.device.d.ts +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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. - */ - -/** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ -export interface DeviceResponse { - /** - * Brand. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - brand: string; - - /** - * Manufacturer. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - manufacturer: string; - - /** - * Model. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - model: string; - - /** - * Product number. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - product: string; - - /** - * System language. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 4 - */ - language: string; - - /** - * System region. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 4 - */ - region: string; - - /** - * Window width. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - windowWidth: number; - - /** - * Window Height. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - windowHeight: number; - - /** - * Screen density. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 4 - */ - screenDensity: number; - - /** - * Screen shape. The options are as follows: - * rect: Rectangle screen. - * circle: Circle screen. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 4 - */ - screenShape: "rect" | "circle"; - - /** - * API version. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - apiVersion: number; - - /** - * Device type. The options are as follows: - * phone: smartphone - * tablet: tablet - * tv: smart TV - * wearable: wearable - * liteWearable: lite wearable - * ar: AR - * vr: virtual reality - * earphones: headset - * speaker: speaker - * smartVision: smart visual device - * linkIoT: connection module - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - deviceType: string; -} - -export interface GetDeviceOptions { - /** - * Called when the device information is obtained. - * @since 3 - */ - success?: (data: DeviceResponse) => void; - - /** - * Called when the device information fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ -export default class Device { - /** - * Obtains the device information. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static getInfo(options?: GetDeviceOptions): void; -} diff --git a/api/common/@system.fetch.d.ts b/api/common/@system.fetch.d.ts deleted file mode 100644 index 539ff51c4d025e3125bc872b08aa5d0b8df699a1..0000000000000000000000000000000000000000 --- a/api/common/@system.fetch.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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. - */ - -/** - * @devices tv, phone, tablet, wearable - */ -export interface FetchResponse { - /** - * Server status code. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - code: number; - - /** - * Data returned by the success function. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - data: string | object; - - /** - * All headers in the response from the server. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - headers: Object; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface FetchOptions { - /** - * Resource URL. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - url: string; - - /** - * Request parameter, which can be of the string type or a JSON object. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - data?: string | object; - - /** - * Request header. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - header?: Object; - - /** - * Request methods available: OPTIONS, GET, HEAD, POST, PUT, DELETE and TRACE. - * The default value is GET. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - method?: "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE"; - - /** - * The return type can be text, or JSON. - * By default, the return type is determined based on Content-Type in the header returned by the server. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - responseType?: string; - - /** - * Called when the network data is obtained successfully. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - success?: (data: FetchResponse) => void; - - /** - * Called when the network data fails to be obtained. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export default class Fetch { - /** - * Obtains data through the network. - * @param options Options. - * @devices tv, phone, tablet, wearable - */ - static fetch(options: FetchOptions): void; -} diff --git a/api/common/@system.geolocation.d.ts b/api/common/@system.geolocation.d.ts deleted file mode 100644 index 7036c284ad5b605fc1974af7974d75ceea4514af..0000000000000000000000000000000000000000 --- a/api/common/@system.geolocation.d.ts +++ /dev/null @@ -1,203 +0,0 @@ -/* - * 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. - */ - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface GeolocationResponse { - /** - * Longitude. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - longitude: number; - - /** - * Latitude. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - latitude: number; - - /** - * Altitude. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - altitude: number; - - /** - * Accuracy. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - accuracy: number; - - /** - * Time. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - time: number; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface GetLocationOption { - /** - * Timeout duration, in milliseconds. - * For the rich device, the default value is 30000. - * For the lite wearable device, the default value is 180000. - * The timeout duration is necessary in case no result is returned if the request to obtain the geographic location is rejected for the lack of the required permission, weak positioning signal, or incorrect location settings. After the timeout duration expires, the fail function will be called. - * The value is a 32-digit positive integer. - * If the value set is less than or equal to 0, the default value will be used. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - timeout?: number; - - /** - * Coordinate system type. Available types can be obtained using getSupportedCoordTypes. - * The default type is wgs84. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographic location is obtained. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - success?: (data: GeolocationResponse) => void; - - /** - * Called when the location types fail to be obtained - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface GetLocationTypeResponse { - /** - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - types: Array; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface GetLocationTypeOption { - /** - * Called when the location types are obtained. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - success?: (data: GetLocationTypeResponse) => void; - - /** - * Called when the location types fail to be obtained. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export interface SubscribeLocationOption { - /** - * Coordinate system type. Available types can be obtained using getSupportedCoordTypes. - * The default type is wgs84. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - coordType?: string; - - /** - * Called whenever the geographical location changes. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - success: (data: GeolocationResponse) => void; - - /** - * Called when the listening fails. - * @devices tv, phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable - */ -export default class Geolocation { - /** - * Obtains the geographic location. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static getLocation(options?: GetLocationOption): void; - - /** - * Obtains the location types supported by the system. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static getLocationType(options?: GetLocationTypeOption): void; - - /** - * Listens to the geographical location. If this method is called multiple times, the last call takes effect. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static subscribe(options: SubscribeLocationOption): void; - - /** - * Cancels listening to the geographical location. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static unsubscribe(): void; - - /** - * Obtains the supported coordinate system types. - * @returns A string array of the supported coordinate system types, for example, ['wgs84']. - * @devices tv, phone, tablet, wearable, liteWearable - */ - static getSupportedCoordTypes(): Array; -} diff --git a/api/common/@system.network.d.ts b/api/common/@system.network.d.ts deleted file mode 100644 index f5419165b969c816ad33041fa9730996196ac052..0000000000000000000000000000000000000000 --- a/api/common/@system.network.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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. - */ - -export interface NetworkResponse { - /** - * Network type. The value can be 2G, 3G, 4G, WiFi, or none. - * @since 3 - */ - type: string; - - /** - * Whether the billing is based on the data volume. - * @since 3 - */ - metered: boolean; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface GetNetworkTypeOptions { - /** - * Called when the network type is obtained. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the network type fails to be obtained. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface SubscribeNetworkOptions { - /** - * Called when the network connection state changes. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the listening fails. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - fail?: (data: any, code: number) => void; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export default class Network { - /** - * Obtains the network type. - * @devices tv, phone, tablet, wearable - * @param options Options. - */ - static getType(options?: GetNetworkTypeOptions): void; - - /** - * Listens to the network connection state. If this method is called multiple times, the last call takes effect. - * @param options Options. - * @devices tv, phone, tablet, wearable - */ - static subscribe(options?: SubscribeNetworkOptions): void; - - /** - * Cancels listening to the network connection state. - * @devices tv, phone, tablet, wearable - */ - static unsubscribe(): void; -} diff --git a/api/common/@system.request.d.ts b/api/common/@system.request.d.ts deleted file mode 100644 index cb7578acc87f88804d5cd2d58f51d4778161e1c7..0000000000000000000000000000000000000000 --- a/api/common/@system.request.d.ts +++ /dev/null @@ -1,294 +0,0 @@ -/* - * 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. - */ - -/** - * @devices tv, phone, tablet, wearable - */ -export interface UploadResponse { - /** - * Status code returned by the server. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - code: number; - - /** - * Content returned by the server. - * The value type is determined by the returned content. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - data: string; - - /** - * Headers returned by the server. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - headers: Object; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface DownloadResponse { - /** - * Download token, which is used to obtain the download status. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - token: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface OnDownloadCompleteResponse { - /** - * URI of the download file. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - uri: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface RequestFile { - /** - * File name in the header when multipart is used. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - filename?: string; - - /** - * Name of a form item when multipart is used. The default value is file. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - name?: string; - - /** - * Local storage directory of a file. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - uri: string; - - /** - * Type of the file content. - * By default, the type is obtained based on the suffix of the file name or URI. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - type?: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface RequestData { - /** - * Name of the form element. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - name: string; - - /** - * Value of the form element. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - value: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface UploadRequestOptions { - /** - * Resource URL. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - url: string; - - /** - * Form data in the request body. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - data?: Array; - - /** - * List of files to upload, which is submitted through multipart/form-data. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - files: Array; - - /** - * Request header. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - header?: Object; - - /** - * Request methods available: POST and PUT. The default value is POST. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - method?: string; - - /** - * Called when the files are uploaded successfully. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - success?: (data: UploadResponse) => void; - - /** - * Called when uploading fails. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface DownloadRequestOptions { - /** - * Resource URL. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - url: string; - - /** - * Name of the file to downloaded. - * The value is obtained from the current request or resource URL by default. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - filename?: string; - - /** - * Request header. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - header?: string; - - /** - * Download description. - * The default value is the file name. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - description?: string; - - /** - * Called when the files are successfully downloaded. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - success?: (data: DownloadResponse) => void; - - /** - * Called when downloading fails. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface OnDownloadCompleteOptions { - /** - * Token of the result returned by the download function. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - token: string; - - /** - * Called when the downloads are successfully obtained - * @devices tv, phone, tablet, wearable - * @since 3 - */ - success?: (data: OnDownloadCompleteResponse) => void; - - /** - * Called when the downloads fail to be obtained. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export default class Request { - /** - * Upload files. - * @param options Options. - * @devices tv, phone, tablet, wearable - */ - static upload(options: UploadRequestOptions): void; - - /** - * This API is used to download files. - * @param options Options. - * @devices tv, phone, tablet, wearable - */ - static download(options: DownloadRequestOptions): void; - - /** - * Listens to download task status. - * @param options Options. - * @devices tv, phone, tablet, wearable - */ - static onDownloadComplete(options: OnDownloadCompleteOptions): void; -} diff --git a/api/liteWearable/@internal/featureability.d.ts b/api/liteWearable/@internal/featureability.d.ts deleted file mode 100644 index 493cc6e6a126a571b58161dd0eed363223d0fac3..0000000000000000000000000000000000000000 --- a/api/liteWearable/@internal/featureability.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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. - */ - -export interface IResponse { - /** - * Peer device ID. - */ - deviceId: string; - - /** - * Name of the bundle where the peer ability locates. The name is case sensitive. - */ - bundleName: string; - - /** - * Peer ability name, which is case sensitive. - */ - abilityName: string; - - /** - * Messages received from the device. - */ - message: string; -} - -export declare class FeatureAbility { - /** - * Sends messages to the destination device. - * @param options Options. - */ - static sendMsg(options: { - /** - * Destination device ID. - */ - deviceId: string; - - /** - * Name of the destination bundle where the ability locates. The name is case sensitive. - */ - bundleName: string; - - /** - * Destination ability name, which is case sensitive. - */ - 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. - */ - message?: string; - - /** - * Called when the messages are sent successfully. - */ - success?: () => void; - - /** - * Called when the messages fail to be sent. - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - */ - complete?: () => void; - }): void; - - /** - * Listens for messages sent from other devices. - * @param options - */ - static subscribeMsg(options: { - /** - * Called when the messages are sent successfully. - */ - success?: (data: IResponse) => void; - - /** - * Called when the messages fail to be sent. - */ - fail?: (data: string, code: number) => void; - }): void; - - /** - * Cancels the listening for messages sent from other devices. - */ - static unsubscribeMsg(): void; -} diff --git a/api/liteWearable/@system.battery.d.ts b/api/liteWearable/@system.battery.d.ts deleted file mode 100644 index 11464e63445836f35212e88aa471955143b10baf..0000000000000000000000000000000000000000 --- a/api/liteWearable/@system.battery.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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. - */ - -export interface BatteryResponse { - /** - * Whether the battery is being charged - * @since 3 - */ - charging: boolean; - - /** - * Current battery level, which ranges from 0.00 to 1.00 - * @since 3 - */ - level: number; -} - -export interface GetStatusOptions { - /** - * Called when the current charging state and battery level are obtained. - * @since 3 - */ - success?: (data: BatteryResponse) => void; - - /** - * Called when the current charging state and battery level fail to be obtained. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Battery { - /** - * Obtains the current charging state and battery level. - * @param options Options. - */ - static getStatus(options?: GetStatusOptions): void; -} diff --git a/api/liteWearable/@system.brightness.d.ts b/api/liteWearable/@system.brightness.d.ts deleted file mode 100644 index cbc53e6d5d19936dcac98f704d2e9942f93a80d0..0000000000000000000000000000000000000000 --- a/api/liteWearable/@system.brightness.d.ts +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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. - */ - -export interface BrightnessResponse { - /** - * Screen brightness, which ranges from 1 to 255. - * @since 3 - */ - value: number; -} - -export interface BrightnessModeResponse { - /** - * The value can be 0 or 1. - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: number; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Brightness { - /** - * Obtains the current screen brightness. - * @param options Options. - */ - static getValue(options?: { - /** - * Called when the current screen brightness is obtained. - * @since 3 - */ - success?: (data: BrightnessResponse) => void; - - /** - * Called when the current screen brightness fails to be obtained. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness. - * @param options Options. - */ - static setValue(options: { - /** - * Screen brightness. - * The value is an integer from 1 to 255. - * If the value set is less than or equal to 0, value 1 will be used. - * If the value set is greater than 255, value 255 will be used. - * If the value set contains decimals, the integral part of the value will be used. - * For example, if value 1.8 is set, value 1 will be used. - * @since 3 - */ - value: number; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the screen brightness adjustment mode. - * @param options Options. - */ - static getMode(options?: { - /** - * Called when the screen brightness adjustment mode is obtained. - * @since 3 - */ - success?: (data: BrightnessModeResponse) => void; - - /** - * Called when the screen brightness adjustment mode fails to be obtained. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness adjustment mode. - * @param options Options. - */ - static setMode(options: { - /** - * Screen brightness adjustment mode: - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: number; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets whether to always keep the screen on. - * @param options Options. - */ - static setKeepScreenOn(options: { - /** - * Whether to always keep the screen on. - * @since 3 - */ - keepScreenOn: boolean; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/liteWearable/@system.device.d.ts b/api/liteWearable/@system.device.d.ts deleted file mode 100644 index a2ba19c06da730b1047e2e865f74c80ca2dcab99..0000000000000000000000000000000000000000 --- a/api/liteWearable/@system.device.d.ts +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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. - */ - -export interface DeviceResponse { - /** - * Brand. - * @since 3 - */ - brand: string; - - /** - * Manufacturer. - * @since 3 - */ - manufacturer: string; - - /** - * Model. - * @since 3 - */ - model: string; - - /** - * Product. - * @since 3 - */ - product: string; - - /** - * System language. - * @since 4 - */ - language: string; - - /** - * System region. - * @since 4 - */ - region: string; - - /** - * Window width. - * @since 3 - */ - windowWidth: number; - - /** - * Window height. - * @since 3 - */ - windowHeight: number; - - /** - * Screen density of the device. - * @since 4 - */ - screenDensity: number; - - /** - * Screen shape The options are as follows: - * 1. rect: Rectangle screen - * 2. circle: Circle screen - * @since 4 - */ - screenShape: string; - - /** - * API version. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - apiVersion: number; - - /** - * Device type. The options are as follows: - * phone: smartphone - * tablet: tablet - * tv: smart TV - * wearable: wearable - * liteWearable: lite wearable - * ar: AR - * vr: virtual reality - * earphones: headset - * speaker: speaker - * smartVision: smart visual device - * linkIoT: connection module - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - deviceType: string; -} - -export interface GetDeviceOptions { - /** - * Called when the device information is obtained. - * @since 3 - */ - success?: (data: DeviceResponse) => void; - - /** - * Called when the device information fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Device { - /** - * Obtains the device information. - * @param options Options. - */ - static getInfo(options?: GetDeviceOptions): void; -} diff --git a/api/liteWearable/@system.geolocation.d.ts b/api/liteWearable/@system.geolocation.d.ts deleted file mode 100644 index 233f483a9ae4857a2e1c918350875dd45e259b28..0000000000000000000000000000000000000000 --- a/api/liteWearable/@system.geolocation.d.ts +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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. - */ - -export interface GeolocationResponse { - /** - * Longitude. - * @since 3 - */ - longitude: number; - - /** - * Latitude. - * @since 3 - */ - latitude: number; - - /** - * Location accuracy. - * @since 3 - */ - accuracy: number; - - /** - * Time when the location is obtained. - * @since 3 - */ - time: number; -} - -export interface GetLocationTypeResponse { - /** - * Available location types, ['gps'] - * @since 3 - */ - types: Array; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Geolocation { - /** - * Obtains the geographic location. - * @param options Options. - */ - static getLocation(options?: { - /** - * Timeout duration, in milliseconds. The default value is 180000. - * The timeout duration is necessary in case no result is returned - * if the request to obtain the geographic location is rejected for the lack of the required permission, - * weak positioning signal, or incorrect location settings. - * After the timeout duration expires, the fail function will be called. - * The value is a 32-digit positive integer. - * If the value set is less than or equal to 0, the default value will be used. - * @since 3 - */ - timeout?: number; - - /** - * Coordinate system type. - * Available types can be obtained using getSupportedCoordTypes. - * The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographic location is obtained. - * @since 3 - */ - success?: (data: GeolocationResponse) => void; - - /** - * Called when the location types fail to be obtained - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the supported location types. - * @param options Options. - */ - static getLocationType(options?: { - /** - * Called when the location types are obtained - * @since 3 - */ - success?: (data: GetLocationTypeResponse) => void; - - /** - * Called when the location types fail to be obtained - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the geographical location. - * If this method is called multiple times, the last call takes effect. - * @param options Options. - */ - static subscribe(options: { - /** - * Coordinate system type. - * Available types can be obtained using getSupportedCoordTypes. - * The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called whenever the geographical location changes. - * @since 3 - */ - success: (data: GeolocationResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - }): void; - - /** - * Cancels listening to the geographical location. - */ - static unsubscribe(): void; - - /** - * Obtains coordinate system types supported by the device. - * @returns A string array of the supported coordinate system types. - */ - static getSupportedCoordTypes(): Array; -} diff --git a/api/phone/@internal/featureability.d.ts b/api/phone/@internal/featureability.d.ts deleted file mode 100644 index f9ba85a227f0dcbafdb4f50535250aa1c74d82c8..0000000000000000000000000000000000000000 --- a/api/phone/@internal/featureability.d.ts +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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. - */ - -export interface Result { - /** - * Result code. - */ - code: number; - - /** - * Returned data. - */ - data: object; -} - -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. - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - */ - 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. - */ - 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. - */ - 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 - */ - syncOption?: number; -} - -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. - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - */ - 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. - */ - 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 - */ - syncOption?: number; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface RequestParams { - /** - * The name of the bundle to start. It should be used with abilityname and case sensitive. - * @devices tv, phone, tablet, wearable - */ - bundleName?: string; - /** - * Ability name, which is case sensitive. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - entities?: Array; - /** - * Without specifying the bundle name and ability name, you can start the application according to other properties with action. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - deviceType?: number; - /** - * Data sent to the ability which need to be serializable. - * @devices tv, phone, tablet, wearable - */ - data?: object; - /** - * Configuration switch when start FA. - * @devices tv, phone, tablet, wearable - */ - flag?: number; - /** - * Specify the url of the page which the FA to be called. Use home page directly by default. - * @devices tv, phone, tablet, wearable - */ - url?: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface FinishWithResultParams { - /** - * Result code. - * @devices tv, phone, tablet, wearable - */ - code: number; - - /** - * Returned data. - * @devices tv, phone, tablet, wearable - */ - result: object; -} - -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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - static finishWithResult(param: FinishWithResultParams): 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. - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - */ - 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. - */ - static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; -} diff --git a/api/phone/@internal/global.d.ts b/api/phone/@internal/global.d.ts index 1ba01581adce620a77eddfa23be95dff40f52ff7..85ca2417a74924517b154f5c8dd25cc9384d6038 100644 --- a/api/phone/@internal/global.d.ts +++ b/api/phone/@internal/global.d.ts @@ -43,28 +43,6 @@ 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 - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ -export declare function createLocalParticleAbility(name?: string): any; - -/** - * Sets a vsync after which a function will be executed. - * @param handler Indicates the function to be called when the vsync trigger. - */ -export declare function requestAnimationFrame(handler: Function): number; - -/** - * Cancels the vsync callback set by "requestAnimationFrame()". - * @param requestId Indicates the vsync callback ID returned by "requestAnimationFrame()". - */ -export declare function cancelAnimationFrame(requestId: number): void; - /** * Obtain the objects exposed in app.js * @since 6 diff --git a/api/phone/@system.app.d.ts b/api/phone/@system.app.d.ts index bf9863e7910fc35874cf3cec875ed81a8c9d4e12..b33235d1c2558f4da91a775eac4d04c45a8d4d31 100644 --- a/api/phone/@system.app.d.ts +++ b/api/phone/@system.app.d.ts @@ -72,25 +72,4 @@ export default class App { * By default, the value is in direct proportion to the distance between the non-full window and the full window. */ static requestFullWindow(options?: RequestFullWindowOptions): void; - - /** - * Set image cache capacity of decoded image count. - * If not set, the application will not cache any decoded image. - * @param value capacity of decoded image count - */ - static setImageCacheCount(value: number): void; - - /** - * Set image cache capacity of raw image data size in Bytes before decode. - * If not set, the application will not cache any raw image data. - * @param value capacity of raw image data size in Bytes. - */ - static setImageRawDataCacheSize(value: number): void; - - /** - * Set image file cache size in Bytes on disk before decode. - * If not set, the application will not cache 100MB image files on disk. - * @param value capacity of image file size in Bytes. - */ - static setImageFileCacheSize(value: number): void; } diff --git a/api/phone/@system.battery.d.ts b/api/phone/@system.battery.d.ts deleted file mode 100644 index 2ab3be8157eff669f5094bbce8e63bcf4efe7671..0000000000000000000000000000000000000000 --- a/api/phone/@system.battery.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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. - */ - -export interface BatteryResponse { - /** - * Whether the battery is being charged. - * @since 3 - */ - charging: boolean; - - /** - * Current battery level, which ranges from 0.00 to 1.00. - * @since 3 - */ - level: number; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Battery { - /** - * Obtains the battery level of the current device. - * @param options - */ - static getStatus(options?: { - /** - * Called when the current charging state and battery level are obtained. - * @since 3 - */ - success?: (data: BatteryResponse) => void; - - /** - * Called when the current charging state and battery level fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/phone/@system.brightness.d.ts b/api/phone/@system.brightness.d.ts deleted file mode 100644 index e22b4e0938f1bc2c25e2410efe94b02b829722ab..0000000000000000000000000000000000000000 --- a/api/phone/@system.brightness.d.ts +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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. - */ - -/** - * The screen brightness mode. - */ -export enum BrightnessModeResponse { - /** - * The screen brightness is manually adjusted. - * @since 3 - */ - MANUAL, - - /** - * The screen brightness is automatically adjusted. - * @since 3 - */ - AUTO -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Brightness { - /** - * Obtains the current screen brightness. - * @param options - */ - static getValue(options?: { - /** - * Called when the current screen brightness is obtains. - * @since 3 - */ - success?: (data: { value: number }) => void; - - /** - * Called when the current screen bightness fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness. - * @param options - */ - static setValue(options: { - /** - * Screen brightness. The value is an integer ranging from 1 to 255. - * If the value is less than or equal to 0, value 1 will be used. - * If the value is greater than 255, value 255 will be used. - * If the value contains decimals, the integral part of the value will be used. - * For example, if value 8.1 is set, value 8 will be used. - * @since 3 - */ - value: number; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution os completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the screen brightness adjustment mode. - * @param options - */ - static getMode(options?: { - /** - * Called when the screen brightness adjustment mode is obtained. - * @since 3 - */ - success?: (data: { mode: BrightnessModeResponse }) => void; - - /** - * Called when the screen brightness adjustment mode fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness adjustment mode. - * @param options - */ - static setMode(options: { - /** - * The screen brightness mode - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: BrightnessModeResponse; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets whether to always keep the screen on. - * @param options - */ - static setKeepScreenOn(options: { - /** - * Whether to always keep the screen on. - * @since 3 - */ - keepScreenOn: boolean; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/phone/@system.device.d.ts b/api/phone/@system.device.d.ts deleted file mode 100644 index e5123a71625f1a384691bb551464585a5a3fa005..0000000000000000000000000000000000000000 --- a/api/phone/@system.device.d.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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. - */ - -export interface DeviceResponse { - /** - * Brand. - * @since 3 - */ - brand: string; - - /** - * Manufacturer. - * @since 3 - */ - manufacturer: string; - - /** - * Model. - * @since 3 - */ - model: string; - - /** - * Product number. - * @since 3 - */ - product: string; - - /** - * System language. - * @since 4 - */ - language: string; - - /** - * System region. - * @since 4 - */ - region: string; - - /** - * Window width. - * @since 3 - */ - windowWidth: number; - - /** - * Window Height. - * @since 3 - */ - windowHeight: number; - - /** - * Screen density. - * @since 4 - */ - screenDensity: number; - - /** - * Screen shape. The options are as follows: - * rect: Rectangle screen. - * cicle: Circle screen. - * @since 4 - */ - screenShape: "rect" | "circle"; - - /** - * API version. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - apiVersion: number; - - /** - * Device type. The options are as follows: - * phone: smartphone - * tablet: tablet - * tv: smart TV - * wearable: wearable - * liteWearable: lite wearable - * ar: AR - * vr: virtual reality - * earphones: headset - * speaker: speaker - * smartVision: smart visual device - * linkIoT: connection module - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - deviceType: string; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Device { - /** - * Obtains the device information. - * @param options - */ - static getInfo(options?: { - /** - * Called when the device information is obtained. - * @since 3 - */ - success?: (data: DeviceResponse) => void; - - /** - * Called when the device information fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/phone/@system.fetch.d.ts b/api/phone/@system.fetch.d.ts deleted file mode 100644 index 1effccc7fe17cbadddaac9259c504402ebf9f8f2..0000000000000000000000000000000000000000 --- a/api/phone/@system.fetch.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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. - */ - -export interface FetchResponse { - /** - * Server status code. - * @since 3 - */ - code: number; - - /** - * Data returned by the success function. - * @since 3 - */ - data: string | object; - - /** - * All headers in the response from the server. - * @since 3 - */ - headers: Object; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Fetch { - /** - * Obtains data through the network. - * @param options - */ - static fetch(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Request parameter, which can be of the string type or a JSON object. - * @since 3 - */ - data?: string | object; - - /** - * Request header, which accommodates all attributes of the request. - * @since 3 - */ - header?: Object; - - /** - * Request methods available: OPTIONS, GET, HEAD, POST, PUT, DELETE and TRACE. The default value is GET. - * @since 3 - */ - method?: string; - - /** - * The return type can be text, or JSON. By default, the return type is determined based on Content-Type in the header returned by the server. - * @since 3 - */ - responseType?: string; - - /** - * Called when the network data is obtained successfully. - * @since 3 - */ - success?: (data: FetchResponse) => void; - - /** - * Called when the network data fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/phone/@system.geolocation.d.ts b/api/phone/@system.geolocation.d.ts deleted file mode 100644 index 28bd231ad04dadcf6d6cad4747055864fbefaab5..0000000000000000000000000000000000000000 --- a/api/phone/@system.geolocation.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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. - */ - -export interface GeolocationResponse { - /** - * Longitude. - * @since 3 - */ - longitude: number; - - /** - * Latitude. - * @since 3 - */ - latitude: number; - - /** - * Altitude. - * @since 3 - */ - altitude: number; - - /** - * Location accuracy. - * @since 3 - */ - accuracy: number; - - /** - * Time when the location is obtained. - * @since 3 - */ - time: number; -} - -export interface GetLocationTypeResponse { - /** - * Available location types, ['gps', 'network']. - * @since 3 - */ - types: Array; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Geolocation { - /** - * Obtains the geographic location. - * @param options - */ - static getLocation(options?: { - /** - * Timeout duration, in milliseconds. The default value is 30000. - * The timeout duration is necessary in case no result is returned if the request to obtain the geographic location is rejected for the lack of the required permission, weak positioning signal, or incorrect location settings. After the timeout duration expires, the fail function will be called. - * The value is a 32-digit positive integer. If the value set is less than or equal to 0, the default value will be used. - * @since 3 - */ - timeout?: number; - - /** - * Coordinate system type. Available types can be obtained by getSupportedCoordTypes. The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographic location is obtained. - * @since 3 - */ - success?: (data: GeolocationResponse) => void; - - /** - * Called when the location types fail to be obtained - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the supported location types. - * @param options - */ - static getLocationType(options?: { - /** - * Called when the location types are obtained. - * @since 3 - */ - success?: (data: GetLocationTypeResponse) => void; - - /** - * Called when the location types fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the geographical location. If this method is called multiple times, the last call takes effect. - * @param options - */ - static subscribe(options: { - /** - * Coordinate system type. Available types can be obtained by getSupportedCoordTypes. The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographical location changes. - * @since 3 - */ - success: (data: GeolocationResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - }): void; - - /** - * Cancels listening to the geographical location. - */ - static unsubscribe(): void; - - /** - * Obtains coordinate system types supported by the device. - * @returns A string array of the supported coordinate system types. For details about the value, see coordType. - */ - static getSupportedCoordTypes(): Array; -} diff --git a/api/phone/@system.network.d.ts b/api/phone/@system.network.d.ts deleted file mode 100644 index 531ea6800be9e9d10c7837dc65c40e7e2d3f789a..0000000000000000000000000000000000000000 --- a/api/phone/@system.network.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - -export interface NetworkResponse { - /** - * Network type. The values can be 2G, 3G, 4G, WiFi, or none. - * @since 3 - */ - type: string; - - /** - * Whether the billing is based on the data volume. - * @since 3 - */ - metered: boolean; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Network { - /** - * Obtains the network type. - * @param options - */ - static getType(options?: { - /** - * Called when the network type is obtained. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the network type fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the network connection state. If this method is called multiple times, the last call takes effect. - * @param options - */ - static subscribe(options?: { - /** - * Called when the network connection state changes. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - }): void; - - /** - * Cancels listening to the network connection state. - * @param options - */ - static unsubscribe(): void; -} diff --git a/api/phone/@system.request.d.ts b/api/phone/@system.request.d.ts deleted file mode 100644 index fa1c61c5a43c101e5cea2e35a1ec526bb579fcdf..0000000000000000000000000000000000000000 --- a/api/phone/@system.request.d.ts +++ /dev/null @@ -1,236 +0,0 @@ -/* - * 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. - */ - -export interface UploadResponse { - /** - * Status code returned by the server. - * @since 3 - */ - code: number; - - /** - * Content returned by the server. The value type is determined by the returned content. - * @since 3 - */ - data: string; - - /** - * Headers returned by the server. - * @since 3 - */ - headers: Object; -} - -export interface DownloadResponse { - /** - * Download token, which is used to obtain the download status. - * @since 3 - */ - token: string; -} - -export interface OnDownloadCompleteResponse { - /** - * URI of the download file. - * @since 3 - */ - uri: string; -} - -export interface RequestFile { - /** - * File name in the header when multipart is used. - * @since 3 - */ - filename?: string; - - /** - * Name of a form item when multipart is used. The default value is file. - * @since 3 - */ - name?: string; - - /** - * Local storage directory of a file. - * @since 3 - */ - uri: string; - - /** - * Type of the file content. By default, the type is obtained based on the suffix of the filename or URI. - * @since 3 - */ - type?: string; -} - -export interface RequestData { - /** - * Name of the form element. - * @since 3 - */ - name: string; - - /** - * Value of the form element. - * @since 3 - */ - value: string; -} - -export interface UploadRequestOptions { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Form data in the request body. - * @since 3 - */ - data?: Array; - - /** - * List of files to upload, which is submitted through multipart/form-data. - * @since 3 - */ - files: Array; - - /** - * Request header. - * @since 3 - */ - header?: Object; - - /** - * Request methods available: POST and PUT. The default value is POST. - * @since 3 - */ - method?: string; - - /** - * Called when the files are uploaded successfully. - * @since 3 - */ - success?: (data: UploadResponse) => void; - - /** - * Called when uploading fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface DownloadRequestOptions { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Name of the file to downloaded. - * The value is obtained from the current request or resource URL by default. - * @since 3 - */ - filename?: string; - - /** - * Request header. - * @since 3 - */ - header?: string; - - /** - * Download description. - * The default value is the file name. - * @since 3 - */ - description?: string; - - /** - * Called when the files are successfully downloaded. - * @since 3 - */ - success?: (data: DownloadResponse) => void; - - /** - * Called when downloading fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface OnDownloadCompleteOptions { - /** - * Token of the result returned by the download function. - * @since 3 - */ - token: string; - - /** - * Called when the downloads are successfully obtained - * @since 3 - */ - success?: (data: OnDownloadCompleteResponse) => void; - - /** - * Called when the downloads fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Request { - /** - * Upload files. - * @param options Options. - */ - static upload(options: UploadRequestOptions): void; - - /** - * This API is used to download files. - * @param options Options. - */ - static download(options: DownloadRequestOptions): void; - - /** - * Listens to download task status. - * @param options Options. - */ - static onDownloadComplete(options: OnDownloadCompleteOptions): void; -} - diff --git a/api/smartVision/@system.device.d.ts b/api/smartVision/@system.device.d.ts deleted file mode 100644 index 71ef8043330ad9b53ba1effe91f744a7ee70f875..0000000000000000000000000000000000000000 --- a/api/smartVision/@system.device.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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. - */ - -export interface DeviceResponse { - /** - * Brand. - * @since 3 - */ - brand: string; - - /** - * Manufacturer. - * @since 3 - */ - manufacturer: string; - - /** - * Model. - * @since 3 - */ - model: string; - - /** - * Product. - * @since 3 - */ - product: string; - - /** - * Window width. - * @since 3 - */ - windowWidth: number; - - /** - * Window height. - * @since 3 - */ - windowHeight: number; -} - -export interface GetDeviceOptions { - /** - * Called when the device information is obtained. - * @since 3 - */ - success?: (data: DeviceResponse) => void; - - /** - * Called when the device information fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Device { - /** - * Obtains the device information. - * @param options Options. - */ - static getInfo(options?: GetDeviceOptions): void; -} diff --git a/api/tablet/@internal/featureability.d.ts b/api/tablet/@internal/featureability.d.ts deleted file mode 100644 index f9ba85a227f0dcbafdb4f50535250aa1c74d82c8..0000000000000000000000000000000000000000 --- a/api/tablet/@internal/featureability.d.ts +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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. - */ - -export interface Result { - /** - * Result code. - */ - code: number; - - /** - * Returned data. - */ - data: object; -} - -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. - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - */ - 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. - */ - 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. - */ - 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 - */ - syncOption?: number; -} - -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. - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - */ - 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. - */ - 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 - */ - syncOption?: number; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface RequestParams { - /** - * The name of the bundle to start. It should be used with abilityname and case sensitive. - * @devices tv, phone, tablet, wearable - */ - bundleName?: string; - /** - * Ability name, which is case sensitive. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - entities?: Array; - /** - * Without specifying the bundle name and ability name, you can start the application according to other properties with action. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - deviceType?: number; - /** - * Data sent to the ability which need to be serializable. - * @devices tv, phone, tablet, wearable - */ - data?: object; - /** - * Configuration switch when start FA. - * @devices tv, phone, tablet, wearable - */ - flag?: number; - /** - * Specify the url of the page which the FA to be called. Use home page directly by default. - * @devices tv, phone, tablet, wearable - */ - url?: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface FinishWithResultParams { - /** - * Result code. - * @devices tv, phone, tablet, wearable - */ - code: number; - - /** - * Returned data. - * @devices tv, phone, tablet, wearable - */ - result: object; -} - -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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - static finishWithResult(param: FinishWithResultParams): 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. - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - */ - 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. - */ - static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; -} diff --git a/api/tablet/@internal/global.d.ts b/api/tablet/@internal/global.d.ts index 16d5d3551bea5d806ff2001cb848a2390a26f9d6..6b9bf770fc6fb1b12c1acaa8756034b1a8eabad6 100644 --- a/api/tablet/@internal/global.d.ts +++ b/api/tablet/@internal/global.d.ts @@ -43,28 +43,6 @@ 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 - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ -export declare function createLocalParticleAbility(name?: string): any; - -/** - * Sets a vsync after which a function will be executed. - * @param handler Indicates the function to be called when the vsync trigger. - */ -export declare function requestAnimationFrame(handler: Function): number; - -/** - * Cancels the vsync callback set by "requestAnimationFrame()". - * @param requestId Indicates the vsync callback ID returned by "requestAnimationFrame()". - */ -export declare function cancelAnimationFrame(requestId: number): void; - /** * Obtain the objects exposed in app.js * @since 6 diff --git a/api/tablet/@system.app.d.ts b/api/tablet/@system.app.d.ts index 84587bda64bf7a965f03d23a2de98f223b66e093..bd6459e3871db8824190cf4d6071d7bd02d5b707 100644 --- a/api/tablet/@system.app.d.ts +++ b/api/tablet/@system.app.d.ts @@ -71,25 +71,4 @@ export default class App { * By default, the value is in direct proportion to the distance between the non-full window and the full window. */ static requestFullWindow(options?: RequestFullWindowOptions): void; - - /** - * Set image cache capacity of decoded image count. - * If not set, the application will not cache any decoded image. - * @param value capacity of decoded image count - */ - static setImageCacheCount(value: number): void; - - /** - * Set image cache capacity of raw image data size in Bytes before decode. - * If not set, the application will not cache any raw image data. - * @param value capacity of raw image data size in Bytes. - */ - static setImageRawDataCacheSize(value: number): void; - - /** - * Set image file cache size in Bytes on disk before decode. - * If not set, the application will not cache 100MB image files on disk. - * @param value capacity of image file size in Bytes. - */ - static setImageFileCacheSize(value: number): void; } diff --git a/api/tablet/@system.battery.d.ts b/api/tablet/@system.battery.d.ts deleted file mode 100644 index c798225995b34e37fdeff90f6c39993244481e37..0000000000000000000000000000000000000000 --- a/api/tablet/@system.battery.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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. - */ - -export interface BatteryResponse { - /** - * Whether the battery is being charged. - * @since 3 - */ - charging: boolean; - - /** - * Current battery level, which ranges from 0.00 to 1.00. - * @since 3 - */ - level: number; -} - -export interface GetStatusOptions { - /** - * Called when the current charging state and battery level are obtained. - * @since 3 - */ - success?: (data: BatteryResponse) => void; - - /** - * Called when the current charging state and battery level fail to be obtained. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Battery { - /** - * Obtains the battery level of the current device. - * @param options - */ - static getStatus(options?: GetStatusOptions): void; -} diff --git a/api/tablet/@system.brightness.d.ts b/api/tablet/@system.brightness.d.ts deleted file mode 100644 index e22b4e0938f1bc2c25e2410efe94b02b829722ab..0000000000000000000000000000000000000000 --- a/api/tablet/@system.brightness.d.ts +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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. - */ - -/** - * The screen brightness mode. - */ -export enum BrightnessModeResponse { - /** - * The screen brightness is manually adjusted. - * @since 3 - */ - MANUAL, - - /** - * The screen brightness is automatically adjusted. - * @since 3 - */ - AUTO -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Brightness { - /** - * Obtains the current screen brightness. - * @param options - */ - static getValue(options?: { - /** - * Called when the current screen brightness is obtains. - * @since 3 - */ - success?: (data: { value: number }) => void; - - /** - * Called when the current screen bightness fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness. - * @param options - */ - static setValue(options: { - /** - * Screen brightness. The value is an integer ranging from 1 to 255. - * If the value is less than or equal to 0, value 1 will be used. - * If the value is greater than 255, value 255 will be used. - * If the value contains decimals, the integral part of the value will be used. - * For example, if value 8.1 is set, value 8 will be used. - * @since 3 - */ - value: number; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution os completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the screen brightness adjustment mode. - * @param options - */ - static getMode(options?: { - /** - * Called when the screen brightness adjustment mode is obtained. - * @since 3 - */ - success?: (data: { mode: BrightnessModeResponse }) => void; - - /** - * Called when the screen brightness adjustment mode fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness adjustment mode. - * @param options - */ - static setMode(options: { - /** - * The screen brightness mode - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: BrightnessModeResponse; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets whether to always keep the screen on. - * @param options - */ - static setKeepScreenOn(options: { - /** - * Whether to always keep the screen on. - * @since 3 - */ - keepScreenOn: boolean; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/tablet/@system.device.d.ts b/api/tablet/@system.device.d.ts deleted file mode 100644 index 93cea13524b92e8ae3831729fa5afcec14a0a106..0000000000000000000000000000000000000000 --- a/api/tablet/@system.device.d.ts +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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. - */ - -export interface DeviceResponse { - /** - * Brand. - * @since 3 - */ - brand: string; - - /** - * Manufacturer. - * @since 3 - */ - manufacturer: string; - - /** - * Model. - * @since 3 - */ - model: string; - - /** - * Product number. - * @since 3 - */ - product: string; - - /** - * System language. - * @since 4 - */ - language: string; - - /** - * System region. - * @since 4 - */ - region: string; - - /** - * Window width. - * @since 3 - */ - windowWidth: number; - - /** - * Window Height. - * @since 3 - */ - windowHeight: number; - - /** - * Screen density. - * @since 4 - */ - screenDensity: number; - - /** - * Screen shape. The options are as follows: - * rect: Rectangle screen. - * cicle: Circle screen. - * @since 4 - */ - screenShape: "rect" | "circle"; - - /** - * API version. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - apiVersion: number; - - /** - * Device type. The options are as follows: - * phone: smartphone - * tablet: tablet - * tv: smart TV - * wearable: wearable - * liteWearable: lite wearable - * ar: AR - * vr: virtual reality - * earphones: headset - * speaker: speaker - * smartVision: smart visual device - * linkIoT: connection module - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - deviceType: string; -} - -export interface GetDeviceOptions { - /** - * Called when the device information is obtained. - * @since 3 - */ - success?: (data: DeviceResponse) => void; - - /** - * Called when the device information fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Device { - /** - * Obtains the device information. - * @param options - */ - static getInfo(options?: GetDeviceOptions): void; -} diff --git a/api/tablet/@system.fetch.d.ts b/api/tablet/@system.fetch.d.ts deleted file mode 100644 index 1effccc7fe17cbadddaac9259c504402ebf9f8f2..0000000000000000000000000000000000000000 --- a/api/tablet/@system.fetch.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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. - */ - -export interface FetchResponse { - /** - * Server status code. - * @since 3 - */ - code: number; - - /** - * Data returned by the success function. - * @since 3 - */ - data: string | object; - - /** - * All headers in the response from the server. - * @since 3 - */ - headers: Object; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Fetch { - /** - * Obtains data through the network. - * @param options - */ - static fetch(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Request parameter, which can be of the string type or a JSON object. - * @since 3 - */ - data?: string | object; - - /** - * Request header, which accommodates all attributes of the request. - * @since 3 - */ - header?: Object; - - /** - * Request methods available: OPTIONS, GET, HEAD, POST, PUT, DELETE and TRACE. The default value is GET. - * @since 3 - */ - method?: string; - - /** - * The return type can be text, or JSON. By default, the return type is determined based on Content-Type in the header returned by the server. - * @since 3 - */ - responseType?: string; - - /** - * Called when the network data is obtained successfully. - * @since 3 - */ - success?: (data: FetchResponse) => void; - - /** - * Called when the network data fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/tablet/@system.geolocation.d.ts b/api/tablet/@system.geolocation.d.ts deleted file mode 100644 index 251f466768a51d6a6883cd169c7989bd9b851920..0000000000000000000000000000000000000000 --- a/api/tablet/@system.geolocation.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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. - */ - -export interface GeolocationResponse { - /** - * Longitude. - * @since 3 - */ - longitude: number; - - /** - * Latitude. - * @since 3 - */ - latitude: number; - - /** - * Altitude. - * @since 3 - */ - altitude: number; - - /** - * Location accuracy. - * @since 3 - */ - accuracy: number; - - /** - * Time when the location is obtained. - * @since 3 - */ - time: number; -} - -export interface GetLocationTypeOption { - /** - * Available location types, ['gps', 'network']. - * @since 3 - */ - types: Array; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Geolocation { - /** - * Obtains the geographic location. - * @param options - */ - static getLocation(options?: { - /** - * Timeout duration, in milliseconds. The default value is 30000. - * The timeout duration is necessary in case no result is returned if the request to obtain the geographic location is rejected for the lack of the required permission, weak positioning signal, or incorrect location settings. After the timeout duration expires, the fail function will be called. - * The value is a 32-digit positive integer. If the value set is less than or equal to 0, the default value will be used. - * @since 3 - */ - timeout?: number; - - /** - * Coordinate system type. Available types can be obtained by getSupportedCoordTypes. The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographic location is obtained. - * @since 3 - */ - success?: (data: GeolocationResponse) => void; - - /** - * Called when the location types fail to be obtained - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the supported location types. - * @param options - */ - static getLocationType(options?: { - /** - * Called when the location types are obtained. - * @since 3 - */ - success?: (data: GetLocationTypeOption) => void; - - /** - * Called when the location types fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the geographical location. If this method is called multiple times, the last call takes effect. - * @param options - */ - static subscribe(options: { - /** - * Coordinate system type. Available types can be obtained by getSupportedCoordTypes. The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographical location changes. - * @since 3 - */ - success: (data: GeolocationResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - }): void; - - /** - * Cancels listening to the geographical location. - */ - static unsubscribe(): void; - - /** - * Obtains coordinate system types supported by the device. - * @returns A string array of the supported coordinate system types. For details about the value, see coordType. - */ - static getSupportedCoordTypes(): Array; -} diff --git a/api/tablet/@system.network.d.ts b/api/tablet/@system.network.d.ts deleted file mode 100644 index 531ea6800be9e9d10c7837dc65c40e7e2d3f789a..0000000000000000000000000000000000000000 --- a/api/tablet/@system.network.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - -export interface NetworkResponse { - /** - * Network type. The values can be 2G, 3G, 4G, WiFi, or none. - * @since 3 - */ - type: string; - - /** - * Whether the billing is based on the data volume. - * @since 3 - */ - metered: boolean; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Network { - /** - * Obtains the network type. - * @param options - */ - static getType(options?: { - /** - * Called when the network type is obtained. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the network type fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the network connection state. If this method is called multiple times, the last call takes effect. - * @param options - */ - static subscribe(options?: { - /** - * Called when the network connection state changes. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - }): void; - - /** - * Cancels listening to the network connection state. - * @param options - */ - static unsubscribe(): void; -} diff --git a/api/tablet/@system.request.d.ts b/api/tablet/@system.request.d.ts deleted file mode 100644 index 22cfab44746021a33a8b85c81484a343c2c93b2c..0000000000000000000000000000000000000000 --- a/api/tablet/@system.request.d.ts +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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. - */ - -export interface UploadResponse { - /** - * Status code returned by the server. - * @since 3 - */ - code: number; - - /** - * Content returned by the server. The value type is determined by the returned content. - * @since 3 - */ - data: string; - - /** - * Headers returned by the server. - * @since 3 - */ - headers: Object; -} - -export interface DownloadResponse { - /** - * Download token, which is used to obtain the download status. - * @since 3 - */ - token: string; -} - -export interface OnDownloadCompleteResponse { - /** - * URI of the download file. - * @since 3 - */ - uri: string; -} - -export interface RequestFile { - /** - * File name in the header when multipart is used. - * @since 3 - */ - filename?: string; - - /** - * Name of a form item when multipart is used. The default value is file. - * @since 3 - */ - name?: string; - - /** - * Local storage directory of a file. - * @since 3 - */ - uri: string; - - /** - * Type of the file content. By default, the type is obtained based on the suffix of the filename or URI. - * @since 3 - */ - type?: string; -} - -export interface RequestData { - /** - * Name of the form element. - * @since 3 - */ - name: string; - - /** - * Value of the form element. - * @since 3 - */ - value: string; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Request { - /** - * Upload files. - * @param options - */ - static upload(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Form data in the request body. - * @since 3 - */ - data?: RequestData[]; - - /** - * List of files to upload, which is submitted through multipart/form-data. - * @since 3 - */ - files: RequestFile[]; - - /** - * Request header. - * @since 3 - */ - header?: Object; - - /** - * Request methods available: POST and PUT. The default value is POST. - * @since 3 - */ - method?: string; - - /** - * Called when the files are uploaded successfully. - * @since 3 - */ - success?: (data: UploadResponse) => void; - - /** - * Called when uploading fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * This API is used to download files. - * @param options - */ - static download(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Name of the file to downloaded. The value is obtained from the current request or resource URL by default. - * @since 3 - */ - filename?: string; - - /** - * Request header. - * @since 3 - */ - header?: string; - - /** - * Download description. The default value is the file name. - * @since 3 - */ - description?: string; - - /** - * Called when the files are successfully downloaded. - * @since 3 - */ - success?: (data: DownloadResponse) => void; - - /** - * Called when downloading fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to download task status. - * @param options - */ - static onDownloadComplete(options: { - /** - * Token of the result returned by the download function. - * @since 3 - */ - token: string; - - /** - * Called when the downloads are successfully obtained - * @since 3 - */ - success?: (data: OnDownloadCompleteResponse) => void; - - /** - * Called when the downloads fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/tv/@internal/featureability.d.ts b/api/tv/@internal/featureability.d.ts deleted file mode 100644 index f9ba85a227f0dcbafdb4f50535250aa1c74d82c8..0000000000000000000000000000000000000000 --- a/api/tv/@internal/featureability.d.ts +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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. - */ - -export interface Result { - /** - * Result code. - */ - code: number; - - /** - * Returned data. - */ - data: object; -} - -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. - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - */ - 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. - */ - 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. - */ - 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 - */ - syncOption?: number; -} - -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. - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - */ - 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. - */ - 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 - */ - syncOption?: number; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface RequestParams { - /** - * The name of the bundle to start. It should be used with abilityname and case sensitive. - * @devices tv, phone, tablet, wearable - */ - bundleName?: string; - /** - * Ability name, which is case sensitive. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - entities?: Array; - /** - * Without specifying the bundle name and ability name, you can start the application according to other properties with action. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - deviceType?: number; - /** - * Data sent to the ability which need to be serializable. - * @devices tv, phone, tablet, wearable - */ - data?: object; - /** - * Configuration switch when start FA. - * @devices tv, phone, tablet, wearable - */ - flag?: number; - /** - * Specify the url of the page which the FA to be called. Use home page directly by default. - * @devices tv, phone, tablet, wearable - */ - url?: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface FinishWithResultParams { - /** - * Result code. - * @devices tv, phone, tablet, wearable - */ - code: number; - - /** - * Returned data. - * @devices tv, phone, tablet, wearable - */ - result: object; -} - -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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - static finishWithResult(param: FinishWithResultParams): 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. - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - */ - 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. - */ - static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; -} diff --git a/api/tv/@internal/global.d.ts b/api/tv/@internal/global.d.ts index 1ba01581adce620a77eddfa23be95dff40f52ff7..85ca2417a74924517b154f5c8dd25cc9384d6038 100644 --- a/api/tv/@internal/global.d.ts +++ b/api/tv/@internal/global.d.ts @@ -43,28 +43,6 @@ 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 - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ -export declare function createLocalParticleAbility(name?: string): any; - -/** - * Sets a vsync after which a function will be executed. - * @param handler Indicates the function to be called when the vsync trigger. - */ -export declare function requestAnimationFrame(handler: Function): number; - -/** - * Cancels the vsync callback set by "requestAnimationFrame()". - * @param requestId Indicates the vsync callback ID returned by "requestAnimationFrame()". - */ -export declare function cancelAnimationFrame(requestId: number): void; - /** * Obtain the objects exposed in app.js * @since 6 diff --git a/api/tv/@system.app.d.ts b/api/tv/@system.app.d.ts index 1880127f90af4501f708cab0cb3a2b19d123b4e3..4ffbe2d5c5a068ca549492b94d77ecc60bc00be9 100644 --- a/api/tv/@system.app.d.ts +++ b/api/tv/@system.app.d.ts @@ -52,25 +52,4 @@ export default class App { * Destroys the current ability. */ static terminate(): void; - - /** - * Set image cache capacity of decoded image count. - * If not set, the application will not cache any decoded image. - * @param value capacity of decoded image count - */ - static setImageCacheCount(value: number): void; - - /** - * Set image cache capacity of raw image data size in Bytes before decode. - * If not set, the application will not cache any raw image data. - * @param value capacity of raw image data size in Bytes. - */ - static setImageRawDataCacheSize(value: number): void; - - /** - * Set image file cache size in Bytes on disk before decode. - * If not set, the application will not cache 100MB image files on disk. - * @param value capacity of image file size in Bytes. - */ - static setImageFileCacheSize(value: number): void; } diff --git a/api/tv/@system.brightness.d.ts b/api/tv/@system.brightness.d.ts deleted file mode 100644 index 0b0f77883516d7e34dd4b72eeca399c2a80c410c..0000000000000000000000000000000000000000 --- a/api/tv/@system.brightness.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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. - */ - -/** - * The screen brightness mode. - */ -export interface BrightnessResponse { - /** - * Screen brightness, which ranges from 1 to 255. - * @since 3 - */ - value: number; -} - -export interface BrightnessModeResponse { - /** - * The value can be 0 or 1. - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: number; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Brightness { - /** - * Obtains the current screen brightness. - * @param options - */ - static getValue(options?: { - /** - * Called when the current screen brightness is obtains. - * @since 3 - */ - success?: (data: BrightnessResponse) => void; - - /** - * Called when the current screen bightness fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness. - * @param options - */ - static setValue(options: { - /** - * Screen brightness. The value is an integer ranging from 1 to 255. - * If the value is less than or equal to 0, value 1 will be used. - * If the value is greater than 255, value 255 will be used. - * If the value contains decimals, the integral part of the value will be used. - * For example, if value 8.1 is set, value 8 will be used. - * @since 3 - */ - value: number; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution os completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the screen brightness adjustment mode. - * @param options - */ - static getMode(options?: { - /** - * Called when the screen brightness adjustment mode is obtained. - * @since 3 - */ - success?: (data: BrightnessModeResponse) => void; - - /** - * Called when the screen brightness adjustment mode fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness adjustment mode. - * @param options - */ - static setMode(options: { - /** - * The screen brightness mode. - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: number; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets whether to always keep the screen on. - * @param options - */ - static setKeepScreenOn(options: { - /** - * Whether to always keep the screen on. - * @since 3 - */ - keepScreenOn: boolean; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/tv/@system.device.d.ts b/api/tv/@system.device.d.ts deleted file mode 100644 index e43454048e147e2710f4343ec75c9ee471ae09d7..0000000000000000000000000000000000000000 --- a/api/tv/@system.device.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * 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. - */ - -export interface DeviceResponse { - /** - * Brand. - * @since 3 - */ - brand: string; - - /** - * Manufacturer. - * @since 3 - */ - manufacturer: string; - - /** - * Model. - * @since 3 - */ - model: string; - - /** - * Product number. - * @since 3 - */ - product: string; - - /** - * System language. - * @since 4 - */ - language: string; - - /** - * System region. - * @since 4 - */ - region: string; - - /** - * Window width. - * @since 3 - */ - windowWidth: number; - - /** - * Window Height. - * @since 3 - */ - windowHeight: number; - - /** - * Screen density. - * @since 4 - */ - screenDensity: number; - - /** - * Screen shape. The options are as follows: - * rect: Rectangle screen. - * cicle: Circle screen. - * @since 4 - */ - screenShape: "rect" | "circle"; - - /** - * API version. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - apiVersion: number; - - /** - * Device type. The options are as follows: - * phone: smartphone - * tablet: tablet - * tv: smart TV - * wearable: wearable - * liteWearable: lite wearable - * ar: AR - * vr: virtual reality - * earphones: headset - * speaker: speaker - * smartVision: smart visual device - * linkIoT: connection module - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ -} - -export interface GetDeviceOptions { - /** - * Called when the device information is obtained. - * @since 3 - */ - success?: (data: DeviceResponse) => void; - - /** - * Called when the device information fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Device { - /** - * Obtains the device information. - * @param options - */ - static getInfo(options?: GetDeviceOptions): void; -} diff --git a/api/tv/@system.fetch.d.ts b/api/tv/@system.fetch.d.ts deleted file mode 100644 index e974eebd75cd3af36eec85e6e14ec017fbcdc778..0000000000000000000000000000000000000000 --- a/api/tv/@system.fetch.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -export interface FetchResponse { - /** - * Server status code. - * @since 3 - */ - code: number; - - /** - * Data returned by the success function. - * @since 3 - */ - data: string | object; - - /** - * All headers in the response from the server. - * @since 3 - */ - headers: Object; -} - -export interface FetchOptions { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Request parameter, which can be of the string type or a JSON object. - * @since 3 - */ - data?: string | object; - - /** - * Request header. - * @since 3 - */ - header?: Object; - - /** - * Request methods available: OPTIONS, GET, HEAD, POST, PUT, DELETE and TRACE. - * The default value is GET. - * @since 3 - */ - method?: "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE"; - - /** - * The return type can be text, or JSON. - * By default, the return type is determined based on Content-Type in the header returned by the server. - * @since 3 - */ - responseType?: string; - - /** - * Called when the network data is obtained successfully. - * @since 3 - */ - success?: (data: FetchResponse) => void; - - /** - * Called when the network data fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Fetch { - /** - * Obtains data through the network. - * @param options - */ - static fetch(options: FetchOptions): void; -} diff --git a/api/tv/@system.geolocation.d.ts b/api/tv/@system.geolocation.d.ts deleted file mode 100644 index eab5ab8aa3b662b0d6d27e2ae5e9046e8c373df9..0000000000000000000000000000000000000000 --- a/api/tv/@system.geolocation.d.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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. - */ - -export interface GeolocationResponse { - /** - * Longitude. - * @since 3 - */ - longitude: number; - - /** - * Latitude. - * @since 3 - */ - latitude: number; - - /** - * Location accuracy. - * @since 3 - */ - accuracy: number; - - /** - * Time when the location is obtained. - * @since 3 - */ - time: number; -} - -export interface GetLocationTypeResponse { - /** - * Available location types, ['gps', 'network']. - * @since 3 - */ - types: Array; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Geolocation { - /** - * Obtains the geographic location. - * @param options - */ - static getLocation(options?: { - /** - * Timeout duration, in milliseconds. The default value is 30000. - * The timeout duration is necessary in case no result is returned if the request to obtain the geographic location is rejected for the lack of the required permission, weak positioning signal, or incorrect location settings. After the timeout duration expires, the fail function will be called. - * The value is a 32-digit positive integer. If the value set is less than or equal to 0, the default value will be used. - * @since 3 - */ - timeout?: number; - - /** - * Coordinate system type. Available types can be obtained by getSupportedCoordTypes. The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographic location is obtained. - * @since 3 - */ - success?: (data: GeolocationResponse) => void; - - /** - * Called when the location types fail to be obtained - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the supported location types. - * @param options - */ - static getLocationType(options?: { - /** - * Called when the location types are obtained. - * @since 3 - */ - success?: (data: GetLocationTypeResponse) => void; - - /** - * Called when the location types fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the geographical location. If this method is called multiple times, the last call takes effect. - * @param options - */ - static subscribe(options: { - /** - * Coordinate system type. Available types can be obtained by getSupportedCoordTypes. The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographical location changes. - * @since 3 - */ - success: (data: GeolocationResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - }): void; - - /** - * Cancels listening to the geographical location. - * @since 3 - */ - static unsubscribe(): void; - - /** - * Obtains coordinate system types supported by the device. - * @returns A string array of the supported coordinate system types. For details about the value, see coordType. - */ - static getSupportedCoordTypes(): Array; -} diff --git a/api/tv/@system.network.d.ts b/api/tv/@system.network.d.ts deleted file mode 100644 index 76fe6f893fc75375187580da7727fbea621b71f6..0000000000000000000000000000000000000000 --- a/api/tv/@system.network.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - -export interface NetworkResponse { - /** - * Network type. The value can be 2G, 3G, 4G, WiFi, or none. - * @since 3 - */ - type: string; - - /** - * Whether the billing is based on the data volume. - * @since 3 - */ - metered: boolean; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Network { - /** - * Obtains the network type. - * @param options - */ - static getType(options?: { - /** - * Called when the network type is obtained. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the network type fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the network connection state. If this method is called multiple times, the last call takes effect. - * @param options - */ - static subscribe(options?: { - /** - * Called when the network connection state changes. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - }): void; - - /** - * Cancels listening to the network connection state. - * @param options - */ - static unsubscribe(): void; -} diff --git a/api/tv/@system.request.d.ts b/api/tv/@system.request.d.ts deleted file mode 100644 index 8bad4d68f32ee9f5b17d53e8870b93b008569f63..0000000000000000000000000000000000000000 --- a/api/tv/@system.request.d.ts +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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. - */ - -export interface UploadResponse { - /** - * Status code returned by the server. - * @since 3 - */ - code: number; - - /** - * Content returned by the server. The value type is determined by the returned content. - * @since 3 - */ - data: string; - - /** - * Headers returned by the server. - * @since 3 - */ - headers: Object; -} - -export interface DownloadResponse { - /** - * Download token, which is used to obtain the download status. - * @since 3 - */ - token: string; -} - -export interface OnDownloadCompleteResponse { - /** - * URI of the download file. - * @since 3 - */ - uri: string; -} - -export interface IFile { - /** - * File name in the header when multipart is used. - * @since 3 - */ - filename?: string; - - /** - * Name of a form item when multipart is used. The default value is file. - * @since 3 - */ - name?: string; - - /** - * Local storage directory of a file. - * @since 3 - */ - uri: string; - - /** - * Type of the file content. By default, the type is obtained based on the suffix of the file name or URI. - * @since 3 - */ - type?: string; -} - -export interface IData { - /** - * Name of the form element. - * @since 3 - */ - name: string; - - /** - * Value of the form element. - * @since 3 - */ - value: string; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Request { - /** - * Upload files. - * @param options - */ - static upload(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Form data in the request body. - * @since 3 - */ - data?: IData[]; - - /** - * List of files to upload, which is submitted through multipart/form-data. - * @since 3 - */ - files: IFile[]; - - /** - * Request header. - * @since 3 - */ - header?: Object; - - /** - * Request methods available: POST and PUT. The default value is POST. - * @since 3 - */ - method?: string; - - /** - * Called when the files are uploaded successfully. - * @since 3 - */ - success?: (data: UploadResponse) => void; - - /** - * Called when uploading fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * This API is used to download files. - * @param options - */ - static download(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Name of the file to downloaded. The value is obtained from the current request or resource URL by default. - * @since 3 - */ - filename?: string; - - /** - * Request header. - * @since 3 - */ - header?: string; - - /** - * Download description. The default value is the file name. - * @since 3 - */ - description?: string; - - /** - * Called when the files are successfully downloaded. - * @since 3 - */ - success?: (data: DownloadResponse) => void; - - /** - * Called when downloading fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to download task status. - * @param options - */ - static onDownloadComplete(options: { - /** - * Token of the result returned by the download function. - * @since 3 - */ - token: string; - - /** - * Called when the downloads are successfully obtained - * @since 3 - */ - success?: (data: OnDownloadCompleteResponse) => void; - - /** - * Called when the downloads fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/wearable/@internal/featureability.d.ts b/api/wearable/@internal/featureability.d.ts deleted file mode 100644 index f9ba85a227f0dcbafdb4f50535250aa1c74d82c8..0000000000000000000000000000000000000000 --- a/api/wearable/@internal/featureability.d.ts +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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. - */ - -export interface Result { - /** - * Result code. - */ - code: number; - - /** - * Returned data. - */ - data: object; -} - -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. - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - */ - 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. - */ - 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. - */ - 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 - */ - syncOption?: number; -} - -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. - */ - bundleName: string; - /** - * Ability name, which is case sensitive and must be the same as that on the AA side. - */ - abilityName: string; - /** - * Ability operation code, which defines the service function of an AA and must be consistent with the AA side. - */ - 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. - */ - 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 - */ - syncOption?: number; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface RequestParams { - /** - * The name of the bundle to start. It should be used with abilityname and case sensitive. - * @devices tv, phone, tablet, wearable - */ - bundleName?: string; - /** - * Ability name, which is case sensitive. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - entities?: Array; - /** - * Without specifying the bundle name and ability name, you can start the application according to other properties with action. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - deviceType?: number; - /** - * Data sent to the ability which need to be serializable. - * @devices tv, phone, tablet, wearable - */ - data?: object; - /** - * Configuration switch when start FA. - * @devices tv, phone, tablet, wearable - */ - flag?: number; - /** - * Specify the url of the page which the FA to be called. Use home page directly by default. - * @devices tv, phone, tablet, wearable - */ - url?: string; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export interface FinishWithResultParams { - /** - * Result code. - * @devices tv, phone, tablet, wearable - */ - code: number; - - /** - * Returned data. - * @devices tv, phone, tablet, wearable - */ - result: object; -} - -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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - * @devices tv, phone, tablet, wearable - */ - static finishWithResult(param: FinishWithResultParams): 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. - */ - 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. - * @devices tv, phone, tablet, wearable - */ - 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. - */ - 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. - */ - static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise; -} diff --git a/api/wearable/@internal/global.d.ts b/api/wearable/@internal/global.d.ts index 1ba01581adce620a77eddfa23be95dff40f52ff7..85ca2417a74924517b154f5c8dd25cc9384d6038 100644 --- a/api/wearable/@internal/global.d.ts +++ b/api/wearable/@internal/global.d.ts @@ -43,28 +43,6 @@ 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 - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ -export declare function createLocalParticleAbility(name?: string): any; - -/** - * Sets a vsync after which a function will be executed. - * @param handler Indicates the function to be called when the vsync trigger. - */ -export declare function requestAnimationFrame(handler: Function): number; - -/** - * Cancels the vsync callback set by "requestAnimationFrame()". - * @param requestId Indicates the vsync callback ID returned by "requestAnimationFrame()". - */ -export declare function cancelAnimationFrame(requestId: number): void; - /** * Obtain the objects exposed in app.js * @since 6 diff --git a/api/wearable/@system.battery.d.ts b/api/wearable/@system.battery.d.ts deleted file mode 100644 index 2ab3be8157eff669f5094bbce8e63bcf4efe7671..0000000000000000000000000000000000000000 --- a/api/wearable/@system.battery.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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. - */ - -export interface BatteryResponse { - /** - * Whether the battery is being charged. - * @since 3 - */ - charging: boolean; - - /** - * Current battery level, which ranges from 0.00 to 1.00. - * @since 3 - */ - level: number; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Battery { - /** - * Obtains the battery level of the current device. - * @param options - */ - static getStatus(options?: { - /** - * Called when the current charging state and battery level are obtained. - * @since 3 - */ - success?: (data: BatteryResponse) => void; - - /** - * Called when the current charging state and battery level fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/wearable/@system.brightness.d.ts b/api/wearable/@system.brightness.d.ts deleted file mode 100644 index 0b0f77883516d7e34dd4b72eeca399c2a80c410c..0000000000000000000000000000000000000000 --- a/api/wearable/@system.brightness.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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. - */ - -/** - * The screen brightness mode. - */ -export interface BrightnessResponse { - /** - * Screen brightness, which ranges from 1 to 255. - * @since 3 - */ - value: number; -} - -export interface BrightnessModeResponse { - /** - * The value can be 0 or 1. - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: number; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Brightness { - /** - * Obtains the current screen brightness. - * @param options - */ - static getValue(options?: { - /** - * Called when the current screen brightness is obtains. - * @since 3 - */ - success?: (data: BrightnessResponse) => void; - - /** - * Called when the current screen bightness fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness. - * @param options - */ - static setValue(options: { - /** - * Screen brightness. The value is an integer ranging from 1 to 255. - * If the value is less than or equal to 0, value 1 will be used. - * If the value is greater than 255, value 255 will be used. - * If the value contains decimals, the integral part of the value will be used. - * For example, if value 8.1 is set, value 8 will be used. - * @since 3 - */ - value: number; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution os completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the screen brightness adjustment mode. - * @param options - */ - static getMode(options?: { - /** - * Called when the screen brightness adjustment mode is obtained. - * @since 3 - */ - success?: (data: BrightnessModeResponse) => void; - - /** - * Called when the screen brightness adjustment mode fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets the screen brightness adjustment mode. - * @param options - */ - static setMode(options: { - /** - * The screen brightness mode. - * 0: The screen brightness is manually adjusted. - * 1: The screen brightness is automatically adjusted. - * @since 3 - */ - mode: number; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Sets whether to always keep the screen on. - * @param options - */ - static setKeepScreenOn(options: { - /** - * Whether to always keep the screen on. - * @since 3 - */ - keepScreenOn: boolean; - - /** - * Called when the setting is successful. - * @since 3 - */ - success?: () => void; - - /** - * Called when the setting fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/wearable/@system.device.d.ts b/api/wearable/@system.device.d.ts deleted file mode 100644 index 01b71d87be05a86eafa66f98d39fb95e26ed6d4d..0000000000000000000000000000000000000000 --- a/api/wearable/@system.device.d.ts +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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. - */ - -export interface DeviceResponse { - /** - * Brand. - * @since 3 - */ - brand: string; - - /** - * Manufacturer. - * @since 3 - */ - manufacturer: string; - - /** - * Model. - * @since 3 - */ - model: string; - - /** - * Product number. - * @since 3 - */ - product: string; - - /** - * System language. - * @since 4 - */ - language: string; - - /** - * System region. - * @since 4 - */ - region: string; - - /** - * Window width. - * @since 3 - */ - windowWidth: number; - - /** - * Window Height. - * @since 3 - */ - windowHeight: number; - - /** - * Screen density. - * @since 4 - */ - screenDensity: number; - - /** - * Screen shape. The options are as follows: - * rect: Rectangle screen. - * cicle: Circle screen. - * @since 4 - */ - screenShape: "rect" | "circle"; - - /** - * API version. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - apiVersion: number; - - /** - * Device type. The options are as follows: - * phone: smartphone - * tablet: tablet - * tv: smart TV - * wearable: wearable - * liteWearable: lite wearable - * ar: AR - * vr: virtual reality - * earphones: headset - * speaker: speaker - * smartVision: smart visual device - * linkIoT: connection module - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 4 - */ - deviceType: string; -} - -export interface GetDeviceOptions { - /** - * Called when the device information is obtained. - * @since 3 - */ - success?: (data: DeviceResponse) => void; - - /** - * Called when the device information fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Device { - /** - * Obtains the device information. - * @param options - */ - static getInfo(options?: GetDeviceOptions): void; -} diff --git a/api/wearable/@system.fetch.d.ts b/api/wearable/@system.fetch.d.ts deleted file mode 100644 index 8f34ef16449881c94512a244d769b11adcfac0bf..0000000000000000000000000000000000000000 --- a/api/wearable/@system.fetch.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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. - */ - -export interface FetchResponse { - /** - * Server status code. - * @since 3 - */ - code: number; - - /** - * Data returned by the success function. - * @since 3 - */ - data: string | object; - - /** - * All headers in the response from the server. - * @since 3 - */ - headers: Object; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Fetch { - /** - * Obtains data through the network. - * @param options - */ - static fetch(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Request parameter, which can be of the string type or a JSON object. - * @since 3 - */ - data?: string | object; - - /** - * Request header. - * @since 3 - */ - header?: Object; - - /** - * Request methods available: OPTIONS, GET, HEAD, POST, PUT, DELETE and TRACE. The default value is GET. - * @since 3 - */ - method?: string; - - /** - * The return type can be text, or JSON. By default, the return type is determined based on Content-Type in the header returned by the server. - * @since 3 - */ - responseType?: string; - - /** - * Called when the network data is obtained successfully. - * @since 3 - */ - success?: (data: FetchResponse) => void; - - /** - * Called when the network data fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/wearable/@system.geolocation.d.ts b/api/wearable/@system.geolocation.d.ts deleted file mode 100644 index 28bd231ad04dadcf6d6cad4747055864fbefaab5..0000000000000000000000000000000000000000 --- a/api/wearable/@system.geolocation.d.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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. - */ - -export interface GeolocationResponse { - /** - * Longitude. - * @since 3 - */ - longitude: number; - - /** - * Latitude. - * @since 3 - */ - latitude: number; - - /** - * Altitude. - * @since 3 - */ - altitude: number; - - /** - * Location accuracy. - * @since 3 - */ - accuracy: number; - - /** - * Time when the location is obtained. - * @since 3 - */ - time: number; -} - -export interface GetLocationTypeResponse { - /** - * Available location types, ['gps', 'network']. - * @since 3 - */ - types: Array; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Geolocation { - /** - * Obtains the geographic location. - * @param options - */ - static getLocation(options?: { - /** - * Timeout duration, in milliseconds. The default value is 30000. - * The timeout duration is necessary in case no result is returned if the request to obtain the geographic location is rejected for the lack of the required permission, weak positioning signal, or incorrect location settings. After the timeout duration expires, the fail function will be called. - * The value is a 32-digit positive integer. If the value set is less than or equal to 0, the default value will be used. - * @since 3 - */ - timeout?: number; - - /** - * Coordinate system type. Available types can be obtained by getSupportedCoordTypes. The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographic location is obtained. - * @since 3 - */ - success?: (data: GeolocationResponse) => void; - - /** - * Called when the location types fail to be obtained - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the supported location types. - * @param options - */ - static getLocationType(options?: { - /** - * Called when the location types are obtained. - * @since 3 - */ - success?: (data: GetLocationTypeResponse) => void; - - /** - * Called when the location types fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the geographical location. If this method is called multiple times, the last call takes effect. - * @param options - */ - static subscribe(options: { - /** - * Coordinate system type. Available types can be obtained by getSupportedCoordTypes. The default type is wgs84. - * @since 3 - */ - coordType?: string; - - /** - * Called when the geographical location changes. - * @since 3 - */ - success: (data: GeolocationResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - }): void; - - /** - * Cancels listening to the geographical location. - */ - static unsubscribe(): void; - - /** - * Obtains coordinate system types supported by the device. - * @returns A string array of the supported coordinate system types. For details about the value, see coordType. - */ - static getSupportedCoordTypes(): Array; -} diff --git a/api/wearable/@system.network.d.ts b/api/wearable/@system.network.d.ts deleted file mode 100644 index 76fe6f893fc75375187580da7727fbea621b71f6..0000000000000000000000000000000000000000 --- a/api/wearable/@system.network.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - -export interface NetworkResponse { - /** - * Network type. The value can be 2G, 3G, 4G, WiFi, or none. - * @since 3 - */ - type: string; - - /** - * Whether the billing is based on the data volume. - * @since 3 - */ - metered: boolean; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Network { - /** - * Obtains the network type. - * @param options - */ - static getType(options?: { - /** - * Called when the network type is obtained. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the network type fails to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to the network connection state. If this method is called multiple times, the last call takes effect. - * @param options - */ - static subscribe(options?: { - /** - * Called when the network connection state changes. - * @since 3 - */ - success?: (data: NetworkResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - }): void; - - /** - * Cancels listening to the network connection state. - * @param options - */ - static unsubscribe(): void; -} diff --git a/api/wearable/@system.request.d.ts b/api/wearable/@system.request.d.ts deleted file mode 100644 index 9a8801397a7b45f2fb93e6d2f09baf20a5ed8f66..0000000000000000000000000000000000000000 --- a/api/wearable/@system.request.d.ts +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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. - */ - -export interface UploadResponse { - /** - * Status code returned by the server. - * @since 3 - */ - code: number; - - /** - * Content returned by the server. The value type is determined by the returned content. - * @since 3 - */ - data: string; - - /** - * Headers returned by the server. - * @since 3 - */ - headers: Object; -} - -export interface DownloadResponse { - /** - * Download token, which is used to obtain the download status. - * @since 3 - */ - token: string; -} - -export interface OnDownloadCompleteResponse { - /** - * URI of the download file. - * @since 3 - */ - uri: string; -} - -export interface RequestFile { - /** - * File name in the header when multipart is used. - * @since 3 - */ - filename?: string; - - /** - * Name of a form item when multipart is used. The default value is file. - * @since 3 - */ - name?: string; - - /** - * Local storage directory of a file. - * @since 3 - */ - uri: string; - - /** - * Type of the file content. By default, the type is obtained based on the suffix of the file name or URI. - * @since 3 - */ - type?: string; -} - -export interface RequestData { - /** - * Name of the form element. - * @since 3 - */ - name: string; - - /** - * Value of the form element. - * @since 3 - */ - value: string; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Request { - /** - * Upload files. - * @param options - */ - static upload(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Form data in the request body. - * @since 3 - */ - data?: RequestData[]; - - /** - * List of files to upload, which is submitted through multipart/form-data. - * @since 3 - */ - files: RequestFile[]; - - /** - * Request header. - * @since 3 - */ - header?: Object; - - /** - * Request methods available: POST and PUT. The default value is POST. - * @since 3 - */ - method?: string; - - /** - * Called when the files are uploaded successfully. - * @since 3 - */ - success?: (data: UploadResponse) => void; - - /** - * Called when uploading fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * This API is used to download files. - * @param options - */ - static download(options: { - /** - * Resource URL. - * @since 3 - */ - url: string; - - /** - * Name of the file to downloaded. The value is obtained from the current request or resource URL by default. - * @since 3 - */ - filename?: string; - - /** - * Request header. - * @since 3 - */ - header?: string; - - /** - * Download description. The default value is the file name. - * @since 3 - */ - description?: string; - - /** - * Called when the files are successfully downloaded. - * @since 3 - */ - success?: (data: DownloadResponse) => void; - - /** - * Called when downloading fails. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Listens to download task status. - * @param options - */ - static onDownloadComplete(options: { - /** - * Token of the result returned by the download function. - * @since 3 - */ - token: string; - - /** - * Called when the downloads are successfully obtained - * @since 3 - */ - success?: (data: OnDownloadCompleteResponse) => void; - - /** - * Called when the downloads fail to be obtained. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -}