1/* 2 * Copyright (c) 2021-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/** 17 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Provides a way to control the textclock status. 23 * 24 * @syscap SystemCapability.ArkUI.ArkUI.Full 25 * @since 8 26 */ 27/** 28 * Provides a way to control the textclock status. 29 * 30 * @syscap SystemCapability.ArkUI.ArkUI.Full 31 * @crossplatform 32 * @since 10 33 */ 34/** 35 * Provides a way to control the textclock status. 36 * 37 * @syscap SystemCapability.ArkUI.ArkUI.Full 38 * @crossplatform 39 * @form 40 * @atomicservice 41 * @since 11 42 */ 43declare class TextClockController { 44 /** 45 * constructor. 46 * 47 * @syscap SystemCapability.ArkUI.ArkUI.Full 48 * @since 8 49 */ 50 /** 51 * constructor. 52 * 53 * @syscap SystemCapability.ArkUI.ArkUI.Full 54 * @crossplatform 55 * @since 10 56 */ 57 /** 58 * constructor. 59 * 60 * @syscap SystemCapability.ArkUI.ArkUI.Full 61 * @crossplatform 62 * @form 63 * @atomicservice 64 * @since 11 65 */ 66 constructor(); 67 /** 68 * Provides a start event for textclock. 69 * 70 * @syscap SystemCapability.ArkUI.ArkUI.Full 71 * @since 8 72 */ 73 /** 74 * Provides a start event for textclock. 75 * 76 * @syscap SystemCapability.ArkUI.ArkUI.Full 77 * @crossplatform 78 * @since 10 79 */ 80 /** 81 * Provides a start event for textclock. 82 * 83 * @syscap SystemCapability.ArkUI.ArkUI.Full 84 * @crossplatform 85 * @form 86 * @atomicservice 87 * @since 11 88 */ 89 start(); 90 /** 91 * Provides a stop event for textclock. 92 * 93 * @syscap SystemCapability.ArkUI.ArkUI.Full 94 * @since 8 95 */ 96 /** 97 * Provides a stop event for textclock. 98 * 99 * @syscap SystemCapability.ArkUI.ArkUI.Full 100 * @crossplatform 101 * @since 10 102 */ 103 /** 104 * Provides a stop event for textclock. 105 * 106 * @syscap SystemCapability.ArkUI.ArkUI.Full 107 * @crossplatform 108 * @form 109 * @atomicservice 110 * @since 11 111 */ 112 stop(); 113} 114 115/** 116 * TextClockConfiguration used by text clock content modifier 117 * 118 * @extends CommonConfiguration<TextClockConfiguration> 119 * @interface TextClockConfiguration 120 * @syscap SystemCapability.ArkUI.ArkUI.Full 121 * @crossplatform 122 * @atomicservice 123 * @since 12 124 */ 125declare interface TextClockConfiguration extends CommonConfiguration<TextClockConfiguration> { 126 /** 127 * Specifies the current time zone. 128 * The valid value is an integer ranging from - 14 to 12, 129 * Where a negative value indicates the eastern time zone, for example, -8. 130 * 131 * @type { number } 132 * @syscap SystemCapability.ArkUI.ArkUI.Full 133 * @crossplatform 134 * @atomicservice 135 * @since 12 136 */ 137 timeZoneOffset: number; 138 139 /** 140 * TextClock is started or not. 141 * 142 * @type { boolean } 143 * @syscap SystemCapability.ArkUI.ArkUI.Full 144 * @crossplatform 145 * @atomicservice 146 * @since 12 147 */ 148 started: boolean; 149 150 /** 151 * The time of the TextClock. 152 * 153 * @type { number } 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @crossplatform 156 * @atomicservice 157 * @since 12 158 */ 159 timeValue: number; 160} 161 162/** 163 * Options to construct TextClock component. 164 * 165 * @interface TextClockOptions 166 * @syscap SystemCapability.ArkUI.ArkUI.Full 167 * @crossplatform 168 * @form 169 * @atomicservice 170 * @since 18 171 */ 172declare interface TextClockOptions { 173 /** 174 * Time zone offset. 175 * 176 * @type { ?number } 177 * @syscap SystemCapability.ArkUI.ArkUI.Full 178 * @since 8 179 */ 180 /** 181 * Time zone offset. 182 * 183 * @type { ?number } 184 * @syscap SystemCapability.ArkUI.ArkUI.Full 185 * @crossplatform 186 * @since 10 187 */ 188 /** 189 * Time zone offset. 190 * 191 * @type { ?number } 192 * @syscap SystemCapability.ArkUI.ArkUI.Full 193 * @crossplatform 194 * @form 195 * @atomicservice 196 * @since 11 197 */ 198 /** 199 * Time zone offset. 200 * Anonymous Object Rectification. 201 * 202 * @type { ?number } 203 * @syscap SystemCapability.ArkUI.ArkUI.Full 204 * @crossplatform 205 * @form 206 * @atomicservice 207 * @since 18 208 */ 209 timeZoneOffset?: number; 210 211 /** 212 * TextClock controller. 213 * 214 * @type { ?TextClockController } 215 * @syscap SystemCapability.ArkUI.ArkUI.Full 216 * @since 8 217 */ 218 /** 219 * TextClock controller. 220 * 221 * @type { ?TextClockController } 222 * @syscap SystemCapability.ArkUI.ArkUI.Full 223 * @crossplatform 224 * @since 10 225 */ 226 /** 227 * TextClock controller. 228 * 229 * @type { ?TextClockController } 230 * @syscap SystemCapability.ArkUI.ArkUI.Full 231 * @crossplatform 232 * @form 233 * @atomicservice 234 * @since 11 235 */ 236 /** 237 * TextClock controller. 238 * Anonymous Object Rectification. 239 * 240 * @type { ?TextClockController } 241 * @syscap SystemCapability.ArkUI.ArkUI.Full 242 * @crossplatform 243 * @form 244 * @atomicservice 245 * @since 18 246 */ 247 controller?: TextClockController 248} 249 250/** 251 * TextClock component, which provides the text clock capability. 252 * 253 * @interface TextClockInterface 254 * @syscap SystemCapability.ArkUI.ArkUI.Full 255 * @since 8 256 */ 257/** 258 * TextClock component, which provides the text clock capability. 259 * 260 * @interface TextClockInterface 261 * @syscap SystemCapability.ArkUI.ArkUI.Full 262 * @crossplatform 263 * @since 10 264 */ 265/** 266 * TextClock component, which provides the text clock capability. 267 * 268 * @interface TextClockInterface 269 * @syscap SystemCapability.ArkUI.ArkUI.Full 270 * @crossplatform 271 * @form 272 * @atomicservice 273 * @since 11 274 */ 275interface TextClockInterface { 276 /** 277 * Construct the text clock component. 278 * Specifies the current time zone. 279 * The valid value is an integer ranging from - 14 to 12, 280 * Where a negative value indicates the eastern time zone, for example, -8. 281 * 282 * @param { object } options 283 * @returns { TextClockAttribute } 284 * @syscap SystemCapability.ArkUI.ArkUI.Full 285 * @since 8 286 */ 287 /** 288 * Construct the text clock component. 289 * Specifies the current time zone. 290 * The valid value is an integer ranging from - 14 to 12, 291 * Where a negative value indicates the eastern time zone, for example, -8. 292 * 293 * @param { object } options 294 * @returns { TextClockAttribute } 295 * @syscap SystemCapability.ArkUI.ArkUI.Full 296 * @crossplatform 297 * @since 10 298 */ 299 /** 300 * Construct the text clock component. 301 * Specifies the current time zone. 302 * The valid value is an integer ranging from - 14 to 12, 303 * Where a negative value indicates the eastern time zone, for example, -8. 304 * 305 * @param { object } options 306 * @returns { TextClockAttribute } 307 * @syscap SystemCapability.ArkUI.ArkUI.Full 308 * @crossplatform 309 * @form 310 * @atomicservice 311 * @since 11 312 */ 313 /** 314 * Construct the text clock component. 315 * Specifies the current time zone. 316 * The valid value is an integer ranging from - 14 to 12, 317 * Where a negative value indicates the eastern time zone, for example, -8. 318 * Anonymous Object Rectification. 319 * 320 * @param { TextClockOptions } [options] - TextClock options. 321 * @returns { TextClockAttribute } 322 * @syscap SystemCapability.ArkUI.ArkUI.Full 323 * @crossplatform 324 * @form 325 * @atomicservice 326 * @since 18 327 */ 328 (options?: TextClockOptions): TextClockAttribute; 329} 330 331/** 332 * Provides attribute for TextClock. 333 * 334 * @extends CommonMethod<TextClockAttribute> 335 * @syscap SystemCapability.ArkUI.ArkUI.Full 336 * @since 8 337 */ 338/** 339 * Provides attribute for TextClock. 340 * 341 * @extends CommonMethod<TextClockAttribute> 342 * @syscap SystemCapability.ArkUI.ArkUI.Full 343 * @crossplatform 344 * @since 10 345 */ 346/** 347 * Provides attribute for TextClock. 348 * 349 * @extends CommonMethod<TextClockAttribute> 350 * @syscap SystemCapability.ArkUI.ArkUI.Full 351 * @crossplatform 352 * @form 353 * @atomicservice 354 * @since 11 355 */ 356declare class TextClockAttribute extends CommonMethod<TextClockAttribute> { 357 /** 358 * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd". 359 * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English), 360 * dd,ddd(English Week abbreviation),dddd(Full name of the week in English), 361 * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second). 362 * 363 * @param { string } value 364 * @returns { TextClockAttribute } 365 * @syscap SystemCapability.ArkUI.ArkUI.Full 366 * @since 8 367 */ 368 /** 369 * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd". 370 * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English), 371 * dd,ddd(English Week abbreviation),dddd(Full name of the week in English), 372 * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second). 373 * 374 * @param { string } value 375 * @returns { TextClockAttribute } 376 * @syscap SystemCapability.ArkUI.ArkUI.Full 377 * @crossplatform 378 * @since 10 379 */ 380 /** 381 * set display time format,such as "yyyy/mm/dd","yyyy-mm-dd". 382 * support time format:yyyy,mm,mmm(English month abbreviation),mmmm(Full name of the month in English), 383 * dd,ddd(English Week abbreviation),dddd(Full name of the week in English), 384 * HH/hh(24-hour clock/12-hour clock),MM/mm(minute),SS/ss(second). 385 * The default value is "hh:mm:ss" when TextClock is not in a form. 386 * The default value is "hh:mm" when TextClock is in a form. 387 * If the value has second or millisecond, the value will be set to the default value. 388 * 389 * @param { string } value 390 * @returns { TextClockAttribute } 391 * @syscap SystemCapability.ArkUI.ArkUI.Full 392 * @crossplatform 393 * @form 394 * @atomicservice 395 * @since 11 396 */ 397 format(value: string): TextClockAttribute; 398 399 /** 400 * Provides a date change callback. 401 * The callback parameter is Unix Time Stamp, 402 * The number of milliseconds that have elapsed since January 1, 1970 (UTC). 403 * The minimum callback interval for this event is seconds. 404 * You can listen to this callback, 405 * Use the format attribute method to customize data display in the callback. 406 * 407 * @param { function } event - Listening date event callback. 408 * @returns { TextClockAttribute } 409 * @syscap SystemCapability.ArkUI.ArkUI.Full 410 * @since 8 411 */ 412 /** 413 * Provides a date change callback. 414 * The callback parameter is Unix Time Stamp, 415 * The number of milliseconds that have elapsed since January 1, 1970 (UTC). 416 * The minimum callback interval for this event is seconds. 417 * You can listen to this callback, 418 * Use the format attribute method to customize data display in the callback. 419 * 420 * @param { function } event - Listening date event callback. 421 * @returns { TextClockAttribute } 422 * @syscap SystemCapability.ArkUI.ArkUI.Full 423 * @crossplatform 424 * @since 10 425 */ 426 /** 427 * Provides a date change callback. 428 * The callback parameter is Unix Time Stamp, 429 * The number of milliseconds that have elapsed since January 1, 1970 (UTC). 430 * The minimum callback interval for this event default is seconds when TextClock is not in a form. 431 * The minimum callback interval for this event is minutes when TextClock is in a form. 432 * If visibility is Hidden the callback be disabled when TextClock is in a form. 433 * You can listen to this callback, 434 * Use the format attribute method to customize data display in the callback. 435 * 436 * @param { function } event - Listening date event callback. 437 * @returns { TextClockAttribute } 438 * @syscap SystemCapability.ArkUI.ArkUI.Full 439 * @crossplatform 440 * @form 441 * @atomicservice 442 * @since 11 443 */ 444 onDateChange(event: (value: number) => void): TextClockAttribute; 445 446 /** 447 * Called when the value of TextClock fontColor is set 448 * 449 * @param { ResourceColor } value 450 * @returns { TextClockAttribute } 451 * @syscap SystemCapability.ArkUI.ArkUI.Full 452 * @since 8 453 */ 454 /** 455 * Called when the value of TextClock fontColor is set 456 * 457 * @param { ResourceColor } value 458 * @returns { TextClockAttribute } 459 * @syscap SystemCapability.ArkUI.ArkUI.Full 460 * @crossplatform 461 * @since 10 462 */ 463 /** 464 * Called when the value of TextClock fontColor is set 465 * 466 * @param { ResourceColor } value 467 * @returns { TextClockAttribute } 468 * @syscap SystemCapability.ArkUI.ArkUI.Full 469 * @crossplatform 470 * @form 471 * @atomicservice 472 * @since 11 473 */ 474 fontColor(value: ResourceColor): TextClockAttribute; 475 476 /** 477 * Called when the value of TextClock fontSize is set 478 * 479 * @param { Length } value 480 * @returns { TextClockAttribute } 481 * @syscap SystemCapability.ArkUI.ArkUI.Full 482 * @since 8 483 */ 484 /** 485 * Called when the value of TextClock fontSize is set 486 * 487 * @param { Length } value 488 * @returns { TextClockAttribute } 489 * @syscap SystemCapability.ArkUI.ArkUI.Full 490 * @crossplatform 491 * @since 10 492 */ 493 /** 494 * Called when the value of TextClock fontSize is set 495 * 496 * @param { Length } value 497 * @returns { TextClockAttribute } 498 * @syscap SystemCapability.ArkUI.ArkUI.Full 499 * @crossplatform 500 * @form 501 * @atomicservice 502 * @since 11 503 */ 504 fontSize(value: Length): TextClockAttribute; 505 506 /** 507 * Called when the value of TextClock fontStyle is set 508 * 509 * @param { FontStyle } value 510 * @returns { TextClockAttribute } 511 * @syscap SystemCapability.ArkUI.ArkUI.Full 512 * @since 8 513 */ 514 /** 515 * Called when the value of TextClock fontStyle is set 516 * 517 * @param { FontStyle } value 518 * @returns { TextClockAttribute } 519 * @syscap SystemCapability.ArkUI.ArkUI.Full 520 * @crossplatform 521 * @since 10 522 */ 523 /** 524 * Called when the value of TextClock fontStyle is set 525 * 526 * @param { FontStyle } value 527 * @returns { TextClockAttribute } 528 * @syscap SystemCapability.ArkUI.ArkUI.Full 529 * @crossplatform 530 * @form 531 * @atomicservice 532 * @since 11 533 */ 534 fontStyle(value: FontStyle): TextClockAttribute; 535 536 /** 537 * Called when the value of TextClock fontWeight is set 538 * 539 * @param { number | FontWeight | string } value 540 * @returns { TextClockAttribute } 541 * @syscap SystemCapability.ArkUI.ArkUI.Full 542 * @since 8 543 */ 544 /** 545 * Called when the value of TextClock fontWeight is set 546 * 547 * @param { number | FontWeight | string } value 548 * @returns { TextClockAttribute } 549 * @syscap SystemCapability.ArkUI.ArkUI.Full 550 * @crossplatform 551 * @since 10 552 */ 553 /** 554 * Called when the value of TextClock fontWeight is set 555 * 556 * @param { number | FontWeight | string } value 557 * @returns { TextClockAttribute } 558 * @syscap SystemCapability.ArkUI.ArkUI.Full 559 * @crossplatform 560 * @form 561 * @atomicservice 562 * @since 11 563 */ 564 fontWeight(value: number | FontWeight | string): TextClockAttribute; 565 566 /** 567 * Called when the value of TextClock fontFamily is set 568 * 569 * @param { ResourceStr } value 570 * @returns { TextClockAttribute } 571 * @syscap SystemCapability.ArkUI.ArkUI.Full 572 * @since 8 573 */ 574 /** 575 * Called when the value of TextClock fontFamily is set 576 * 577 * @param { ResourceStr } value 578 * @returns { TextClockAttribute } 579 * @syscap SystemCapability.ArkUI.ArkUI.Full 580 * @crossplatform 581 * @since 10 582 */ 583 /** 584 * Called when the value of TextClock fontFamily is set 585 * 586 * @param { ResourceStr } value 587 * @returns { TextClockAttribute } 588 * @syscap SystemCapability.ArkUI.ArkUI.Full 589 * @crossplatform 590 * @form 591 * @atomicservice 592 * @since 11 593 */ 594 fontFamily(value: ResourceStr): TextClockAttribute; 595 596 /** 597 * Called when the text shadow is set. 598 * 599 * @param { ShadowOptions | Array<ShadowOptions> } value - The shadow options. 600 * @returns { TextClockAttribute } 601 * @syscap SystemCapability.ArkUI.ArkUI.Full 602 * @crossplatform 603 * @form 604 * @since 11 605 */ 606 /** 607 * Called when the text shadow is set. 608 * 609 * @param { ShadowOptions | Array<ShadowOptions> } value - The shadow options. 610 * @returns { TextClockAttribute } 611 * @syscap SystemCapability.ArkUI.ArkUI.Full 612 * @crossplatform 613 * @form 614 * @atomicservice 615 * @since 12 616 */ 617 textShadow(value: ShadowOptions | Array<ShadowOptions>): TextClockAttribute; 618 619 /** 620 * Called when the text fontFeature is set. 621 * 622 * @param { string } value - The fontFeature. 623 * normal | <feature-tag-value>, 624 * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0 625 * number of <feature-tag-value> can be single or multiple, and separated by comma ','. 626 * @returns { TextClockAttribute } 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @crossplatform 629 * @form 630 * @since 11 631 */ 632 /** 633 * Called when the text fontFeature is set. 634 * 635 * @param { string } value - The fontFeature. 636 * normal | <feature-tag-value>, 637 * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0 638 * number of <feature-tag-value> can be single or multiple, and separated by comma ','. 639 * @returns { TextClockAttribute } 640 * @syscap SystemCapability.ArkUI.ArkUI.Full 641 * @crossplatform 642 * @form 643 * @atomicservice 644 * @since 12 645 */ 646 fontFeature(value: string): TextClockAttribute; 647 648 /** 649 * Set the content modifier of textclock. 650 * 651 * @param { ContentModifier<TextClockConfiguration> } modifier - The content modifier of textclock. 652 * @returns { TextClockAttribute } 653 * @syscap SystemCapability.ArkUI.ArkUI.Full 654 * @crossplatform 655 * @atomicservice 656 * @since 12 657 */ 658 contentModifier(modifier: ContentModifier<TextClockConfiguration>): TextClockAttribute; 659 660 /** 661 * Set hour format 662 * 663 * @param { Optional<DateTimeOptions> } dateTimeOptions - Indicates whether a leading 0 is required for the hour. 664 * @returns { TextClockAttribute } the attribute of the text clock 665 * @syscap SystemCapability.ArkUI.ArkUI.Full 666 * @crossplatform 667 * @form 668 * @atomicservice 669 * @since 12 670 */ 671 dateTimeOptions(dateTimeOptions: Optional<DateTimeOptions>): TextClockAttribute; 672} 673 674/** 675 * Defines TextClock Component. 676 * 677 * @syscap SystemCapability.ArkUI.ArkUI.Full 678 * @since 8 679 */ 680/** 681 * Defines TextClock Component. 682 * 683 * @syscap SystemCapability.ArkUI.ArkUI.Full 684 * @crossplatform 685 * @since 10 686 */ 687/** 688 * Defines TextClock Component. 689 * 690 * @syscap SystemCapability.ArkUI.ArkUI.Full 691 * @crossplatform 692 * @form 693 * @atomicservice 694 * @since 11 695 */ 696declare const TextClock: TextClockInterface; 697 698/** 699 * Defines TextClock Component instance. 700 * 701 * @syscap SystemCapability.ArkUI.ArkUI.Full 702 * @since 8 703 */ 704/** 705 * Defines TextClock Component instance. 706 * 707 * @syscap SystemCapability.ArkUI.ArkUI.Full 708 * @crossplatform 709 * @since 10 710 */ 711/** 712 * Defines TextClock Component instance. 713 * 714 * @syscap SystemCapability.ArkUI.ArkUI.Full 715 * @crossplatform 716 * @form 717 * @atomicservice 718 * @since 11 719 */ 720declare const TextClockInstance: TextClockAttribute; 721