• 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 * @file Defines toolbar attributes.
18 * @kit ArkUI
19 */
20
21/**
22 * Declare the placement of the toolbar item.
23 *
24 * @enum { number }
25 * @syscap SystemCapability.ArkUI.ArkUI.Full
26 * @crossplatform
27 * @since 20
28 */
29declare enum ToolBarItemPlacement {
30  /**
31   * Place toolbar item at the leading of top bar.
32   *
33   * @syscap SystemCapability.ArkUI.ArkUI.Full
34   * @crossplatform
35   * @since 20
36   */
37  TOP_BAR_LEADING = 0,
38
39  /**
40   * Place toolbar item at the trailing of top bar.
41   *
42   * @syscap SystemCapability.ArkUI.ArkUI.Full
43   * @crossplatform
44   * @since 20
45   */
46  TOP_BAR_TRAILING = 1,
47}
48
49/**
50 * ToolBarItem constructor options.
51 *
52 * @interface ToolBarItemOptions
53 * @syscap SystemCapability.ArkUI.ArkUI.Full
54 * @crossplatform
55 * @since 20
56 */
57interface ToolBarItemOptions {
58  /**
59   * Vertical layout element spacing.
60   *
61   * @type { ?ToolBarItemPlacement }
62   * @syscap SystemCapability.ArkUI.ArkUI.Full
63   * @crossplatform
64   * @since 20
65   */
66  placement?: ToolBarItemPlacement;
67}
68
69/**
70 * Defines the ToolBarItem Component.
71 *
72 * @interface ToolBarItemInterface
73 * @syscap SystemCapability.ArkUI.ArkUI.Full
74 * @crossplatform
75 * @since 20
76 */
77interface ToolBarItemInterface {
78  /**
79   * Set the options.
80   *
81   * @param { ToolBarItemOptions } [options] - column options
82   * @returns { ToolBarItemAttribute }
83   * @syscap SystemCapability.ArkUI.ArkUI.Full
84   * @crossplatform
85   * @since 20
86   */
87  (options?: ToolBarItemOptions): ToolBarItemAttribute;
88}
89
90/**
91 * Defines the ToolBarItem component attribute functions.
92 *
93 * @syscap SystemCapability.ArkUI.ArkUI.Full
94 * @crossplatform
95 * @since 20
96 */
97declare class ToolBarItemAttribute { }
98
99/**
100 * Defines ToolBarItem Component.
101 *
102 * @type { ToolBarItemInterface }
103 * @syscap SystemCapability.ArkUI.ArkUI.Full
104 * @crossplatform
105 * @since 20
106 */
107declare const ToolBarItem: ToolBarItemInterface;
108
109/**
110 * Defines ToolBarItem Component instance.
111 *
112 * @type { ToolBarItemAttribute }
113 * @syscap SystemCapability.ArkUI.ArkUI.Full
114 * @crossplatform
115 * @since 20
116 */
117declare const ToolBarItemInstance: ToolBarItemAttribute;