1/* 2 * Copyright (c) 2023-2023 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/// <reference path="../component/units.d.ts" /> 17 18import { ResourceStr } from 'GlobalResource'; 19 20/** 21 * Control style of operation element 22 * @enum { OperationStyle } 23 * @syscap SystemCapability.ArkUI.ArkUI.Full 24 * @since 10 25 */ 26export declare enum OperationType { 27 /** 28 * The TextArrow style. 29 * @syscap SystemCapability.ArkUI.ArkUI.Full 30 * @since 10 31 */ 32 TEXT_ARROW = 0, 33 34 /** 35 * The Button style. 36 * @syscap SystemCapability.ArkUI.ArkUI.Full 37 * @since 10 38 */ 39 BUTTON = 1, 40 41 /** 42 * The IconGroup style. 43 * @syscap SystemCapability.ArkUI.ArkUI.Full 44 * @since 10 45 */ 46 ICON_GROUP = 2, 47 48 /** 49 * The LoadingProgress style. 50 * @syscap SystemCapability.ArkUI.ArkUI.Full 51 * @since 10 52 */ 53 LOADING = 3 54} 55 56/** 57 * Declare type OperationOption 58 * @syscap SystemCapability.ArkUI.ArkUI.Full 59 * @since 10 60 */ 61export declare class OperationOption { 62 /** 63 * The content of text or the address of icon. 64 * @type { ResourceStr }. 65 * @since 10 66 */ 67 value: ResourceStr; 68 69 /** 70 * callback function when operate the text or icon. 71 * @type { () => void }. 72 * @since 10 73 */ 74 action?: () => void; 75} 76 77/** 78 * Declare type SelectOption 79 * @syscap SystemCapability.ArkUI.ArkUI.Full 80 * @since 10 81 */ 82export declare class SelectOptions { 83 /** 84 * SubOption array of the select. 85 * @type { Array<SelectSubOption> }. 86 * @since 10 87 */ 88 options: Array<SelectOption>; 89 90 /** 91 * The default selected index. 92 * @type { number }. 93 * @since 10 94 */ 95 selected?: number; 96 97 /** 98 * The default text value. 99 * @type { string }. 100 * @since 10 101 */ 102 value?: string; 103 104 /** 105 * Callback when the select is selected. 106 * @type { (index: number, value?: string) => void }. 107 * @since 10 108 */ 109 onSelect?: (index: number, value?: string) => void; 110} 111 112/** 113 * Declare struct SubHeader 114 * @syscap SystemCapability.ArkUI.ArkUI.Full 115 * @since 10 116 */ 117@Component 118export declare struct SubHeader { 119 120 /** 121 * Icon resource of content area. 122 * @type { ResourceStr }. 123 * @syscap SystemCapability.ArkUI.ArkUI.Full 124 * @since 10 125 */ 126 @Prop icon?: ResourceStr; 127 128 /** 129 * The first line text of content area. 130 * @type { ResourceStr }. 131 * @syscap SystemCapability.ArkUI.ArkUI.Full 132 * @since 10 133 */ 134 @Prop primaryTitle?: ResourceStr; 135 136 /** 137 * The secondary line text of content area. 138 * @type { ResourceStr }. 139 * @syscap SystemCapability.ArkUI.ArkUI.Full 140 * @since 10 141 */ 142 @Prop secondaryTitle?: ResourceStr; 143 144 /** 145 * Select option of content area. 146 * @type { SelectOptions }. 147 * @syscap SystemCapability.ArkUI.ArkUI.Full 148 * @since 10 149 */ 150 select?: SelectOptions; 151 152 /** 153 * Operation style of SubHeader. 154 * @type { OperationStyle }. 155 * @syscap SystemCapability.ArkUI.ArkUI.Full 156 * @since 10 157 */ 158 @Prop operationType?: OperationType; 159 160 /** 161 * operation item. 162 * @type { Array<OperationOption> }. 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @since 10 165 */ 166 operationItem?: Array<OperationOption>; 167}