diff --git a/api/common/@system.bluetooth.d.ts b/api/common/@system.bluetooth.d.ts deleted file mode 100644 index e3f38c1fa9a06ed68aa3c75ec9e3b6298f3ede30..0000000000000000000000000000000000000000 --- a/api/common/@system.bluetooth.d.ts +++ /dev/null @@ -1,86 +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 StartBLEScanOptions { - interval: number; - - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface StopBLEScanOptions { - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface BluetoothDevice { - addrType: "public" | "random"; - - addr: string; - - rssi: number; - - txpower: string; - - data: string; -} - -export interface BLEFoundResponse { - devices: Array; -} - -export interface SubscribeBLEFoundOptions{ - success: (data: BLEFoundResponse) => void; - - fail: (data: string, code: number) => void; -} - -/** - * @devices phone, tv, wearable - */ -export default class Bluetooth { - /** - * Start BLE scan - * @devices phone, tablet, tv, wearable - * @param options Options - */ - static startBLEScan(options: StartBLEScanOptions): void; - - /** - * Stop BLE scan - * @devices phone, tablet, tv, wearable - * @param options Options - */ - static stopBLEScan(options: StopBLEScanOptions): void; - - /** - * Subscribe BLE found - * @devices phone, tablet, tv, wearable - * @param options Options - */ - static subscribeBLEFound(options: SubscribeBLEFoundOptions): void; - - /** - * Stop the subscription of BLE found - * @devices phone, tablet, tv, wearable - */ - static unsubscribeBLEFound(): void; -} \ No newline at end of file diff --git a/api/common/@system.notification.d.ts b/api/common/@system.notification.d.ts deleted file mode 100644 index 6a36704f726ffee57dd7a1f152ae28171f156630..0000000000000000000000000000000000000000 --- a/api/common/@system.notification.d.ts +++ /dev/null @@ -1,79 +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 ActionResult { - /** - * Bundle name of the application to be redirected to after the notification is clicked. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - bundleName: string; - - /** - * Ability name of the application to be redirected to after the notification is clicked. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - abilityName: string; - - /** - * URI of the page to be redirected to. The supported URI formats are as follows: - * 1. Absolute path of the page, which is provided by the pages list in the config.json file. Example: - * pages/index/index - * pages/detail/detail - * 2. Particular path. If the value is a slash (/), the home page is displayed. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - uri: string; -} - -export interface ShowNotificationOptions { - /** - * Notification title. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - contentTitle?: string; - - /** - * Notification content. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - contentText?: string; - - /** - * Action triggered after the notification is clicked. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - clickAction?: ActionResult; -} - -/** - * @devices tv, phone, tablet, wearable - */ -export default class Notification { - /** - * Displays the notification. - * @param options Options. - * @devices tv, phone, tablet, wearable - */ - static show(options?: ShowNotificationOptions): void; -} diff --git a/api/common/@system.package.d.ts b/api/common/@system.package.d.ts deleted file mode 100644 index 4075447959c081fe12f2d5a4c5942724c41462c2..0000000000000000000000000000000000000000 --- a/api/common/@system.package.d.ts +++ /dev/null @@ -1,68 +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 CheckPackageHasInstalledResponse { - /** - * Whether the application exists, or whether the native application has been installed. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - result: boolean; -} - -export interface CheckPackageHasInstalledOptions { - /** - * Application bundle name. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - bundleName: string; - - /** - * Called when native applications are installed. - * @devices tv, phone, tablet, wearable - * @since 3 - */ - success?: (data: CheckPackageHasInstalledResponse) => void; - - /** - * Called when native applications fail to be installed. - * @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 Package { - /** - * Checks whether an application exists, or whether a native application has been installed. - * @param options Options. - * @devices tv, phone, tablet, wearable - */ - static hasInstalled(options: CheckPackageHasInstalledOptions): void; -} diff --git a/api/common/@system.sensor.d.ts b/api/common/@system.sensor.d.ts deleted file mode 100644 index 0fad549f00475ed0c46d5b8d898bb32674fbf135..0000000000000000000000000000000000000000 --- a/api/common/@system.sensor.d.ts +++ /dev/null @@ -1,936 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ -export interface AccelerometerResponse { - /** - * X-coordinate - * @devices phone, tablet, wearable - * @since 3 - */ - x: number; - - /** - * Y-coordinate - * @devices phone, tablet, wearable - * @since 3 - */ - y: number; - - /** - * Z-coordinate - * @devices phone, tablet, wearable - * @since 3 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ -export interface subscribeAccelerometerOptions { - /** - * Execution frequency of the callback function for listening to acceleration sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @devices phone, tablet, wearable - * @since 3 - */ - interval: string; - - /** - * Called when acceleration sensor data changes. - * @devices phone, tablet, wearable - * @since 3 - */ - success: (data: AccelerometerResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface CompassResponse { - /** - * Direction of the device (in degrees). - * @devices phone, tablet, wearable - * @since 3 - */ - direction: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeCompassOptions { - /** - * Called when compass sensor data changes. - * @devices phone, tablet, wearable - * @since 3 - */ - success: (data: CompassResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface ProximityResponse { - /** - * Distance between a visible object and the device screen - * @devices phone, tablet - * @since 3 - */ - distance: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeProximityOptions { - /** - * Called when distance sensor data changes. - * @devices phone, tablet - * @since 3 - */ - success: (data: ProximityResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface LightResponse { - /** - * Light intensity, in lux. - * @devices phone, tablet, wearable - * @since 3 - */ - intensity: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeLightOptions { - /** - * Called when ambient light sensor data changes. - * @devices phone, tablet, wearable - * @since 3 - */ - success: (data: LightResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface StepCounterResponse { - /** - * Number of steps counted. - * Each time the device restarts, the value is recalculated from 0 in phone, tablet. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - steps: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface SubscribeStepCounterOptions { - /** - * Called when step counter sensor data changes. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - success: (data: StepCounterResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface BarometerResponse { - /** - * Pressure, in pascal. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - pressure: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeBarometerOptions { - /** - * Called when the barometer sensor data changes. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - success: (data: BarometerResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ -export interface HeartRateResponse { - /** - * Heart rate. - * 255 indicates an invalid value in lite wearable. - * @devices wearable, liteWearable - * @since 3 - */ - heartRate: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ -export interface SubscribeHeartRateOptions { - /** - * Called when the heart rate sensor data changes. - * @devices wearable, liteWearable - * @since 3 - */ - success: (data: HeartRateResponse) => void; - - /** - * Called when the listening fails - * @devices wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface OnBodyStateResponse { - /** - * Whether the sensor is worn. - * @devices wearable, liteWearable - * @since 3 - */ - value: boolean; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeOnBodyStateOptions { - /** - * Called when the wearing status changes. - * @devices wearable, liteWearable - * @since 3 - */ - success: (data: OnBodyStateResponse) => void; - - /** - * Called when the listening fails. - * @devices wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface GetOnBodyStateOptions { - /** - * Called when the sensor wearing state is obtained - * @devices wearable, liteWearable - * @since 3 - */ - success: (data: OnBodyStateResponse) => void; - - /** - * Called when the sensor wearing state fails to be obtained - * @devices wearable, liteWearable - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed - * @devices wearable, liteWearable - * @since 3 - */ - complete?: () => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 6 - */ -export interface DeviceOrientationResponse { - /** - * alpha - * @devices phone, tablet, wearable - * @since 6 - */ - alpha: number; - - /** - * beta - * @devices phone, tablet, wearable - * @since 6 - */ - beta: number; - - /** - * gamma - * @devices phone, tablet, wearable - * @since 6 - */ - gamma: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 6 - */ -export interface SubscribeDeviceOrientationOptions { - /** - * Execution frequency of the callback function for listening to device orientation sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @devices phone, tablet, wearable - * @since 6 - */ - interval: string; - - /** - * Called when device orientation sensor data changes. - * @devices phone, tablet, wearable - * @since 6 - */ - success: (data: DeviceOrientationResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable - * @since 6 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ -export interface GyroscopeResponse { - /** - * X-coordinate - * @devices phone, tablet, wearable - * @since 6 - */ - x: number; - - /** - * Y-coordinate - * @devices phone, tablet, wearable - * @since 6 - */ - y: number; - - /** - * Z-coordinate - * @devices phone, tablet, wearable - * @since 6 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ -export interface SubscribeGyroscopeOptions { - /** - * Execution frequency of the callback function for listening to gyroscope sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @devices phone, tablet, wearable - * @since 6 - */ - interval: string; - - /** - * Called when gyroscope sensor data changes. - * @devices phone, tablet, wearable - * @since 6 - */ - success: (data: GyroscopeResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable - * @since 6 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface GravityResponse { - /** - * X-coordinate - * @devices phone, tablet, wearable - * @since 7 - */ - x: number; - - /** - * Y-coordinate - * @devices phone, tablet, wearable - * @since 7 - */ - y: number; - - /** - * Z-coordinate - * @devices phone, tablet, wearable - * @since 7 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeGravityOptions { - /** - * Execution frequency of the callback function for listening to gravity sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @devices phone, tablet, wearable - * @since 7 - */ - interval: string; - - /** - * Called when gravity sensor data changes. - * @devices phone, tablet, wearable - * @since 7 - */ - success: (data: GravityResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface MagneticResponse { - /** - * X-coordinate - * @devices phone, tablet, wearable - * @since 7 - */ - x: number; - - /** - * Y-coordinate - * @devices phone, tablet, wearable - * @since 7 - */ - y: number; - - /** - * Z-coordinate - * @devices phone, tablet, wearable - * @since 7 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeMagneticOptions { - /** - * Execution frequency of the callback function for listening to magnetic sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @devices phone, tablet, wearable - * @since 7 - */ - interval: string; - - /** - * Called when magnetic sensor data changes. - * @devices phone, tablet, wearable - * @since 7 - */ - success: (data: MagneticResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet, wearable - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface HallResponse { - /** - * Indicates the hall sensor data. - * @devices phone, tablet - * @since 7 - */ - value: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeHallOptions { - /** - * Execution frequency of the callback function for listening to hall sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @devices phone, tablet - * @since 7 - */ - interval: string; - - /** - * Called when hall sensor data changes. - * @devices phone, tablet - * @since 7 - */ - success: (data: HallResponse) => void; - - /** - * Called when the listening fails. - * @devices phone, tablet - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export default class Sensor { - /** - * Listens to acceleration sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ - static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; - - /** - * Cancels listening to acceleration sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ - static unsubscribeAccelerometer(): void; - - /** - * Listens to compass sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 3 - */ - static subscribeCompass(options: SubscribeCompassOptions): void; - - /** - * Cancels listening to compass sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 3 - */ - static unsubscribeCompass(): void; - - /** - * Listens to distance sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet - * @since 3 - */ - static subscribeProximity(options: SubscribeProximityOptions): void; - - /** - * Cancels listening to distance sensor data. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet - * @since 3 - */ - static unsubscribeProximity(): void; - - /** - * Listens to ambient light sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 3 - */ - static subscribeLight(options: SubscribeLightOptions): void; - - /** - * Cancels listening to ambient light sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 3 - */ - static unsubscribeLight(): void; - - /** - * Listens to step counter sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static subscribeStepCounter(options: SubscribeStepCounterOptions): void; - - /** - * Cancels listening to step counter sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static unsubscribeStepCounter(): void; - - /** - * Listens to barometer sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - static subscribeBarometer(options: SubscribeBarometerOptions): void; - - /** - * Cancels listening to barometer sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - static unsubscribeBarometer(): void; - - /** - * Listens to changes of heart rate sensor data. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ - static subscribeHeartRate(options: SubscribeHeartRateOptions): void; - - /** - * Cancels listening to heart rate sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ - static unsubscribeHeartRate(): void; - - /** - * Listens to whether a sensor is worn. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @since 3 - */ - static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void; - - /** - * Cancels listening to whether the sensor is worn. - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @since 3 - */ - static unsubscribeOnBodyState(): void; - - /** - * Obtains the sensor wearing state. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices wearable, liteWearable - * @since 3 - */ - static getOnBodyState(options: GetOnBodyStateOptions): void; - - /** - * Listens to device orientation sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 6 - */ - static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void; - - /** - * Cancels listening to device orientation sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 6 - */ - static unsubscribeDeviceOrientation(): void; - - /** - * Listens to gyroscope sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ - static subscribeGyroscope(options: SubscribeGyroscopeOptions): void; - - /** - * Cancels listening to gyroscope sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ - static unsubscribeGyroscope(): void; - - /** - * Listens to gravity sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 7 - */ - static subscribeGravity(options: SubscribeGravityOptions): void; - - /** - * Cancels listening to gravity sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 7 - */ - static unsubscribeGravity(): void; - - /** - * Listens to magnetic sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 7 - */ - static subscribeMagnetic(options: SubscribeMagneticOptions): void; - - /** - * Cancels listening to magnetic sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 7 - */ - static unsubscribeMagnetic(): void; - - /** - * Listens to hall sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 7 - */ - static subscribeHall(options: SubscribeHallOptions): void; - - /** - * Cancels listening to hall sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @devices phone, tablet, wearable - * @since 7 - */ - static unsubscribeHall(): void; -} diff --git a/api/common/@system.storage.d.ts b/api/common/@system.storage.d.ts deleted file mode 100644 index 91b6155ca60afae488c02822838adb646388bda5..0000000000000000000000000000000000000000 --- a/api/common/@system.storage.d.ts +++ /dev/null @@ -1,190 +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 GetStorageOptions { - /** - * Content index. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - key: string; - - /** - * Default value returned when the key does not exist. - * If this parameter is not specified, an empty string is returned. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - default?: string; - - /** - * Called when the stored content is read successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - success?: (data: any) => void; - - /** - * Called when the stored content fails to be read. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ -export interface SetStorageOptions { - /** - * Index of the stored content to be modified. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - key: string; - - /** - * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - value: string; - - /** - * Called when the stored content is modified successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be modified. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ -export interface ClearStorageOptions { - /** - * Called when the stored content is cleared successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be cleared. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ -export interface DeleteStorageOptions { - /** - * Content index. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - key: string; - - /** - * Called when the stored content is deleted successfully. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be deleted. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ -export default class Storage { - /** - * Reads the stored content. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ - static get(options: GetStorageOptions): void; - - /** - * Modifies the stored content. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ - static set(options: SetStorageOptions): void; - - /** - * Clears the stored content. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ - static clear(options?: ClearStorageOptions): void; - - /** - * Deletes the stored content. - * @param options Options. - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ - static delete(options: DeleteStorageOptions): void; -} diff --git a/api/common/@system.vibrator.d.ts b/api/common/@system.vibrator.d.ts deleted file mode 100644 index 903806100e6f4d486eb884743c1543075b936d32..0000000000000000000000000000000000000000 --- a/api/common/@system.vibrator.d.ts +++ /dev/null @@ -1,70 +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. - */ - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @devices phone, tablet, wearable, liteWearable - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export interface VibrateOptions { - /** - * Vibration mode. The value long indicates long vibration, and short indicates short vibration. - * The default value is long. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - mode?: "long" | "short"; - - /** - * Called when success to trigger vibration. - * @devices phone, tablet, wearable, liteWearable - * @since 3 - */ - success: () => void; - - /** - * Called when fail to trigger vibration. - * @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; -} - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @devices phone, tablet, wearable, liteWearable - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export default class Vibrator { - /** - * Triggers vibration. - * @param options Options. - * @devices phone, tablet, wearable, liteWearable - * @permission ohos.permission.VIBRATE - * @since 3 - */ - static vibrate(options?: VibrateOptions): void; -} diff --git a/api/liteWearable/@system.sensor.d.ts b/api/liteWearable/@system.sensor.d.ts deleted file mode 100644 index 4f77d0f015c43ea8af2ca60bd1ff95f8093bf7ed..0000000000000000000000000000000000000000 --- a/api/liteWearable/@system.sensor.d.ts +++ /dev/null @@ -1,255 +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. - */ - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface StepCounterResponse { - /** - * Number of steps counted. - * Each time the device restarts, the value is recalculated from 0. - * @since 3 - */ - steps: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface SubscribeStepCounterOptions { - /** - * Called when step counter sensor data changes. - * @since 3 - */ - success: (data: StepCounterResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface BarometerResponse { - /** - * Pressure, in pascal. - * @since 3 - */ - pressure: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeBarometerOptions { - /** - * Called when the barometer sensor data changes. - * @since 3 - */ - success: (data: BarometerResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ -export interface HeartRateResponse { - /** - * Heart rate. - * @since 3 - */ - heartRate: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ -export interface SubscribeHeartRateOptions { - /** - * Called when the heart rate sensor data changes. - * @since 3 - */ - success: (data: HeartRateResponse) => void; - - /** - * Called when the listening fails - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface OnBodyStateResponse { - /** - * Whether the sensor is worn. - * @since 3 - */ - value: boolean; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeOnBodyStateOptions { - /** - * Called when the wearing status changes. - * @since 3 - */ - success: (data: OnBodyStateResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface GetOnBodyStateOptions { - /** - * Called when the sensor wearing state is obtained - * @since 3 - */ - success: (data: OnBodyStateResponse) => void; - - /** - * Called when the sensor wearing state fails to be obtained - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed - * @since 3 - */ - complete?: () => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export default class Sensor { - /** - * Listens to step counter sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static subscribeStepCounter(options: SubscribeStepCounterOptions): void; - - /** - * Cancels listening to step counter sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static unsubscribeStepCounter(): void; - - /** - * Listens to barometer sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeBarometer(options: SubscribeBarometerOptions): void; - - /** - * Cancels listening to barometer sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeBarometer(): void; - - /** - * Listens to changes of heart rate sensor data. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ - static subscribeHeartRate(options: SubscribeHeartRateOptions): void; - - /** - * Cancels listening to heart rate sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ - static unsubscribeHeartRate(): void; - - /** - * Listens to whether a sensor is worn. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void; - - /** - * Cancels listening to whether the sensor is worn. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeOnBodyState(): void; - - /** - * Obtains the sensor wearing state. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static getOnBodyState(options: GetOnBodyStateOptions): void; -} diff --git a/api/liteWearable/@system.storage.d.ts b/api/liteWearable/@system.storage.d.ts deleted file mode 100644 index 3c75bd00b6cd76c15499d145f86b7081446421a7..0000000000000000000000000000000000000000 --- a/api/liteWearable/@system.storage.d.ts +++ /dev/null @@ -1,150 +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. - */ - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Storage { - /** - * Reads the stored content. - * @param options Options. - */ - static get(options: { - /** - * Content index. - * The value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Default value returned when the key does not exist. - * If this parameter is not specified, an empty string is returned. - * @since 3 - */ - default?: string; - - /** - * Called when the stored content is read successfully. - * @since 3 - */ - success?: (data: string) => void; - - /** - * Called when the stored content fails to be read. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Modifies the stored content. - * @param options Options. - */ - static set(options: { - /** - * Index of the stored content to be modified. - * The value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Target storage content. - * If the content is an empty string, the data item with the key as the index will be deleted. - * @since 3 - */ - value: string; - - /** - * Called when the stored content is modified successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be modified. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Clears the stored content. - * @param options Options. - */ - static clear(options?: { - /** - * Called when the stored content is cleared successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be cleared. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Deletes the stored content. - * @param options Options. - */ - static delete(options: { - /** - * Content index. - * The value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Called when the stored content is deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be deleted. - * @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.vibrator.d.ts b/api/liteWearable/@system.vibrator.d.ts deleted file mode 100644 index cf23b8a6de9c3af921df85dda15ecb65679837a8..0000000000000000000000000000000000000000 --- a/api/liteWearable/@system.vibrator.d.ts +++ /dev/null @@ -1,63 +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. - */ - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export interface VibrateOptions { - /** - * Vibration mode. The value long indicates long vibration, and short indicates short vibration. - * The default value is long. - * @since 3 - */ - mode?: "long" | "short"; - - /** - * Called when success to trigger vibration. - * @since 3 - */ - success: () => void; - - /** - * Called when fail to trigger vibration. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export default class Vibrator { - /** - * Triggers vibration. - * @param options Options. - * @permission ohos.permission.VIBRATE - * @since 3 - */ - static vibrate(options?: VibrateOptions): void; -} \ No newline at end of file diff --git a/api/phone/@system.bluetooth.d.ts b/api/phone/@system.bluetooth.d.ts deleted file mode 100644 index 3b113373c3516caeaa3080c9b772639e73b9ea42..0000000000000000000000000000000000000000 --- a/api/phone/@system.bluetooth.d.ts +++ /dev/null @@ -1,79 +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 StartBLEScanOptions { - interval: number; - - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface StopBLEScanOptions { - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface BluetoothDevice { - addrType: "public" | "random"; - - addr: string; - - rssi: number; - - txpower: string; - - data: string; -} - -export interface BLEFoundResponse { - devices: Array; -} - -export interface SubscribeBLEFoundOptions{ - success: (data: BLEFoundResponse) => void; - - fail: (data: string, code: number) => void; -} - -export default class Bluetooth { - /** - * Start BLE scan - * @param options Options - */ - static startBLEScan(options: StartBLEScanOptions): void; - - /** - * Stop BLE scan - * @param options Options - */ - static stopBLEScan(options: StopBLEScanOptions): void; - - /** - * Subscribe BLE found - * @param options Options - */ - static subscribeBLEFound(options: SubscribeBLEFoundOptions): void; - - /** - * Stop the subscription of BLE found - */ - static unsubscribeBLEFound(): void; -} \ No newline at end of file diff --git a/api/phone/@system.notification.d.ts b/api/phone/@system.notification.d.ts deleted file mode 100644 index 795a88c5ed4ba37e640eccbada81e90b9c428a13..0000000000000000000000000000000000000000 --- a/api/phone/@system.notification.d.ts +++ /dev/null @@ -1,69 +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 ActionResult { - /** - * Bundle name of the application to be redirected to after the notification is clicked. - * @since 3 - */ - bundleName: string; - - /** - * Ability name of the application to be redirected to after the notification is clicked. - * @since 3 - */ - abilityName: string; - - /** - * URI of the page to be redirected to. The supported URI formats are as follows: - * 1. Absolute path of the page, which is provided by the pages list in the config.json file. Example: - * pages/index/index - * pages/detail/detail - * 2. Particular path. If the value is a slash (/), the home page is displayed. - * @since 3 - */ - uri: string; -} - -export interface ShowNotificationOptions { - /** - * Notification title. - * @since 3 - */ - contentTitle?: string; - - /** - * Notification content. - * @since 3 - */ - contentText?: string; - - /** - * Action triggered after the notification is clicked. - * @since 3 - */ - clickAction?: ActionResult; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Notification { - /** - * Displays the notification. - * @param options - */ - static show(options?: ShowNotificationOptions): void; -} \ No newline at end of file diff --git a/api/phone/@system.package.d.ts b/api/phone/@system.package.d.ts deleted file mode 100644 index bcb42820845c41d873edb65c1fcd73d6370411da..0000000000000000000000000000000000000000 --- a/api/phone/@system.package.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 CheckPackageHasInstalledResponse { - /** - * Whether the application exists, or whether the native application has been installed. - * @since 3 - */ - result: boolean; -} - -export interface CheckPackageHasInstalledOptions { - /** - * Application bundle name. - * @since 3 - */ - bundleName: string; - - /** - * Called when native applications are installed. - * @since 3 - */ - success?: (data: CheckPackageHasInstalledResponse) => void; - - /** - * Called when native applications fail to be installed. - * @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 Package { - /** - * Checks whether an application exists, or whether a native application has been installed. - * @param options - */ - static hasInstalled(options: CheckPackageHasInstalledOptions): void; -} diff --git a/api/phone/@system.sensor.d.ts b/api/phone/@system.sensor.d.ts deleted file mode 100644 index 487c87973e5d0bde86add41f8ea866ff4a419b5e..0000000000000000000000000000000000000000 --- a/api/phone/@system.sensor.d.ts +++ /dev/null @@ -1,689 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ -export interface AccelerometerResponse { - /** - * X-coordinate - * @since 3 - */ - x: number; - - /** - * Y-coordinate - * @since 3 - */ - y: number; - - /** - * Z-coordinate - * @since 3 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ -export interface subscribeAccelerometerOptions { - /** - * Execution frequency of the callback function for listening to acceleration sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 3 - */ - interval: string; - - /** - * Called when acceleration sensor data changes. - * @since 3 - */ - success: (data: AccelerometerResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface CompassResponse { - /** - * Direction of the device (in degrees). - * @since 3 - */ - direction: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeCompassOptions { - /** - * Called when compass sensor data changes. - * @since 3 - */ - success: (data: CompassResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface ProximityResponse { - /** - * Distance between a visible object and the device screen - * @since 3 - */ - distance: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeProximityOptions { - /** - * Called when distance sensor data changes. - * @since 3 - */ - success: (data: ProximityResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface LightResponse { - /** - * Light intensity, in lux. - * @since 3 - */ - intensity: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeLightOptions { - /** - * Called when ambient light sensor data changes. - * @since 3 - */ - success: (data: LightResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface StepCounterResponse { - /** - * Number of steps counted. - * Each time the device restarts, the value is recalculated from 0. - * @since 3 - */ - steps: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface SubscribeStepCounterOptions { - /** - * Called when step counter sensor data changes. - * @since 3 - */ - success: (data: StepCounterResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface BarometerResponse { - /** - * Pressure, in pascal. - * @since 3 - */ - pressure: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeBarometerOptions { - /** - * Called when the barometer sensor data changes. - * @since 3 - */ - success: (data: BarometerResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 6 - */ -export interface DeviceOrientationResponse { - /** - * alpha - * @since 6 - */ - alpha: number; - - /** - * beta - * @since 6 - */ - beta: number; - - /** - * gamma - * @since 6 - */ - gamma: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 6 - */ -export interface SubscribeDeviceOrientationOptions { - /** - * Execution frequency of the callback function for listening to device orientation sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 6 - */ - interval: string; - - /** - * Called when device orientation sensor data changes. - * @since 6 - */ - success: (data: DeviceOrientationResponse) => void; - - /** - * Called when the listening fails. - * @since 6 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ -export interface GyroscopeResponse { - /** - * X-coordinate - * @since 6 - */ - x: number; - - /** - * Y-coordinate - * @since 6 - */ - y: number; - - /** - * Z-coordinate - * @since 6 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ -export interface SubscribeGyroscopeOptions { - /** - * Execution frequency of the callback function for listening to gyroscope sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 6 - */ - interval: string; - - /** - * Called when gyroscope sensor data changes. - * @since 6 - */ - success: (data: GyroscopeResponse) => void; - - /** - * Called when the listening fails. - * @since 6 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface GravityResponse { - /** - * X-coordinate - * @since 7 - */ - x: number; - - /** - * Y-coordinate - * @since 7 - */ - y: number; - - /** - * Z-coordinate - * @since 7 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeGravityOptions { - /** - * Execution frequency of the callback function for listening to gravity sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 7 - */ - interval: string; - - /** - * Called when gravity sensor data changes. - * @since 7 - */ - success: (data: GravityResponse) => void; - - /** - * Called when the listening fails. - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface MagneticResponse { - /** - * X-coordinate - * @since 7 - */ - x: number; - - /** - * Y-coordinate - * @since 7 - */ - y: number; - - /** - * Z-coordinate - * @since 7 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeMagneticOptions { - /** - * Execution frequency of the callback function for listening to magnetic sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 7 - */ - interval: string; - - /** - * Called when magnetic sensor data changes. - * @since 7 - */ - success: (data: MagneticResponse) => void; - - /** - * Called when the listening fails. - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface HallResponse { - /** - * Indicates the hall sensor data. - * @since 7 - */ - value: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeHallOptions { - /** - * Execution frequency of the callback function for listening to hall sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 7 - */ - interval: string; - - /** - * Called when hall sensor data changes. - * @since 7 - */ - success: (data: HallResponse) => void; - - /** - * Called when the listening fails. - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export default class Sensor { - /** - * Listens to acceleration sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ - static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; - - /** - * Cancels listening to acceleration sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ - static unsubscribeAccelerometer(): void; - - /** - * Listens to compass sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeCompass(options: SubscribeCompassOptions): void; - - /** - * Cancels listening to compass sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeCompass(): void; - - /** - * Listens to distance sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeProximity(options: SubscribeProximityOptions): void; - - /** - * Cancels listening to distance sensor data. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeProximity(): void; - - /** - * Listens to ambient light sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeLight(options: SubscribeLightOptions): void; - - /** - * Cancels listening to ambient light sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeLight(): void; - - /** - * Listens to step counter sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static subscribeStepCounter(options: SubscribeStepCounterOptions): void; - - /** - * Cancels listening to step counter sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static unsubscribeStepCounter(): void; - - /** - * Listens to barometer sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeBarometer(options: SubscribeBarometerOptions): void; - - /** - * Cancels listening to barometer sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeBarometer(): void; - - /** - * Listens to device orientation sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 6 - */ - static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void; - - /** - * Cancels listening to device orientation sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 6 - */ - static unsubscribeDeviceOrientation(): void; - - /** - * Listens to gyroscope sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ - static subscribeGyroscope(options: SubscribeGyroscopeOptions): void; - - /** - * Cancels listening to gyroscope sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ - static unsubscribeGyroscope(): void; - - /** - * Listens to gravity sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static subscribeGravity(options: SubscribeGravityOptions): void; - - /** - * Cancels listening to gravity sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static unsubscribeGravity(): void; - - /** - * Listens to magnetic sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static subscribeMagnetic(options: SubscribeMagneticOptions): void; - - /** - * Cancels listening to magnetic sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static unsubscribeMagnetic(): void; - - /** - * Listens to hall sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static subscribeHall(options: SubscribeHallOptions): void; - - /** - * Cancels listening to hall sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static unsubscribeHall(): void; -} diff --git a/api/phone/@system.storage.d.ts b/api/phone/@system.storage.d.ts deleted file mode 100644 index abb07c05e327c96f4ca7923de6f918b3c519a980..0000000000000000000000000000000000000000 --- a/api/phone/@system.storage.d.ts +++ /dev/null @@ -1,160 +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 GetStorageOptions { - /** - * Content index. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Default value returned when the key does not exist. - * If this parameter is not specified, an empty string is returned. - * @since 3 - */ - default?: string; - - /** - * Called when the stored content is read successfully. - * @since 3 - */ - success?: (data: any) => void; - - /** - * Called when the stored content fails to be read. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface SetStorageOptions { - /** - * Index of the stored content to be modified. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. - * @since 3 - */ - value: string; - - /** - * Called when the stored content is modified successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be modified. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @devices tv, phone, tablet, wearable, liteWearable, smartVision - */ -export interface ClearStorageOptions { - /** - * Called when the stored content is cleared successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be cleared. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface DeleteStorageOptions { - /** - * Content index. - * For liteWearable and smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Called when the stored content is deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be deleted. - * @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 Storage { - /** - * Reads the stored content. - * @param options Options. - */ - static get(options: GetStorageOptions): void; - - /** - * Modifies the stored content. - * @param options Options. - */ - static set(options: SetStorageOptions): void; - - /** - * Clears the stored content. - * @param options Options. - */ - static clear(options?: ClearStorageOptions): void; - - /** - * Deletes the stored content. - * @param options Options. - */ - static delete(options: DeleteStorageOptions): void; -} diff --git a/api/phone/@system.vibrator.d.ts b/api/phone/@system.vibrator.d.ts deleted file mode 100644 index cf23b8a6de9c3af921df85dda15ecb65679837a8..0000000000000000000000000000000000000000 --- a/api/phone/@system.vibrator.d.ts +++ /dev/null @@ -1,63 +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. - */ - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export interface VibrateOptions { - /** - * Vibration mode. The value long indicates long vibration, and short indicates short vibration. - * The default value is long. - * @since 3 - */ - mode?: "long" | "short"; - - /** - * Called when success to trigger vibration. - * @since 3 - */ - success: () => void; - - /** - * Called when fail to trigger vibration. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export default class Vibrator { - /** - * Triggers vibration. - * @param options Options. - * @permission ohos.permission.VIBRATE - * @since 3 - */ - static vibrate(options?: VibrateOptions): void; -} \ No newline at end of file diff --git a/api/smartVision/@system.storage.d.ts b/api/smartVision/@system.storage.d.ts deleted file mode 100644 index 64b50405a55233369b5e16ea65dd77b34011b78d..0000000000000000000000000000000000000000 --- a/api/smartVision/@system.storage.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 GetStorageOptions { - /** - * Content index. - * For smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Default value returned when the key does not exist. - * If this parameter is not specified, an empty string is returned. - * @since 3 - */ - default?: string; - - /** - * Called when the stored content is read successfully. - * @since 3 - */ - success?: (data: any) => void; - - /** - * Called when the stored content fails to be read. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface SetStorageOptions { - /** - * Index of the stored content to be modified. - * For smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. - * @since 3 - */ - value: string; - - /** - * Called when the stored content is modified successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be modified. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface ClearStorageOptions { - /** - * Called when the stored content is cleared successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be cleared. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -export interface DeleteStorageOptions { - /** - * Content index. - * For smartVision, the value contains a maximum of 32 characters and cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * @since 3 - */ - key: string; - - /** - * Called when the stored content is deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be deleted. - * @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 Storage { - /** - * Reads the stored content. - * @param options Options. - */ - static get(options: GetStorageOptions): void; - - - /** - * Modifies the stored content. - * @param options Options. - */ - static set(options: SetStorageOptions): void; - - /** - * Clears the stored content. - * @param options Options. - */ - static clear(options?: ClearStorageOptions): void; - - /** - * Deletes the stored content. - * @param options Options. - */ - static delete(options: DeleteStorageOptions): void; - -} diff --git a/api/tablet/@system.bluetooth.d.ts b/api/tablet/@system.bluetooth.d.ts deleted file mode 100644 index 3b113373c3516caeaa3080c9b772639e73b9ea42..0000000000000000000000000000000000000000 --- a/api/tablet/@system.bluetooth.d.ts +++ /dev/null @@ -1,79 +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 StartBLEScanOptions { - interval: number; - - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface StopBLEScanOptions { - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface BluetoothDevice { - addrType: "public" | "random"; - - addr: string; - - rssi: number; - - txpower: string; - - data: string; -} - -export interface BLEFoundResponse { - devices: Array; -} - -export interface SubscribeBLEFoundOptions{ - success: (data: BLEFoundResponse) => void; - - fail: (data: string, code: number) => void; -} - -export default class Bluetooth { - /** - * Start BLE scan - * @param options Options - */ - static startBLEScan(options: StartBLEScanOptions): void; - - /** - * Stop BLE scan - * @param options Options - */ - static stopBLEScan(options: StopBLEScanOptions): void; - - /** - * Subscribe BLE found - * @param options Options - */ - static subscribeBLEFound(options: SubscribeBLEFoundOptions): void; - - /** - * Stop the subscription of BLE found - */ - static unsubscribeBLEFound(): void; -} \ No newline at end of file diff --git a/api/tablet/@system.notification.d.ts b/api/tablet/@system.notification.d.ts deleted file mode 100644 index 4b44726778ab854ed5bb693a9b6f0d5794914ec5..0000000000000000000000000000000000000000 --- a/api/tablet/@system.notification.d.ts +++ /dev/null @@ -1,67 +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 ActionResult { - /** - * Bundle name of the application to be redirected to after the notification is clicked. - * @since 3 - */ - bundleName: string; - - /** - * Ability name of the application to be redirected to after the notification is clicked. - * @since 3 - */ - abilityName: string; - - /** - * URI of the page to be redirected to. The supported URI formats are as follows: - * 1. Absolute path of the page, which is provided by the pages list in the config.json file. Example: - * pages/index/index - * pages/detail/detail - * 2. Particular path. If the value is a slash (/), the home page is displayed. - * @since 3 - */ - uri: string; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Notification { - /** - * Displays the notification. - * @param options - */ - static show(options?: { - /** - * Notification title. - * @since 3 - */ - contentTitle?: string; - - /** - * Notification content. - * @since 3 - */ - contentText?: string; - - /** - * Action triggered after the notification is clicked. - * @since 3 - */ - clickAction?: ActionResult; - }): void; -} \ No newline at end of file diff --git a/api/tablet/@system.package.d.ts b/api/tablet/@system.package.d.ts deleted file mode 100644 index 2a918ec35a897e6332a87cc24b0a615d9ef33944..0000000000000000000000000000000000000000 --- a/api/tablet/@system.package.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 CheckPackageHasInstalledResponse { - /** - * Whether the application exists, or whether the native application has been installed. - * @since 3 - */ - result: boolean; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Package { - /** - * Checks whether an application exists, or whether a native application has been installed. - * @param options - */ - static hasInstalled(options: { - /** - * Application bundle name. - * @since 3 - */ - bundleName: string; - - /** - * Called when native applications are installed.\ - * @since 3 - */ - success?: (data: CheckPackageHasInstalledResponse) => void; - - /** - * Called when native applications fail to be installed. - * @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.sensor.d.ts b/api/tablet/@system.sensor.d.ts deleted file mode 100644 index 487c87973e5d0bde86add41f8ea866ff4a419b5e..0000000000000000000000000000000000000000 --- a/api/tablet/@system.sensor.d.ts +++ /dev/null @@ -1,689 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ -export interface AccelerometerResponse { - /** - * X-coordinate - * @since 3 - */ - x: number; - - /** - * Y-coordinate - * @since 3 - */ - y: number; - - /** - * Z-coordinate - * @since 3 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ -export interface subscribeAccelerometerOptions { - /** - * Execution frequency of the callback function for listening to acceleration sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 3 - */ - interval: string; - - /** - * Called when acceleration sensor data changes. - * @since 3 - */ - success: (data: AccelerometerResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface CompassResponse { - /** - * Direction of the device (in degrees). - * @since 3 - */ - direction: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeCompassOptions { - /** - * Called when compass sensor data changes. - * @since 3 - */ - success: (data: CompassResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface ProximityResponse { - /** - * Distance between a visible object and the device screen - * @since 3 - */ - distance: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeProximityOptions { - /** - * Called when distance sensor data changes. - * @since 3 - */ - success: (data: ProximityResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface LightResponse { - /** - * Light intensity, in lux. - * @since 3 - */ - intensity: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeLightOptions { - /** - * Called when ambient light sensor data changes. - * @since 3 - */ - success: (data: LightResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface StepCounterResponse { - /** - * Number of steps counted. - * Each time the device restarts, the value is recalculated from 0. - * @since 3 - */ - steps: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface SubscribeStepCounterOptions { - /** - * Called when step counter sensor data changes. - * @since 3 - */ - success: (data: StepCounterResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface BarometerResponse { - /** - * Pressure, in pascal. - * @since 3 - */ - pressure: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeBarometerOptions { - /** - * Called when the barometer sensor data changes. - * @since 3 - */ - success: (data: BarometerResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 6 - */ -export interface DeviceOrientationResponse { - /** - * alpha - * @since 6 - */ - alpha: number; - - /** - * beta - * @since 6 - */ - beta: number; - - /** - * gamma - * @since 6 - */ - gamma: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 6 - */ -export interface SubscribeDeviceOrientationOptions { - /** - * Execution frequency of the callback function for listening to device orientation sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 6 - */ - interval: string; - - /** - * Called when device orientation sensor data changes. - * @since 6 - */ - success: (data: DeviceOrientationResponse) => void; - - /** - * Called when the listening fails. - * @since 6 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ -export interface GyroscopeResponse { - /** - * X-coordinate - * @since 6 - */ - x: number; - - /** - * Y-coordinate - * @since 6 - */ - y: number; - - /** - * Z-coordinate - * @since 6 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ -export interface SubscribeGyroscopeOptions { - /** - * Execution frequency of the callback function for listening to gyroscope sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 6 - */ - interval: string; - - /** - * Called when gyroscope sensor data changes. - * @since 6 - */ - success: (data: GyroscopeResponse) => void; - - /** - * Called when the listening fails. - * @since 6 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface GravityResponse { - /** - * X-coordinate - * @since 7 - */ - x: number; - - /** - * Y-coordinate - * @since 7 - */ - y: number; - - /** - * Z-coordinate - * @since 7 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeGravityOptions { - /** - * Execution frequency of the callback function for listening to gravity sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 7 - */ - interval: string; - - /** - * Called when gravity sensor data changes. - * @since 7 - */ - success: (data: GravityResponse) => void; - - /** - * Called when the listening fails. - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface MagneticResponse { - /** - * X-coordinate - * @since 7 - */ - x: number; - - /** - * Y-coordinate - * @since 7 - */ - y: number; - - /** - * Z-coordinate - * @since 7 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeMagneticOptions { - /** - * Execution frequency of the callback function for listening to magnetic sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 7 - */ - interval: string; - - /** - * Called when magnetic sensor data changes. - * @since 7 - */ - success: (data: MagneticResponse) => void; - - /** - * Called when the listening fails. - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface HallResponse { - /** - * Indicates the hall sensor data. - * @since 7 - */ - value: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeHallOptions { - /** - * Execution frequency of the callback function for listening to hall sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 7 - */ - interval: string; - - /** - * Called when hall sensor data changes. - * @since 7 - */ - success: (data: HallResponse) => void; - - /** - * Called when the listening fails. - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export default class Sensor { - /** - * Listens to acceleration sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ - static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; - - /** - * Cancels listening to acceleration sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ - static unsubscribeAccelerometer(): void; - - /** - * Listens to compass sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeCompass(options: SubscribeCompassOptions): void; - - /** - * Cancels listening to compass sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeCompass(): void; - - /** - * Listens to distance sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeProximity(options: SubscribeProximityOptions): void; - - /** - * Cancels listening to distance sensor data. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeProximity(): void; - - /** - * Listens to ambient light sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeLight(options: SubscribeLightOptions): void; - - /** - * Cancels listening to ambient light sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeLight(): void; - - /** - * Listens to step counter sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static subscribeStepCounter(options: SubscribeStepCounterOptions): void; - - /** - * Cancels listening to step counter sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static unsubscribeStepCounter(): void; - - /** - * Listens to barometer sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeBarometer(options: SubscribeBarometerOptions): void; - - /** - * Cancels listening to barometer sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeBarometer(): void; - - /** - * Listens to device orientation sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 6 - */ - static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void; - - /** - * Cancels listening to device orientation sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 6 - */ - static unsubscribeDeviceOrientation(): void; - - /** - * Listens to gyroscope sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ - static subscribeGyroscope(options: SubscribeGyroscopeOptions): void; - - /** - * Cancels listening to gyroscope sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ - static unsubscribeGyroscope(): void; - - /** - * Listens to gravity sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static subscribeGravity(options: SubscribeGravityOptions): void; - - /** - * Cancels listening to gravity sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static unsubscribeGravity(): void; - - /** - * Listens to magnetic sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static subscribeMagnetic(options: SubscribeMagneticOptions): void; - - /** - * Cancels listening to magnetic sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static unsubscribeMagnetic(): void; - - /** - * Listens to hall sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static subscribeHall(options: SubscribeHallOptions): void; - - /** - * Cancels listening to hall sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static unsubscribeHall(): void; -} diff --git a/api/tablet/@system.storage.d.ts b/api/tablet/@system.storage.d.ts deleted file mode 100644 index 0a4c814410881f33a8ac681071831194e235c72d..0000000000000000000000000000000000000000 --- a/api/tablet/@system.storage.d.ts +++ /dev/null @@ -1,145 +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. - */ - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Storage { - /** - * Reads the stored content. - * @param options - */ - static get(options: { - /** - * Content index. - * @since 3 - */ - key: string; - - /** - * Default value returned when the key does not exist. If this parameter is not specified, an empty string is returned. - * @since 3 - */ - default?: string; - - /** - * Called when the stored content is read successfully. - * @since 3 - */ - success?: (data: any) => void; - - /** - * Called when the stored content fails to be read. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Modifies the stored content. - * @param options - */ - static set(options: { - /** - * Index of the stored content to be modified. - * @since 3 - */ - key: string; - - /** - * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. - * @since 3 - */ - value: string; - - /** - * Called when the stored content is modified successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be modified. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Clears the stored content. - * @param options - */ - static clear(options?: { - /** - * Called when the stored content is cleared successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be cleared. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Deletes the stored content. - * @param options - */ - static delete(options: { - /** - * Content index. - * @since 3 - */ - key: string; - - /** - * Called when the stored content is deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be deleted. - * @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.vibrator.d.ts b/api/tablet/@system.vibrator.d.ts deleted file mode 100644 index cf23b8a6de9c3af921df85dda15ecb65679837a8..0000000000000000000000000000000000000000 --- a/api/tablet/@system.vibrator.d.ts +++ /dev/null @@ -1,63 +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. - */ - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export interface VibrateOptions { - /** - * Vibration mode. The value long indicates long vibration, and short indicates short vibration. - * The default value is long. - * @since 3 - */ - mode?: "long" | "short"; - - /** - * Called when success to trigger vibration. - * @since 3 - */ - success: () => void; - - /** - * Called when fail to trigger vibration. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export default class Vibrator { - /** - * Triggers vibration. - * @param options Options. - * @permission ohos.permission.VIBRATE - * @since 3 - */ - static vibrate(options?: VibrateOptions): void; -} \ No newline at end of file diff --git a/api/tv/@system.bluetooth.d.ts b/api/tv/@system.bluetooth.d.ts deleted file mode 100644 index 3b113373c3516caeaa3080c9b772639e73b9ea42..0000000000000000000000000000000000000000 --- a/api/tv/@system.bluetooth.d.ts +++ /dev/null @@ -1,79 +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 StartBLEScanOptions { - interval: number; - - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface StopBLEScanOptions { - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface BluetoothDevice { - addrType: "public" | "random"; - - addr: string; - - rssi: number; - - txpower: string; - - data: string; -} - -export interface BLEFoundResponse { - devices: Array; -} - -export interface SubscribeBLEFoundOptions{ - success: (data: BLEFoundResponse) => void; - - fail: (data: string, code: number) => void; -} - -export default class Bluetooth { - /** - * Start BLE scan - * @param options Options - */ - static startBLEScan(options: StartBLEScanOptions): void; - - /** - * Stop BLE scan - * @param options Options - */ - static stopBLEScan(options: StopBLEScanOptions): void; - - /** - * Subscribe BLE found - * @param options Options - */ - static subscribeBLEFound(options: SubscribeBLEFoundOptions): void; - - /** - * Stop the subscription of BLE found - */ - static unsubscribeBLEFound(): void; -} \ No newline at end of file diff --git a/api/tv/@system.notification.d.ts b/api/tv/@system.notification.d.ts deleted file mode 100644 index fa7b1836256d9aa614287e4b2e2b77bfb8e43e2e..0000000000000000000000000000000000000000 --- a/api/tv/@system.notification.d.ts +++ /dev/null @@ -1,67 +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 ActionResult { - /** - * Bundle name of the application to be redirected to after the notification is clicked. - * @since 3 - */ - bundleName: string; - - /** - * Ability name of the application to be redirected to after the notification is clicked. - * @since 3 - */ - abilityName: string; - - /** - * URI of the page to be redirected to. The supported URI formats are as follows: - * 1. Absolute path of the page, which is provided by the pages list in the config.json file. Example: - * pages/index/index - * pages/detail/detail - * 2. Particular path. If the value is a slash (/), the home page is displayed. - * @since 3 - */ - uri: string; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Notification { - /** - * Displays the notification. - * @param options - */ - static show(options?: { - /** - * Notification title. - * @since 3 - */ - contentTitle?: string; - - /** - * Notification content. - * @since 3 - */ - contentText?: string; - - /** - * Action triggered after the notification is clicked. - * @since 3 - */ - clickAction?: ActionResult; - }): void; -} \ No newline at end of file diff --git a/api/tv/@system.package.d.ts b/api/tv/@system.package.d.ts deleted file mode 100644 index 6dbaf27ac95325b7840ddeeb68cdc1c84ce2f651..0000000000000000000000000000000000000000 --- a/api/tv/@system.package.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 CheckPackageHasInstalledResponse { - /** - * Whether the application exists, or whether the native application has been installed. - * @since 3 - */ - result: boolean; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Package { - /** - * Checks whether an application exists, or whether a native application has been installed. - * @param options - */ - static hasInstalled(options: { - /** - * Application bundle name. - * @since 3 - */ - bundleName: string; - - /** - * Called when native applications are installed. - * @since 3 - */ - success?: (data: CheckPackageHasInstalledResponse) => void; - - /** - * Called when native applications fail to be installed. - * @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.storage.d.ts b/api/tv/@system.storage.d.ts deleted file mode 100644 index 0a4c814410881f33a8ac681071831194e235c72d..0000000000000000000000000000000000000000 --- a/api/tv/@system.storage.d.ts +++ /dev/null @@ -1,145 +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. - */ - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Storage { - /** - * Reads the stored content. - * @param options - */ - static get(options: { - /** - * Content index. - * @since 3 - */ - key: string; - - /** - * Default value returned when the key does not exist. If this parameter is not specified, an empty string is returned. - * @since 3 - */ - default?: string; - - /** - * Called when the stored content is read successfully. - * @since 3 - */ - success?: (data: any) => void; - - /** - * Called when the stored content fails to be read. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Modifies the stored content. - * @param options - */ - static set(options: { - /** - * Index of the stored content to be modified. - * @since 3 - */ - key: string; - - /** - * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. - * @since 3 - */ - value: string; - - /** - * Called when the stored content is modified successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be modified. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Clears the stored content. - * @param options - */ - static clear(options?: { - /** - * Called when the stored content is cleared successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be cleared. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Deletes the stored content. - * @param options - */ - static delete(options: { - /** - * Content index. - * @since 3 - */ - key: string; - - /** - * Called when the stored content is deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be deleted. - * @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.bluetooth.d.ts b/api/wearable/@system.bluetooth.d.ts deleted file mode 100644 index 3b113373c3516caeaa3080c9b772639e73b9ea42..0000000000000000000000000000000000000000 --- a/api/wearable/@system.bluetooth.d.ts +++ /dev/null @@ -1,79 +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 StartBLEScanOptions { - interval: number; - - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface StopBLEScanOptions { - success: () => void; - - fail: (data: string, code: number) => void; - - complete: () => void; -} - -export interface BluetoothDevice { - addrType: "public" | "random"; - - addr: string; - - rssi: number; - - txpower: string; - - data: string; -} - -export interface BLEFoundResponse { - devices: Array; -} - -export interface SubscribeBLEFoundOptions{ - success: (data: BLEFoundResponse) => void; - - fail: (data: string, code: number) => void; -} - -export default class Bluetooth { - /** - * Start BLE scan - * @param options Options - */ - static startBLEScan(options: StartBLEScanOptions): void; - - /** - * Stop BLE scan - * @param options Options - */ - static stopBLEScan(options: StopBLEScanOptions): void; - - /** - * Subscribe BLE found - * @param options Options - */ - static subscribeBLEFound(options: SubscribeBLEFoundOptions): void; - - /** - * Stop the subscription of BLE found - */ - static unsubscribeBLEFound(): void; -} \ No newline at end of file diff --git a/api/wearable/@system.notification.d.ts b/api/wearable/@system.notification.d.ts deleted file mode 100644 index 795a88c5ed4ba37e640eccbada81e90b9c428a13..0000000000000000000000000000000000000000 --- a/api/wearable/@system.notification.d.ts +++ /dev/null @@ -1,69 +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 ActionResult { - /** - * Bundle name of the application to be redirected to after the notification is clicked. - * @since 3 - */ - bundleName: string; - - /** - * Ability name of the application to be redirected to after the notification is clicked. - * @since 3 - */ - abilityName: string; - - /** - * URI of the page to be redirected to. The supported URI formats are as follows: - * 1. Absolute path of the page, which is provided by the pages list in the config.json file. Example: - * pages/index/index - * pages/detail/detail - * 2. Particular path. If the value is a slash (/), the home page is displayed. - * @since 3 - */ - uri: string; -} - -export interface ShowNotificationOptions { - /** - * Notification title. - * @since 3 - */ - contentTitle?: string; - - /** - * Notification content. - * @since 3 - */ - contentText?: string; - - /** - * Action triggered after the notification is clicked. - * @since 3 - */ - clickAction?: ActionResult; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Notification { - /** - * Displays the notification. - * @param options - */ - static show(options?: ShowNotificationOptions): void; -} \ No newline at end of file diff --git a/api/wearable/@system.package.d.ts b/api/wearable/@system.package.d.ts deleted file mode 100644 index 6dbaf27ac95325b7840ddeeb68cdc1c84ce2f651..0000000000000000000000000000000000000000 --- a/api/wearable/@system.package.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 CheckPackageHasInstalledResponse { - /** - * Whether the application exists, or whether the native application has been installed. - * @since 3 - */ - result: boolean; -} - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Package { - /** - * Checks whether an application exists, or whether a native application has been installed. - * @param options - */ - static hasInstalled(options: { - /** - * Application bundle name. - * @since 3 - */ - bundleName: string; - - /** - * Called when native applications are installed. - * @since 3 - */ - success?: (data: CheckPackageHasInstalledResponse) => void; - - /** - * Called when native applications fail to be installed. - * @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.sensor.d.ts b/api/wearable/@system.sensor.d.ts deleted file mode 100644 index a090153c5a5f925ace217aa338b89b55f302de58..0000000000000000000000000000000000000000 --- a/api/wearable/@system.sensor.d.ts +++ /dev/null @@ -1,714 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ -export interface AccelerometerResponse { - /** - * X-coordinate - * @since 3 - */ - x: number; - - /** - * Y-coordinate - * @since 3 - */ - y: number; - - /** - * Z-coordinate - * @since 3 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ -export interface subscribeAccelerometerOptions { - /** - * Execution frequency of the callback function for listening to acceleration sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 3 - */ - interval: string; - - /** - * Called when acceleration sensor data changes. - * @since 3 - */ - success: (data: AccelerometerResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface CompassResponse { - /** - * Direction of the device (in degrees). - * @since 3 - */ - direction: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeCompassOptions { - /** - * Called when compass sensor data changes. - * @since 3 - */ - success: (data: CompassResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface LightResponse { - /** - * Light intensity, in lux. - * @since 3 - */ - intensity: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeLightOptions { - /** - * Called when ambient light sensor data changes. - * @since 3 - */ - success: (data: LightResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface StepCounterResponse { - /** - * Number of steps counted. - * Each time the device restarts, the value is recalculated from 0. - * @since 3 - */ - steps: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ -export interface SubscribeStepCounterOptions { - /** - * Called when step counter sensor data changes. - * @since 3 - */ - success: (data: StepCounterResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface BarometerResponse { - /** - * Pressure, in pascal. - * @since 3 - */ - pressure: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeBarometerOptions { - /** - * Called when the barometer sensor data changes. - * @since 3 - */ - success: (data: BarometerResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ -export interface HeartRateResponse { - /** - * Heart rate. - * @since 3 - */ - heartRate: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ -export interface SubscribeHeartRateOptions { - /** - * Called when the heart rate sensor data changes. - * @since 3 - */ - success: (data: HeartRateResponse) => void; - - /** - * Called when the listening fails - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface OnBodyStateResponse { - /** - * Whether the sensor is worn. - * @since 3 - */ - value: boolean; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface SubscribeOnBodyStateOptions { - /** - * Called when the wearing status changes. - * @since 3 - */ - success: (data: OnBodyStateResponse) => void; - - /** - * Called when the listening fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 3 - */ -export interface GetOnBodyStateOptions { - /** - * Called when the sensor wearing state is obtained - * @since 3 - */ - success: (data: OnBodyStateResponse) => void; - - /** - * Called when the sensor wearing state fails to be obtained - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed - * @since 3 - */ - complete?: () => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 6 - */ -export interface DeviceOrientationResponse { - /** - * alpha - * @since 6 - */ - alpha: number; - - /** - * beta - * @since 6 - */ - beta: number; - - /** - * gamma - * @since 6 - */ - gamma: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 6 - */ -export interface SubscribeDeviceOrientationOptions { - /** - * Execution frequency of the callback function for listening to device orientation sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 6 - */ - interval: string; - - /** - * Called when device orientation sensor data changes. - * @since 6 - */ - success: (data: DeviceOrientationResponse) => void; - - /** - * Called when the listening fails. - * @since 6 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ -export interface GyroscopeResponse { - /** - * X-coordinate - * @since 6 - */ - x: number; - - /** - * Y-coordinate - * @since 6 - */ - y: number; - - /** - * Z-coordinate - * @since 6 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ -export interface SubscribeGyroscopeOptions { - /** - * Execution frequency of the callback function for listening to gyroscope sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 6 - */ - interval: string; - - /** - * Called when gyroscope sensor data changes. - * @since 6 - */ - success: (data: GyroscopeResponse) => void; - - /** - * Called when the listening fails. - * @since 6 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface GravityResponse { - /** - * X-coordinate - * @since 7 - */ - x: number; - - /** - * Y-coordinate - * @since 7 - */ - y: number; - - /** - * Z-coordinate - * @since 7 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeGravityOptions { - /** - * Execution frequency of the callback function for listening to gravity sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 7 - */ - interval: string; - - /** - * Called when gravity sensor data changes. - * @since 7 - */ - success: (data: GravityResponse) => void; - - /** - * Called when the listening fails. - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface MagneticResponse { - /** - * X-coordinate - * @since 7 - */ - x: number; - - /** - * Y-coordinate - * @since 7 - */ - y: number; - - /** - * Z-coordinate - * @since 7 - */ - z: number; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export interface SubscribeMagneticOptions { - /** - * Execution frequency of the callback function for listening to magnetic sensor data. - * Available values are as follows: - * 1. game: Extremely high frequency (20 ms per callback), which is applicable to gaming. - * 2. ui: High frequency (60 ms per callback), which is applicable to UI updating. - * 3. normal: Regular frequency (200 ms per callback), which is application to low power consumption. - * The default value is normal. - * @since 7 - */ - interval: string; - - /** - * Called when magnetic sensor data changes. - * @since 7 - */ - success: (data: MagneticResponse) => void; - - /** - * Called when the listening fails. - * @since 7 - */ - fail?: (data: string, code: number) => void; -} - -/** - * @SysCap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; - * @since 7 - */ -export default class Sensor { - /** - * Listens to acceleration sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ - static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; - - /** - * Cancels listening to acceleration sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACCELEROMETER - * @since 3 - */ - static unsubscribeAccelerometer(): void; - - /** - * Listens to compass sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeCompass(options: SubscribeCompassOptions): void; - - /** - * Cancels listening to compass sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeCompass(): void; - - /** - * Listens to ambient light sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeLight(options: SubscribeLightOptions): void; - - /** - * Cancels listening to ambient light sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeLight(): void; - - /** - * Listens to step counter sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static subscribeStepCounter(options: SubscribeStepCounterOptions): void; - - /** - * Cancels listening to step counter sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.ACTIVITY_MOTION - * @since 3 - */ - static unsubscribeStepCounter(): void; - - /** - * Listens to barometer sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeBarometer(options: SubscribeBarometerOptions): void; - - /** - * Cancels listening to barometer sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeBarometer(): void; - - /** - * Listens to changes of heart rate sensor data. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ - static subscribeHeartRate(options: SubscribeHeartRateOptions): void; - - /** - * Cancels listening to heart rate sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.READ_HEALTH_DATA - * @since 3 - */ - static unsubscribeHeartRate(): void; - - /** - * Listens to whether a sensor is worn. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void; - - /** - * Cancels listening to whether the sensor is worn. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static unsubscribeOnBodyState(): void; - - /** - * Obtains the sensor wearing state. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 3 - */ - static getOnBodyState(options: GetOnBodyStateOptions): void; - - /** - * Listens to device orientation sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 6 - */ - static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void; - - /** - * Cancels listening to device orientation sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 6 - */ - static unsubscribeDeviceOrientation(): void; - - /** - * Listens to gyroscope sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ - static subscribeGyroscope(options: SubscribeGyroscopeOptions): void; - - /** - * Cancels listening to gyroscope sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @permission ohos.permission.GYROSCOPE - * @since 6 - */ - static unsubscribeGyroscope(): void; - - /** - * Listens to gravity sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static subscribeGravity(options: SubscribeGravityOptions): void; - - /** - * Cancels listening to gravity sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static unsubscribeGravity(): void; - - /** - * Listens to magnetic sensor data changes. - * If this API is called multiple times, the last call takes effect. - * @param options Options. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static subscribeMagnetic(options: SubscribeMagneticOptions): void; - - /** - * Cancels listening to magnetic sensor data. - * @SysCap SystemCapability.Sensors.Sensor - * @since 7 - */ - static unsubscribeMagnetic(): void; -} diff --git a/api/wearable/@system.storage.d.ts b/api/wearable/@system.storage.d.ts deleted file mode 100644 index 0a4c814410881f33a8ac681071831194e235c72d..0000000000000000000000000000000000000000 --- a/api/wearable/@system.storage.d.ts +++ /dev/null @@ -1,145 +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. - */ - -/** - * @Syscap SysCap.ACE.UIEngine - */ -export default class Storage { - /** - * Reads the stored content. - * @param options - */ - static get(options: { - /** - * Content index. - * @since 3 - */ - key: string; - - /** - * Default value returned when the key does not exist. If this parameter is not specified, an empty string is returned. - * @since 3 - */ - default?: string; - - /** - * Called when the stored content is read successfully. - * @since 3 - */ - success?: (data: any) => void; - - /** - * Called when the stored content fails to be read. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Modifies the stored content. - * @param options - */ - static set(options: { - /** - * Index of the stored content to be modified. - * @since 3 - */ - key: string; - - /** - * Target storage content. If the content is an empty string, the data item with the key as the index will be deleted. - * @since 3 - */ - value: string; - - /** - * Called when the stored content is modified successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be modified. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Clears the stored content. - * @param options - */ - static clear(options?: { - /** - * Called when the stored content is cleared successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be cleared. - * @since 3 - */ - fail?: (data: any, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Deletes the stored content. - * @param options - */ - static delete(options: { - /** - * Content index. - * @since 3 - */ - key: string; - - /** - * Called when the stored content is deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the stored content fails to be deleted. - * @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.vibrator.d.ts b/api/wearable/@system.vibrator.d.ts deleted file mode 100644 index cf23b8a6de9c3af921df85dda15ecb65679837a8..0000000000000000000000000000000000000000 --- a/api/wearable/@system.vibrator.d.ts +++ /dev/null @@ -1,63 +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. - */ - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export interface VibrateOptions { - /** - * Vibration mode. The value long indicates long vibration, and short indicates short vibration. - * The default value is long. - * @since 3 - */ - mode?: "long" | "short"; - - /** - * Called when success to trigger vibration. - * @since 3 - */ - success: () => void; - - /** - * Called when fail to trigger vibration. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @SysCap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; - * @permission ohos.permission.VIBRATE - * @since 3 - */ -export default class Vibrator { - /** - * Triggers vibration. - * @param options Options. - * @permission ohos.permission.VIBRATE - * @since 3 - */ - static vibrate(options?: VibrateOptions): void; -} \ No newline at end of file