1/* 2 * Copyright (c) 2023-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 ArkUI 19 */ 20 21/// <reference path="../component/units.d.ts" /> 22 23import { ResourceStr } from 'GlobalResource'; 24 25/** 26 * Control style of operation element 27 * @enum { OperationStyle } 28 * @syscap SystemCapability.ArkUI.ArkUI.Full 29 * @since 10 30 */ 31/** 32 * Control style of operation element 33 * @enum { OperationStyle } 34 * @syscap SystemCapability.ArkUI.ArkUI.Full 35 * @atomicservice 36 * @since 11 37 */ 38export declare enum OperationType { 39 /** 40 * The TextArrow style. 41 * @syscap SystemCapability.ArkUI.ArkUI.Full 42 * @since 10 43 */ 44 /** 45 * The TextArrow style. 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @atomicservice 48 * @since 11 49 */ 50 TEXT_ARROW = 0, 51 52 /** 53 * The Button style. 54 * @syscap SystemCapability.ArkUI.ArkUI.Full 55 * @since 10 56 */ 57 /** 58 * The Button style. 59 * @syscap SystemCapability.ArkUI.ArkUI.Full 60 * @atomicservice 61 * @since 11 62 */ 63 BUTTON = 1, 64 65 /** 66 * The IconGroup style. 67 * @syscap SystemCapability.ArkUI.ArkUI.Full 68 * @since 10 69 */ 70 /** 71 * The IconGroup style. 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @atomicservice 74 * @since 11 75 */ 76 ICON_GROUP = 2, 77 78 /** 79 * The LoadingProgress style. 80 * @syscap SystemCapability.ArkUI.ArkUI.Full 81 * @since 10 82 */ 83 /** 84 * The LoadingProgress style. 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @atomicservice 87 * @since 11 88 */ 89 LOADING = 3 90} 91 92/** 93 * Declare type OperationOption 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @since 10 96 */ 97/** 98 * Declare type OperationOption 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @atomicservice 101 * @since 11 102 */ 103export declare class OperationOption { 104 /** 105 * The content of text or the address of icon. 106 * @type { ResourceStr }. 107 * @syscap SystemCapability.ArkUI.ArkUI.Full 108 * @since 10 109 */ 110 /** 111 * The content of text or the address of icon. 112 * @type { ResourceStr }. 113 * @syscap SystemCapability.ArkUI.ArkUI.Full 114 * @atomicservice 115 * @since 11 116 */ 117 value: ResourceStr; 118 119 /** 120 * callback function when operate the text or icon. 121 * @type { () => void }. 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @since 10 124 */ 125 /** 126 * callback function when operate the text or icon. 127 * @type { () => void }. 128 * @syscap SystemCapability.ArkUI.ArkUI.Full 129 * @atomicservice 130 * @since 11 131 */ 132 action?: () => void; 133} 134 135/** 136 * Declare type SelectOption 137 * @syscap SystemCapability.ArkUI.ArkUI.Full 138 * @since 10 139 */ 140/** 141 * Declare type SelectOption 142 * @syscap SystemCapability.ArkUI.ArkUI.Full 143 * @atomicservice 144 * @since 11 145 */ 146export declare class SelectOptions { 147 /** 148 * SubOption array of the select. 149 * @type { Array<SelectSubOption> }. 150 * @syscap SystemCapability.ArkUI.ArkUI.Full 151 * @since 10 152 */ 153 /** 154 * SubOption array of the select. 155 * @type { Array<SelectSubOption> }. 156 * @syscap SystemCapability.ArkUI.ArkUI.Full 157 * @atomicservice 158 * @since 11 159 */ 160 options: Array<SelectOption>; 161 162 /** 163 * The default selected index. 164 * @type { number }. 165 * @syscap SystemCapability.ArkUI.ArkUI.Full 166 * @since 10 167 */ 168 /** 169 * The default selected index. 170 * @type { number }. 171 * @syscap SystemCapability.ArkUI.ArkUI.Full 172 * @atomicservice 173 * @since 11 174 */ 175 selected?: number; 176 177 /** 178 * The default text value. 179 * @type { string }. 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @since 10 182 */ 183 /** 184 * The default text value. 185 * @type { string }. 186 * @syscap SystemCapability.ArkUI.ArkUI.Full 187 * @atomicservice 188 * @since 11 189 */ 190 value?: string; 191 192 /** 193 * Callback when the select is selected. 194 * @type { (index: number, value?: string) => void }. 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @since 10 197 */ 198 /** 199 * Callback when the select is selected. 200 * @type { (index: number, value?: string) => void }. 201 * @syscap SystemCapability.ArkUI.ArkUI.Full 202 * @atomicservice 203 * @since 11 204 */ 205 onSelect?: (index: number, value?: string) => void; 206} 207 208/** 209 * The symbol rendering strategy. 210 * 211 * @enum { number } 212 * @syscap SystemCapability.ArkUI.ArkUI.Full 213 * @crossplatform 214 * @atomicservice 215 * @since 12 216 */ 217declare enum SymbolRenderingStrategy { 218 /** 219 * The single rendering strategy. 220 * 221 * @syscap SystemCapability.ArkUI.ArkUI.Full 222 * @crossplatform 223 * @atomicservice 224 * @since 12 225 */ 226 SINGLE = 0, 227 228 /** 229 * The multiple color rendering strategy. 230 * 231 * @syscap SystemCapability.ArkUI.ArkUI.Full 232 * @crossplatform 233 * @atomicservice 234 * @since 12 235 */ 236 MULTIPLE_COLOR = 1, 237 238 /** 239 * The multiple opacity rendering strategy. 240 * 241 * @syscap SystemCapability.ArkUI.ArkUI.Full 242 * @crossplatform 243 * @atomicservice 244 * @since 12 245 */ 246 MULTIPLE_OPACITY = 2, 247} 248 249/** 250 * The symbol effect strategy. 251 * 252 * @enum { number } 253 * @syscap SystemCapability.ArkUI.ArkUI.Full 254 * @crossplatform 255 * @atomicservice 256 * @since 12 257 */ 258declare enum SymbolEffectStrategy { 259 /** 260 * There is no effect strategy. 261 * 262 * @syscap SystemCapability.ArkUI.ArkUI.Full 263 * @crossplatform 264 * @atomicservice 265 * @since 12 266 */ 267 NONE = 0, 268 269 /** 270 * The scale effect strategy. 271 * 272 * @syscap SystemCapability.ArkUI.ArkUI.Full 273 * @crossplatform 274 * @atomicservice 275 * @since 12 276 */ 277 SCALE = 1, 278 279 /** 280 * The hierarchical effect strategy. 281 * 282 * @syscap SystemCapability.ArkUI.ArkUI.Full 283 * @crossplatform 284 * @atomicservice 285 * @since 12 286 */ 287 HIERARCHICAL = 2, 288} 289 290/** 291 * Declare type SymbolOptions 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @atomicservice 294 * @since 12 295 */ 296export declare class SymbolOptions { 297 /** 298 * The size of symbol icon. 299 * @type { ?(number | string | Resource) }. 300 * @syscap SystemCapability.ArkUI.ArkUI.Full 301 * @atomicservice 302 * @since 12 303 */ 304 fontSize?: number | string | Resource; 305 306 /** 307 * The color of symbol icon. 308 * @type { ?(Array<ResourceColor>) }. 309 * @syscap SystemCapability.ArkUI.ArkUI.Full 310 * @atomicservice 311 * @since 12 312 */ 313 fontColor?: Array<ResourceColor>; 314 315 /** 316 * The fontWeight of symbol icon. 317 * @type { ?(number | FontWeight | string) }. 318 * @syscap SystemCapability.ArkUI.ArkUI.Full 319 * @atomicservice 320 * @since 12 321 */ 322 fontWeight?: number | FontWeight | string; 323 324 /** 325 * The effect strategy of symbol icon. 326 * @type { ?(SymbolEffectStrategy) }. 327 * @syscap SystemCapability.ArkUI.ArkUI.Full 328 * @atomicservice 329 * @since 12 330 */ 331 effectStrategy?: SymbolEffectStrategy; 332 333 /** 334 * The rendering strategy of symbol icon. 335 * @type { ?(SymbolRenderingStrategy) }. 336 * @syscap SystemCapability.ArkUI.ArkUI.Full 337 * @atomicservice 338 * @since 12 339 */ 340 renderingStrategy?: SymbolRenderingStrategy; 341} 342 343/** 344 * Declare struct SubHeader 345 * @syscap SystemCapability.ArkUI.ArkUI.Full 346 * @since 10 347 */ 348/** 349 * Declare struct SubHeader 350 * @syscap SystemCapability.ArkUI.ArkUI.Full 351 * @atomicservice 352 * @since 11 353 */ 354@Component 355export declare struct SubHeader { 356 357 /** 358 * Icon resource of content area. 359 * @type { ResourceStr }. 360 * @syscap SystemCapability.ArkUI.ArkUI.Full 361 * @since 10 362 */ 363 /** 364 * Icon resource of content area. 365 * @type { ResourceStr }. 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @atomicservice 368 * @since 11 369 */ 370 @Prop icon?: ResourceStr; 371 372 /** 373 * Attributes of Symbol icon. 374 * @type { SymbolOptions}. 375 * @syscap SystemCapability.ArkUI.ArkUI.Full 376 * @since 12 377 */ 378 iconSymbolOptions?: SymbolOptions; 379 380 /** 381 * The first line text of content area. 382 * @type { ResourceStr }. 383 * @syscap SystemCapability.ArkUI.ArkUI.Full 384 * @since 10 385 */ 386 /** 387 * The first line text of content area. 388 * @type { ResourceStr }. 389 * @syscap SystemCapability.ArkUI.ArkUI.Full 390 * @atomicservice 391 * @since 11 392 */ 393 @Prop primaryTitle?: ResourceStr; 394 395 /** 396 * The secondary line text of content area. 397 * @type { ResourceStr }. 398 * @syscap SystemCapability.ArkUI.ArkUI.Full 399 * @since 10 400 */ 401 /** 402 * The secondary line text of content area. 403 * @type { ResourceStr }. 404 * @syscap SystemCapability.ArkUI.ArkUI.Full 405 * @atomicservice 406 * @since 11 407 */ 408 @Prop secondaryTitle?: ResourceStr; 409 410 /** 411 * Select option of content area. 412 * @type { SelectOptions }. 413 * @syscap SystemCapability.ArkUI.ArkUI.Full 414 * @since 10 415 */ 416 /** 417 * Select option of content area. 418 * @type { SelectOptions }. 419 * @syscap SystemCapability.ArkUI.ArkUI.Full 420 * @atomicservice 421 * @since 11 422 */ 423 select?: SelectOptions; 424 425 /** 426 * Operation style of SubHeader. 427 * @type { OperationStyle }. 428 * @syscap SystemCapability.ArkUI.ArkUI.Full 429 * @since 10 430 */ 431 /** 432 * Operation style of SubHeader. 433 * @type { OperationStyle }. 434 * @syscap SystemCapability.ArkUI.ArkUI.Full 435 * @atomicservice 436 * @since 11 437 */ 438 @Prop operationType?: OperationType; 439 440 /** 441 * operation item. 442 * @type { Array<OperationOption> }. 443 * @syscap SystemCapability.ArkUI.ArkUI.Full 444 * @since 10 445 */ 446 /** 447 * operation item. 448 * @type { Array<OperationOption> }. 449 * @syscap SystemCapability.ArkUI.ArkUI.Full 450 * @atomicservice 451 * @since 11 452 */ 453 operationItem?: Array<OperationOption>; 454 455 /** 456 * Attributes of Symbol icons in operation area. 457 * @type { Array<SymbolOptions> }. 458 * @syscap SystemCapability.ArkUI.ArkUI.Full 459 * @since 12 460 */ 461 operationSymbolOptions?: Array<SymbolOptions>; 462}