1/* 2 * Copyright (c) 2021-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 The NotificationContent module provides APIs for defining the notification content. 18 * @kit NotificationKit 19 */ 20 21import image from '../@ohos.multimedia.image'; 22import { Resource } from '../global/resource'; 23import type notificationManager from '../@ohos.notificationManager'; 24/*** if arkts 1.1 */ 25import notification from '../@ohos.notification'; 26import { WantAgent } from '../@ohos.wantAgent'; 27/*** endif */ 28/*** if arkts 1.2 */ 29import { WantAgent } from '../@ohos.app.ability.wantAgent'; 30/*** endif */ 31 32/** 33 * Describes icon type. 34 * 35 * @typedef { Resource | image.PixelMap } IconType 36 * @syscap SystemCapability.Notification.Notification 37 * @systemapi 38 * @since arkts {'1.1':'18', '1.2':'20'} 39 * @arkts 1.1&1.2 40 */ 41type IconType = Resource | image.PixelMap; 42 43/** 44 * Describes a normal text notification. 45 * 46 * @typedef NotificationBasicContent 47 * @syscap SystemCapability.Notification.Notification 48 * @since 7 49 */ 50/** 51 * Describes a normal text notification. 52 * 53 * @typedef NotificationBasicContent 54 * @syscap SystemCapability.Notification.Notification 55 * @crossplatform 56 * @since arkts {'1.1':'12', '1.2':'20'} 57 * @arkts 1.1&1.2 58 */ 59export interface NotificationBasicContent { 60 /** 61 * Notification title. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 62 * @type { string } 63 * @syscap SystemCapability.Notification.Notification 64 * @since 7 65 */ 66 /** 67 * Notification title. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 68 * 69 * @type { string } 70 * @syscap SystemCapability.Notification.Notification 71 * @crossplatform 72 * @since arkts {'1.1':'12', '1.2':'20'} 73 * @arkts 1.1&1.2 74 */ 75 title: string; 76 77 /** 78 * Notification content. It cannot be empty or exceed 3072 bytes. Excess content will be truncated. 79 * 80 * @type { string } 81 * @syscap SystemCapability.Notification.Notification 82 * @since 7 83 */ 84 /** 85 * Notification content. It cannot be empty or exceed 3072 bytes. Excess content will be truncated. 86 * 87 * @type { string } 88 * @syscap SystemCapability.Notification.Notification 89 * @crossplatform 90 * @since arkts {'1.1':'12', '1.2':'20'} 91 * @arkts 1.1&1.2 92 */ 93 text: string; 94 95 /** 96 * Additional information of the notification. It cannot exceed 3072 bytes. Excess content will be truncated. 97 * 98 * @type { ?string } 99 * @syscap SystemCapability.Notification.Notification 100 * @since arkts {'1.1':'7', '1.2':'20'} 101 * @arkts 1.1&1.2 102 */ 103 additionalText?: string; 104 105 /** 106 * Picture of a notification displayed on the lock screen. Currently, only the live view notification is supported. 107 * The total number of the icon pixel bytes cannot exceed 192 KB (which is obtained through getPixelBytesNumber. 108 * The recommended icon size is 128 × 128 pixels. 109 * The display effect depends on the device capability and notification center UI style. 110 * 111 * @type { ?image.PixelMap } 112 * @syscap SystemCapability.Notification.Notification 113 * @since arkts {'1.1':'12', '1.2':'20'} 114 * @arkts 1.1&1.2 115 */ 116 lockscreenPicture?: image.PixelMap; 117} 118 119/** 120 * Describes the long text notification. This API is inherited from NotificationBasicContent. 121 * 122 * @typedef NotificationLongTextContent 123 * @syscap SystemCapability.Notification.Notification 124 * @since 7 125 */ 126/** 127 * Describes the long text notification. This API is inherited from NotificationBasicContent. 128 * 129 * @extends NotificationBasicContent 130 * @typedef NotificationLongTextContent 131 * @syscap SystemCapability.Notification.Notification 132 * @crossplatform 133 * @since arkts {'1.1':'12', '1.2':'20'} 134 * @arkts 1.1&1.2 135 */ 136export interface NotificationLongTextContent extends NotificationBasicContent { 137 /** 138 * Long text of the notification. It cannot be an empty string and exceed 3072 bytes. Excess content will be truncated. 139 * 140 * @type { string } 141 * @syscap SystemCapability.Notification.Notification 142 * @since 7 143 */ 144 /** 145 * Long text of the notification. It cannot be an empty string and exceed 3072 bytes. Excess content will be truncated. 146 * 147 * @type { string } 148 * @syscap SystemCapability.Notification.Notification 149 * @crossplatform 150 * @since arkts {'1.1':'12', '1.2':'20'} 151 * @arkts 1.1&1.2 152 */ 153 longText: string; 154 155 /** 156 * Brief text of the notification. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 157 * 158 * @type { string } 159 * @syscap SystemCapability.Notification.Notification 160 * @since 7 161 */ 162 /** 163 * Brief text of the notification. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 164 * 165 * @type { string } 166 * @syscap SystemCapability.Notification.Notification 167 * @crossplatform 168 * @since arkts {'1.1':'12', '1.2':'20'} 169 * @arkts 1.1&1.2 170 */ 171 briefText: string; 172 173 /** 174 * Title of the notification in the expanded state. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 175 * 176 * @type { string } 177 * @syscap SystemCapability.Notification.Notification 178 * @since 7 179 */ 180 /** 181 * Title of the notification in the expanded state. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 182 * 183 * @type { string } 184 * @syscap SystemCapability.Notification.Notification 185 * @crossplatform 186 * @since arkts {'1.1':'12', '1.2':'20'} 187 * @arkts 1.1&1.2 188 */ 189 expandedTitle: string; 190} 191 192/** 193 * Enum for live view notification option type. 194 * 195 * @enum { number } 196 * @syscap SystemCapability.Security.AccessToken 197 * @systemapi 198 * @since arkts {'1.1':'11', '1.2':'20'} 199 * @arkts 1.1&1.2 200 */ 201export enum LiveViewStatus { 202 /** 203 * Create the live view notification. 204 * 205 * @syscap SystemCapability.Security.AccessToken 206 * @systemapi 207 * @since arkts {'1.1':'11', '1.2':'20'} 208 * @arkts 1.1&1.2 209 */ 210 LIVE_VIEW_CREATE = 0, 211 /** 212 * Batch update the live view notification. 213 * 214 * @syscap SystemCapability.Security.AccessToken 215 * @systemapi 216 * @since arkts {'1.1':'11', '1.2':'20'} 217 * @arkts 1.1&1.2 218 */ 219 LIVE_VIEW_INCREMENTAL_UPDATE = 1, 220 /** 221 * Complete the live view notification. 222 * 223 * @syscap SystemCapability.Security.AccessToken 224 * @systemapi 225 * @since arkts {'1.1':'11', '1.2':'20'} 226 * @arkts 1.1&1.2 227 */ 228 LIVE_VIEW_END = 2, 229 /** 230 * Full update the live view notification. 231 * 232 * @syscap SystemCapability.Security.AccessToken 233 * @systemapi 234 * @since arkts {'1.1':'11', '1.2':'20'} 235 * @arkts 1.1&1.2 236 */ 237 LIVE_VIEW_FULL_UPDATE = 3 238} 239 240/** 241 * Enum for live view notification task type. 242 * 243 * @enum { number } 244 * @syscap SystemCapability.Notification.Notification 245 * @systemapi 246 * @since arkts {'1.1':'18', '1.2':'20'} 247 * @arkts 1.1&1.2 248 */ 249export enum LiveViewTypes { 250 /** 251 * Real-time activity live view Notification. 252 * 253 * @syscap SystemCapability.Notification.Notification 254 * @systemapi 255 * @since arkts {'1.1':'18', '1.2':'20'} 256 * @arkts 1.1&1.2 257 */ 258 LIVE_VIEW_ACTIVITY = 0, 259 /** 260 * Instant Task live view Notification. 261 * 262 * @syscap SystemCapability.Notification.Notification 263 * @systemapi 264 * @since arkts {'1.1':'18', '1.2':'20'} 265 * @arkts 1.1&1.2 266 */ 267 LIVE_VIEW_INSTANT = 1, 268 /** 269 * Long-term status task live view Notification. 270 * 271 * @syscap SystemCapability.Notification.Notification 272 * @systemapi 273 * @since arkts {'1.1':'18', '1.2':'20'} 274 * @arkts 1.1&1.2 275 */ 276 LIVE_VIEW_LONG_TERM = 2 277} 278 279/** 280 * Describes a live view notification. 281 * 282 * @extends NotificationBasicContent 283 * @typedef NotificationLiveViewContent 284 * @syscap SystemCapability.Notification.Notification 285 * @systemapi 286 * @since arkts {'1.1':'11', '1.2':'20'} 287 * @arkts 1.1&1.2 288 */ 289export interface NotificationLiveViewContent extends NotificationBasicContent { 290 /** 291 * Status of the live view (0: create, 1: batch update, 2: end, 3: full update). 292 * 293 * @type { LiveViewStatus } 294 * @syscap SystemCapability.Notification.Notification 295 * @systemapi 296 * @since arkts {'1.1':'11', '1.2':'20'} 297 * @arkts 1.1&1.2 298 */ 299 status: LiveViewStatus; 300 301 /** 302 * Version of the live view with the same id. (If the version number stored in the database is 0xffffffff, 303 * the version number is not verified at the current operation of update or end. Otherwise, the 304 * version number must be greater than the version number stored in the database.) 305 * 306 * @type { ?number } 307 * @syscap SystemCapability.Notification.Notification 308 * @systemapi 309 * @since arkts {'1.1':'11', '1.2':'20'} 310 * @arkts 1.1&1.2 311 */ 312 version?: number; 313 314 /** 315 * Additional information of the live view notification. 316 * 317 * @type { ?Record<string, Object>} 318 * @syscap SystemCapability.Notification.Notification 319 * @systemapi 320 * @since arkts {'1.1':'11', '1.2':'20'} 321 * @arkts 1.1&1.2 322 */ 323 extraInfo?: Record<string, Object>; 324 325 /** 326 * The picture information list of the live view notification. 327 * 328 * @type { ?Record<string, Array<image.PixelMap>> } 329 * @syscap SystemCapability.Notification.Notification 330 * @systemapi 331 * @since arkts {'1.1':'11', '1.2':'20'} 332 * @arkts 1.1&1.2 333 */ 334 pictureInfo?: Record<string, Array<image.PixelMap>>; 335 336 /** 337 * Whether to update locally. 338 * 339 * @type { ?boolean } 340 * @syscap SystemCapability.Notification.Notification 341 * @systemapi 342 * @since arkts {'1.1':'12', '1.2':'20'} 343 * @arkts 1.1&1.2 344 */ 345 isLocalUpdateOnly?: boolean; 346 347 /** 348 * The WantAgent instance of the clickAction field in the live view extension area. 349 * 350 * @type { ?WantAgent } 351 * @syscap SystemCapability.Notification.Notification 352 * @systemapi 353 * @since arkts{ '1.1':'20','1.2':'20'} 354 * @arkts 1.1&1.2 355 */ 356 extensionWantAgent?: WantAgent; 357} 358 359/** 360 * Describes the multi-line text notification. This API is inherited from NotificationBasicContent. 361 * 362 * @typedef NotificationMultiLineContent 363 * @syscap SystemCapability.Notification.Notification 364 * @since 7 365 */ 366/** 367 * Describes the multi-line text notification. This API is inherited from NotificationBasicContent. 368 * 369 * @extends NotificationBasicContent 370 * @typedef NotificationMultiLineContent 371 * @syscap SystemCapability.Notification.Notification 372 * @crossplatform 373 * @since arkts {'1.1':'12', '1.2':'20'} 374 * @arkts 1.1&1.2 375 */ 376export interface NotificationMultiLineContent extends NotificationBasicContent { 377 /** 378 * Brief text of the notification. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 379 * 380 * @type { string } 381 * @syscap SystemCapability.Notification.Notification 382 * @since 7 383 */ 384 /** 385 * Brief text of the notification. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 386 * 387 * @type { string } 388 * @syscap SystemCapability.Notification.Notification 389 * @crossplatform 390 * @since arkts {'1.1':'12', '1.2':'20'} 391 * @arkts 1.1&1.2 392 */ 393 briefText: string; 394 395 /** 396 * Title of the notification in the expanded state. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 397 * 398 * @type { string } 399 * @syscap SystemCapability.Notification.Notification 400 * @since 7 401 */ 402 /** 403 * Title of the notification in the expanded state. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 404 * 405 * @type { string } 406 * @syscap SystemCapability.Notification.Notification 407 * @crossplatform 408 * @since arkts {'1.1':'12', '1.2':'20'} 409 * @arkts 1.1&1.2 410 */ 411 longTitle: string; 412 413 /** 414 * Multi-line text of the notification. It cannot exceed 1024 bytes. Excess content will be truncated. 415 * 416 * @type { Array<string> } 417 * @syscap SystemCapability.Notification.Notification 418 * @since 7 419 */ 420 /** 421 * Multi-line text of the notification. It cannot exceed 1024 bytes. Excess content will be truncated. 422 * 423 * @type { Array<string> } 424 * @syscap SystemCapability.Notification.Notification 425 * @crossplatform 426 * @since arkts {'1.1':'12', '1.2':'20'} 427 * @arkts 1.1&1.2 428 */ 429 lines: Array<string>; 430 431 /** 432 * Multi-line wantAgent of the multi-line text notification. 433 * @permission ohos.permission.NOTIFICATION_AGENT_CONTROLLER 434 * @type { ?Array<WantAgent> } 435 * @syscap SystemCapability.Notification.Notification 436 * @systemapi 437 * @since 20 438 * @arkts 1.1&1.2 439 */ 440 lineWantAgents?: Array<WantAgent>; 441} 442 443/** 444 * Describes the picture-attached notification. This API is inherited from NotificationBasicContent. 445 * 446 * @extends NotificationBasicContent 447 * @typedef NotificationPictureContent 448 * @syscap SystemCapability.Notification.Notification 449 * @since arkts {'1.1':'7', '1.2':'20'} 450 * @arkts 1.1&1.2 451 */ 452export interface NotificationPictureContent extends NotificationBasicContent { 453 /** 454 * Brief text of the notification. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 455 * 456 * @type { string } 457 * @syscap SystemCapability.Notification.Notification 458 * @since arkts {'1.1':'7', '1.2':'20'} 459 * @arkts 1.1&1.2 460 */ 461 briefText: string; 462 463 /** 464 * Title of the notification in the expanded state. It cannot be empty or exceed 1024 bytes. Excess content will be truncated. 465 * 466 * @type { string } 467 * @syscap SystemCapability.Notification.Notification 468 * @since arkts {'1.1':'7', '1.2':'20'} 469 * @arkts 1.1&1.2 470 */ 471 expandedTitle: string; 472 473 /** 474 * Picture content of the notification. (The total number of bytes of image pixels cannot exceed 2 MB.) 475 * 476 * @type { image.PixelMap } 477 * @syscap SystemCapability.Notification.Notification 478 * @since arkts {'1.1':'7', '1.2':'20'} 479 * @arkts 1.1&1.2 480 */ 481 picture: image.PixelMap; 482} 483 484/** 485 * Describes the system live view notification. A third-party application cannot directly create a notification of this type. 486 * After the system proxy creates a system live view, the third-party application releases a notification with the same ID to update the specified content. 487 * This API is inherited from NotificationBasicContent. 488 * 489 * @extends NotificationBasicContent 490 * @typedef NotificationSystemLiveViewContent 491 * @syscap SystemCapability.Notification.Notification 492 * @since arkts {'1.1':'11', '1.2':'20'} 493 * @arkts 1.1&1.2 494 */ 495export interface NotificationSystemLiveViewContent extends NotificationBasicContent { 496 /** 497 * Type code, which identifies the type of the service that invokes the API. 498 * 499 * @type { number } 500 * @syscap SystemCapability.Notification.Notification 501 * @since arkts {'1.1':'11', '1.2':'20'} 502 * @arkts 1.1&1.2 503 */ 504 typeCode: number; 505 506 /** 507 * Capsule of the notification. 508 * 509 * @type { ?NotificationCapsule } 510 * @syscap SystemCapability.Notification.Notification 511 * @since arkts {'1.1':'11', '1.2':'20'} 512 * @arkts 1.1&1.2 513 */ 514 capsule?: NotificationCapsule; 515 516 /** 517 * Button in the notification. 518 * 519 * @type { ?NotificationButton } 520 * @syscap SystemCapability.Notification.Notification 521 * @since arkts {'1.1':'11', '1.2':'20'} 522 * @arkts 1.1&1.2 523 */ 524 button?: NotificationButton; 525 526 /** 527 * card button of a system live view notification. 528 * 529 * @type { ?Array<NotificationIconButton> } 530 * @syscap SystemCapability.Notification.Notification 531 * @systemapi 532 * @since arkts {'1.1':'18', '1.2':'20'} 533 * @arkts 1.1&1.2 534 */ 535 cardButtons?: Array<NotificationIconButton>; 536 537 /** 538 * Time of the notification. 539 * 540 * @type { ?NotificationTime } 541 * @syscap SystemCapability.Notification.Notification 542 * @since arkts {'1.1':'11', '1.2':'20'} 543 * @arkts 1.1&1.2 544 */ 545 time?: NotificationTime; 546 547 /** 548 * Progress of the notification. 549 * 550 * @type { ?NotificationProgress } 551 * @syscap SystemCapability.Notification.Notification 552 * @since arkts {'1.1':'11', '1.2':'20'} 553 * @arkts 1.1&1.2 554 */ 555 progress?: NotificationProgress; 556 557 /** 558 * task type of a system live view notification. 559 * 560 * @type { number } 561 * @syscap SystemCapability.Notification.Notification 562 * @systemapi 563 * @since arkts {'1.1':'18', '1.2':'20'} 564 * @arkts 1.1&1.2 565 */ 566 liveViewType?: LiveViewTypes; 567} 568 569/** 570 * Describe the notification capsule. 571 * 572 * @typedef NotificationCapsule 573 * @syscap SystemCapability.Notification.Notification 574 * @since arkts {'1.1':'11', '1.2':'20'} 575 * @arkts 1.1&1.2 576 */ 577export interface NotificationCapsule { 578 /** 579 * Title of the capsule. 580 * 581 * @type { ?string } 582 * @syscap SystemCapability.Notification.Notification 583 * @since arkts {'1.1':'11', '1.2':'20'} 584 * @arkts 1.1&1.2 585 */ 586 title?: string; 587 588 /** 589 * Icon of the capsule. 590 * 591 * @type { ?image.PixelMap } 592 * @syscap SystemCapability.Notification.Notification 593 * @since arkts {'1.1':'11', '1.2':'20'} 594 * @arkts 1.1&1.2 595 */ 596 icon?: image.PixelMap; 597 598 /** 599 * Background color of the capsule. 600 * 601 * @type { ?string } 602 * @syscap SystemCapability.Notification.Notification 603 * @since arkts {'1.1':'11', '1.2':'20'} 604 * @arkts 1.1&1.2 605 */ 606 backgroundColor?: string; 607 608 /** 609 * Extended text of this capsule. 610 * 611 * @type { ?string } 612 * @syscap SystemCapability.Notification.Notification 613 * @systemapi 614 * @since arkts {'1.1':'12', '1.2':'20'} 615 * @arkts 1.1&1.2 616 */ 617 content?: string; 618 619 /** 620 * Display time of this capsule. 621 * 622 * @type { ?number } 623 * @syscap SystemCapability.Notification.Notification 624 * @systemapi 625 * @since arkts {'1.1':'18', '1.2':'20'} 626 * @arkts 1.1&1.2 627 */ 628 time?: number; 629 630 /** 631 * Extended button of this capsule. 632 * 633 * @type { ?Array<NotificationIconButton> } 634 * @syscap SystemCapability.Notification.Notification 635 * @systemapi 636 * @since arkts {'1.1':'18', '1.2':'20'} 637 * @arkts 1.1&1.2 638 */ 639 capsuleButtons?: Array<NotificationIconButton>; 640} 641 642/** 643 * Describes a system live view button with icon. 644 * 645 * @typedef NotificationIconButton 646 * @syscap SystemCapability.Notification.Notification 647 * @since arkts {'1.1':'18', '1.2':'20'} 648 * @arkts 1.1&1.2 649 */ 650export interface NotificationIconButton { 651 652 /** 653 * button unique name. 654 * 655 * @type { string } 656 * @syscap SystemCapability.Notification.Notification 657 * @systemapi 658 * @since arkts {'1.1':'18', '1.2':'20'} 659 * @arkts 1.1&1.2 660 */ 661 name: string; 662 663 /** 664 * button icon resource. 665 * 666 * @type { IconType } 667 * @syscap SystemCapability.Notification.Notification 668 * @systemapi 669 * @since arkts {'1.1':'18', '1.2':'20'} 670 * @arkts 1.1&1.2 671 */ 672 iconResource: IconType; 673 674 /** 675 * addition text of the icon buttion 676 * 677 * @type { ?string } 678 * @syscap SystemCapability.Notification.Notification 679 * @systemapi 680 * @since arkts {'1.1':'18', '1.2':'20'} 681 * @arkts 1.1&1.2 682 */ 683 text?: string; 684 685 /** 686 * hide the panel when click the icon button. 687 * 688 * @type { ?boolean } 689 * @syscap SystemCapability.Notification.Notification 690 * @systemapi 691 * @since arkts {'1.1':'18', '1.2':'20'} 692 * @arkts 1.1&1.2 693 */ 694 hidePanel?: boolean; 695} 696 697/** 698 * Describes the notification button. 699 * 700 * @typedef NotificationButton 701 * @syscap SystemCapability.Notification.Notification 702 * @since arkts {'1.1':'11', '1.2':'20'} 703 * @arkts 1.1&1.2 704 */ 705export interface NotificationButton { 706 /** 707 * Button names. A maximum of three names are supported. 708 * 709 * @type { ?Array<string> } 710 * @syscap SystemCapability.Notification.Notification 711 * @since arkts {'1.1':'11', '1.2':'20'} 712 * @arkts 1.1&1.2 713 */ 714 names?: Array<string>; 715 716 /** 717 * Button icons. A maximum of three icons are supported. 718 * 719 * @type { ?Array<image.PixelMap> } 720 * @syscap SystemCapability.Notification.Notification 721 * @since arkts {'1.1':'11', '1.2':'20'} 722 * @arkts 1.1&1.2 723 */ 724 icons?: Array<image.PixelMap>; 725 726 /** 727 * Button icon resources. A maximum of three icon resources are supported. 728 * 729 * @type { ?Array<Resource> } 730 * @syscap SystemCapability.Notification.Notification 731 * @since arkts {'1.1':'12', '1.2':'20'} 732 * @arkts 1.1&1.2 733 */ 734 iconsResource?: Array<Resource>; 735} 736 737/** 738 * Describes the notification timing information. 739 * 740 * @typedef NotificationTime 741 * @syscap SystemCapability.Notification.Notification 742 * @since arkts {'1.1':'11', '1.2':'20'} 743 * @arkts 1.1&1.2 744 */ 745export interface NotificationTime { 746 /** 747 * Start time, in milliseconds. 748 * 749 * @type { ?number } 750 * @syscap SystemCapability.Notification.Notification 751 * @since arkts {'1.1':'11', '1.2':'20'} 752 * @arkts 1.1&1.2 753 */ 754 initialTime?: number; 755 756 /** 757 * Whether to count down. 758 * 759 * @type { ?boolean } 760 * @syscap SystemCapability.Notification.Notification 761 * @since arkts {'1.1':'11', '1.2':'20'} 762 * @arkts 1.1&1.2 763 */ 764 isCountDown?: boolean; 765 766 /** 767 * Whether to pause the progress. 768 * 769 * @type { ?boolean } 770 * @syscap SystemCapability.Notification.Notification 771 * @since arkts {'1.1':'11', '1.2':'20'} 772 * @arkts 1.1&1.2 773 */ 774 isPaused?: boolean; 775 776 /** 777 * Whether the time is displayed in the title. 778 * 779 * @type { ?boolean } 780 * @syscap SystemCapability.Notification.Notification 781 * @since arkts {'1.1':'11', '1.2':'20'} 782 * @arkts 1.1&1.2 783 */ 784 isInTitle?: boolean; 785} 786 787/** 788 * Describes the notification progress. 789 * 790 * @typedef NotificationProgress 791 * @syscap SystemCapability.Notification.Notification 792 * @since arkts {'1.1':'11', '1.2':'20'} 793 * @arkts 1.1&1.2 794 */ 795export interface NotificationProgress { 796 /** 797 * Maximum progress value. 798 * 799 * @type { ?number } 800 * @syscap SystemCapability.Notification.Notification 801 * @since arkts {'1.1':'11', '1.2':'20'} 802 * @arkts 1.1&1.2 803 */ 804 maxValue?: number; 805 806 /** 807 * Current progress value. 808 * 809 * @type { ?number } 810 * @syscap SystemCapability.Notification.Notification 811 * @since arkts {'1.1':'11', '1.2':'20'} 812 * @arkts 1.1&1.2 813 */ 814 currentValue?: number; 815 816 /** 817 * Whether to show the progress in percentage. 818 * 819 * @type { ?boolean } 820 * @syscap SystemCapability.Notification.Notification 821 * @since arkts {'1.1':'11', '1.2':'20'} 822 * @arkts 1.1&1.2 823 */ 824 isPercentage?: boolean; 825} 826 827/** 828 * Describes the notification contents. 829 * 830 * @typedef NotificationContent 831 * @syscap SystemCapability.Notification.Notification 832 * @since 7 833 */ 834/** 835 * Describes the notification contents. 836 * 837 * @typedef NotificationContent 838 * @syscap SystemCapability.Notification.Notification 839 * @crossplatform 840 * @since arkts {'1.1':'12', '1.2':'20'} 841 * @arkts 1.1&1.2 842 */ 843export interface NotificationContent { 844 /** 845 * Notification content type. 846 * 847 * @type { ?notification.ContentType } 848 * @syscap SystemCapability.Notification.Notification 849 * @since 7 850 * @deprecated since 11 851 * @useinstead NotificationContent#notificationContentType 852 */ 853 contentType?: notification.ContentType; 854 855 /** 856 * Notification content type. 857 * 858 * @type { ?notificationManager.ContentType } 859 * @syscap SystemCapability.Notification.Notification 860 * @since 11 861 */ 862 /** 863 * Notification content type. 864 * 865 * @type { ?notificationManager.ContentType } 866 * @syscap SystemCapability.Notification.Notification 867 * @crossplatform 868 * @since arkts {'1.1':'12', '1.2':'20'} 869 * @arkts 1.1&1.2 870 */ 871 notificationContentType?: notificationManager.ContentType; 872 873 /** 874 * Normal text. 875 * 876 * @type { ?NotificationBasicContent } 877 * @syscap SystemCapability.Notification.Notification 878 * @since 7 879 */ 880 /** 881 * Normal text. 882 * 883 * @type { ?NotificationBasicContent } 884 * @syscap SystemCapability.Notification.Notification 885 * @crossplatform 886 * @since arkts {'1.1':'12', '1.2':'20'} 887 * @arkts 1.1&1.2 888 */ 889 normal?: NotificationBasicContent; 890 891 /** 892 * Long text. 893 * 894 * @type { ?NotificationLongTextContent } 895 * @syscap SystemCapability.Notification.Notification 896 * @since 7 897 */ 898 /** 899 * Long text. 900 * 901 * @type { ?NotificationLongTextContent } 902 * @syscap SystemCapability.Notification.Notification 903 * @crossplatform 904 * @since arkts {'1.1':'12', '1.2':'20'} 905 * @arkts 1.1&1.2 906 */ 907 longText?: NotificationLongTextContent; 908 909 /** 910 * Multi-line text. 911 * 912 * @type { ?NotificationMultiLineContent } 913 * @syscap SystemCapability.Notification.Notification 914 * @since 7 915 */ 916 /** 917 * Multi-line text. 918 * 919 * @type { ?NotificationMultiLineContent } 920 * @syscap SystemCapability.Notification.Notification 921 * @crossplatform 922 * @since arkts {'1.1':'12', '1.2':'20'} 923 * @arkts 1.1&1.2 924 */ 925 multiLine?: NotificationMultiLineContent; 926 927 /** 928 * Picture-attached. 929 * 930 * @type { ?NotificationPictureContent } 931 * @syscap SystemCapability.Notification.Notification 932 * @since arkts {'1.1':'7', '1.2':'20'} 933 * @arkts 1.1&1.2 934 */ 935 picture?: NotificationPictureContent; 936 937 /** 938 * System live view. A third-party application cannot directly create a notification of this type. After the system proxy creates a system live view, 939 * the third-party application releases a notification with the same ID to update the specified content. 940 * 941 * @type { ?NotificationSystemLiveViewContent } 942 * @syscap SystemCapability.Notification.Notification 943 * @since arkts {'1.1':'11', '1.2':'20'} 944 * @arkts 1.1&1.2 945 */ 946 systemLiveView?: NotificationSystemLiveViewContent; 947 948 /** 949 * live-view notification. 950 * 951 * @type { ?NotificationLiveViewContent } 952 * @syscap SystemCapability.Notification.Notification 953 * @systemapi 954 * @since arkts {'1.1':'11', '1.2':'20'} 955 * @arkts 1.1&1.2 956 */ 957 liveView?: NotificationLiveViewContent; 958} 959