• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024 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
16/**
17 * @file
18 * @kit InputKit
19 */
20
21/**
22 * Declares the APIs for configuring attributes of the IR emitter.
23 *
24 * @namespace infraredEmitter
25 * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
26 * @since 12
27 */
28declare namespace infraredEmitter {
29  /**
30   * Infrared frequency range supported by the IR emitter.
31   *
32   * @interface InfraredFrequency
33   * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
34   * @systemapi hide for inner use
35   * @since 12
36   */
37  /**
38   * Infrared frequency range supported by the IR emitter.
39   *
40   * @interface InfraredFrequency
41   * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
42   * @since 15
43   */
44  interface InfraredFrequency {
45    /**
46     * Maximum frequency.
47     *
48     * @type { number }
49     * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
50     * @systemapi hide for inner use
51     * @since 12
52     */
53    /**
54     * Maximum frequency.
55     *
56     * @type { number }
57     * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
58     * @since 15
59     */
60    max: number;
61
62    /**
63     * Minimum frequency.
64     *
65     * @type { number }
66     * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
67     * @systemapi hide for inner use
68     * @since 12
69     */
70    /**
71     * Minimum frequency.
72     *
73     * @type { number }
74     * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
75     * @since 15
76     */
77    min: number;
78  }
79
80  /**
81   * Transmitted IR signal.
82   *
83   * @permission ohos.permission.MANAGE_INPUT_INFRARED_EMITTER
84   * @param { number} infraredFrequency - IR infrared frequency, in Hz.
85   * @param { Array<number>} pattern - Pattern of signal transmission in alternate on/off mode, in microseconds.
86   * @throws { BusinessError } 201 - Permission denied.
87   * @throws { BusinessError } 202 - Not system application.
88   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
89   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
90   * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
91   * @systemapi hide for inner use
92   * @since 12
93   */
94  /**
95   * Transmitted IR signal.
96   *
97   * @permission ohos.permission.MANAGE_INPUT_INFRARED_EMITTER
98   * @param { number} infraredFrequency - IR infrared frequency, in Hz.
99   * @param { Array<number>} pattern - Pattern of signal transmission in alternate on/off mode, in microseconds.
100   * @throws { BusinessError } 201 - Permission denied.
101   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified;
102   * <br>2. Incorrect parameter types; 3. Parameter verification failed.
103   * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
104   * @since 15
105   */
106  function transmitInfrared(infraredFrequency: number, pattern: Array<number>): void;
107
108  /**
109   * Obtains the infrared frequency supported by the IR emitter.
110   *
111   * @permission ohos.permission.MANAGE_INPUT_INFRARED_EMITTER
112   * @returns { Array<InfraredFrequency> } The return value is an array of InfraredFrequency objects, indicating the infrared frequency ranges supported by the IR emitter.
113   * @throws { BusinessError } 201 - Permission denied.
114   * @throws { BusinessError } 202 - Not system application.
115   * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
116   * @systemapi hide for inner use
117   * @since 12
118   */
119  /**
120   * Obtains the infrared frequency supported by the IR emitter.
121   *
122   * @permission ohos.permission.MANAGE_INPUT_INFRARED_EMITTER
123   * @returns { Array<InfraredFrequency> } The return value is an array of InfraredFrequency objects, indicating the infrared frequency ranges supported by the IR emitter.
124   * @throws { BusinessError } 201 - Permission denied.
125   * @syscap SystemCapability.MultimodalInput.Input.InfraredEmitter
126   * @since 15
127   */
128  function getInfraredFrequencies(): Array<InfraredFrequency>;
129}
130
131export default infraredEmitter;
132