• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 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 *  SDK API of AddMonitor and its option.
18 */
19/**
20 * Function that returns monitor instance value when state variable is changed.
21 *
22 * @typedef { function } MonitorCallback
23 * @param { IMonitor} monitorValue monitor instance value when state variable is changed.
24 * @syscap SystemCapability.ArkUI.ArkUI.Full
25 * @crossplatform
26 * @atomicservice
27 * @since 20
28 */
29declare type MonitorCallback = (monitorValue: IMonitor) => void;
30
31/**
32 * Define Monitor options.
33 *
34 * @interface MonitorOptions
35 * @syscap SystemCapability.ArkUI.ArkUI.Full
36 * @crossplatform
37 * @atomicservice
38 * @since 20
39 */
40interface MonitorOptions {
41  /**
42  * Used to determine whether the state variable change is
43  * triggered synchronously or asynchronously. The default value is false.
44  *
45  * @type { ?boolean } isSynchronous parameter
46  * @default false
47  * @syscap SystemCapability.ArkUI.ArkUI.Full
48  * @crossplatform
49  * @atomicservice
50  *
51  * @since 20
52  */
53  isSynchronous?: boolean;
54}