• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16import { AsyncCallback } from "./basic";
17
18declare namespace devicestatus {
19    export enum DevicestatusType {
20        TYPE_HIGH_STILL = 0,
21        TYPE_FINE_STILL = 1,
22        TYPE_CAR_BLUETOOTH = 2
23    }
24
25    export enum DevicestatusValue {
26        VALUE_ENTER = 0,
27        VALUE_EXIT
28    }
29
30    export interface DevicestatusResponse {
31        devicestatusValue: DevicestatusValue
32    }
33
34    export interface HighStillResponse extends DevicestatusResponse {}
35    export interface FineStillResponse extends DevicestatusResponse {}
36    export interface CarBluetoothResponse extends DevicestatusResponse {}
37
38    function on(type: DevicestatusType.TYPE_HIGH_STILL, callback: AsyncCallback<HighStillResponse>): void;
39    function once(type: DevicestatusType.TYPE_HIGH_STILL, callback: AsyncCallback<HighStillResponse>): void;
40    function off(type: DevicestatusType.TYPE_HIGH_STILL, callback: AsyncCallback<void>): void;
41
42    function on(type: DevicestatusType.TYPE_FINE_STILL, callback: AsyncCallback<FineStillResponse>): void;
43    function once(type: DevicestatusType.TYPE_FINE_STILL, callback: AsyncCallback<FineStillResponse>): void;
44    function off(type: DevicestatusType.TYPE_FINE_STILL, callback: AsyncCallback<void>): void;
45
46    function on(type: DevicestatusType.TYPE_CAR_BLUETOOTH, callback: AsyncCallback<CarBluetoothResponse>): void;
47    function once(type: DevicestatusType.TYPE_CAR_BLUETOOTH, callback: AsyncCallback<CarBluetoothResponse>): void;
48    function off(type: DevicestatusType.TYPE_CAR_BLUETOOTH, callback: AsyncCallback<void>): void;
49}
50export default devicestatus;