mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-23 15:20:17 +00:00
Signed-off-by:hellohyh001<huiyuehong@huawei.com>
This commit is contained in:
parent
adc4e51790
commit
0a56c56251
215
api/@system.sensor.d.ts
vendored
215
api/@system.sensor.d.ts
vendored
@ -461,166 +461,7 @@ export interface SubscribeGyroscopeOptions {
|
||||
/**
|
||||
* @syscap SystemCapability.Sensors.Sensor
|
||||
* @import import sensor from '@system.sensor';
|
||||
* @since 7
|
||||
* @deprecated since 8
|
||||
*/
|
||||
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
|
||||
* @deprecated since 8
|
||||
*/
|
||||
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
|
||||
* @deprecated since 8
|
||||
*/
|
||||
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
|
||||
* @deprecated since 8
|
||||
*/
|
||||
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
|
||||
* @deprecated since 8
|
||||
*/
|
||||
export interface HallResponse {
|
||||
/**
|
||||
* Indicates the hall sensor data.
|
||||
* @since 7
|
||||
*/
|
||||
value: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @syscap SystemCapability.Sensors.Sensor
|
||||
* @import import sensor from '@system.sensor';
|
||||
* @since 7
|
||||
* @deprecated since 8
|
||||
*/
|
||||
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
|
||||
* @since 6
|
||||
* @deprecated since 8
|
||||
*/
|
||||
export default class Sensor {
|
||||
@ -821,58 +662,4 @@ export default class Sensor {
|
||||
* @deprecated since 8
|
||||
*/
|
||||
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
|
||||
* @deprecated since 8
|
||||
*/
|
||||
static subscribeGravity(options: SubscribeGravityOptions): void;
|
||||
|
||||
/**
|
||||
* Cancels listening to gravity sensor data.
|
||||
* @syscap SystemCapability.Sensors.Sensor
|
||||
* @since 7
|
||||
* @deprecated since 8
|
||||
*/
|
||||
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
|
||||
* @deprecated since 8
|
||||
*/
|
||||
static subscribeMagnetic(options: SubscribeMagneticOptions): void;
|
||||
|
||||
/**
|
||||
* Cancels listening to magnetic sensor data.
|
||||
* @syscap SystemCapability.Sensors.Sensor
|
||||
* @since 7
|
||||
* @deprecated since 8
|
||||
*/
|
||||
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
|
||||
* @deprecated since 8
|
||||
*/
|
||||
static subscribeHall(options: SubscribeHallOptions): void;
|
||||
|
||||
/**
|
||||
* Cancels listening to hall sensor data.
|
||||
* @syscap SystemCapability.Sensors.Sensor
|
||||
* @since 7
|
||||
* @deprecated since 8
|
||||
*/
|
||||
static unsubscribeHall(): void;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user