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 Information carried when a notification is sent 18 * @kit NotificationKit 19 */ 20 21import image from '../@ohos.multimedia.image'; 22import type notificationManager from '../@ohos.notificationManager'; 23import type notificationSubscribe from '../@ohos.notificationSubscribe'; 24import { NotificationContent } from './notificationContent'; 25import { NotificationActionButton } from './notificationActionButton'; 26import { NotificationTemplate } from './notificationTemplate'; 27import { NotificationFlags } from './notificationFlags'; 28/*** if arkts 1.1 */ 29import notification from '../@ohos.notification'; 30import { WantAgent } from '../@ohos.wantAgent'; 31import type { BundleOption } from './NotificationCommonDef'; 32/*** endif */ 33/*** if arkts 1.2 */ 34import { WantAgent } from '../@ohos.app.ability.wantAgent'; 35import { BundleOption } from './NotificationCommonDef'; 36/*** endif */ 37 38/** 39 * Defines a NotificationRequest instance. 40 * 41 * @typedef NotificationRequest 42 * @syscap SystemCapability.Notification.Notification 43 * @since 7 44 */ 45/** 46 * Defines a NotificationRequest instance. 47 * 48 * @typedef NotificationRequest 49 * @syscap SystemCapability.Notification.Notification 50 * @crossplatform 51 * @since arkts {'1.1':'12', '1.2':'20'} 52 * @arkts 1.1&1.2 53 */ 54export interface NotificationRequest { 55 /** 56 * Notification content. 57 * 58 * @type { NotificationContent } 59 * @syscap SystemCapability.Notification.Notification 60 * @since 7 61 */ 62 /** 63 * Notification content. 64 * 65 * @type { NotificationContent } 66 * @syscap SystemCapability.Notification.Notification 67 * @crossplatform 68 * @since arkts {'1.1':'12', '1.2':'20'} 69 * @arkts 1.1&1.2 70 */ 71 content: NotificationContent; 72 73 /** 74 * Notification ID. The default value is 0. If the same notification ID exists, the notification content is updated. 75 * 76 * @type { ?number } 77 * @syscap SystemCapability.Notification.Notification 78 * @since 7 79 */ 80 /** 81 * Notification ID. The default value is 0. If the same notification ID exists, the notification content is updated. 82 * 83 * @type { ?number } 84 * @syscap SystemCapability.Notification.Notification 85 * @crossplatform 86 * @since arkts {'1.1':'12', '1.2':'20'} 87 * @arkts 1.1&1.2 88 */ 89 id?: number; 90 91 /** 92 * Unique ID carried in a notification sent by an app, which is used for notification deduplication. 93 * If an app publishes notifications with the same appMessageId locally or on the cloud, the device displays only one message. 94 * Repeated notifications received later will be silenced and deduplicated, and will not be displayed or notified. 95 * The deduplication flag is valid only within 24 hours after the notification is published. After 24 hours or the device is restarted, 96 * the deduplication flag becomes invalid. 97 * 98 * @type { ?string } 99 * @syscap SystemCapability.Notification.Notification 100 * @since arkts {'1.1':'12', '1.2':'20'} 101 * @arkts 1.1&1.2 102 */ 103 appMessageId?: string; 104 105 /** 106 * Notification slot type. 107 * 108 * @type { ?notification.SlotType } 109 * @syscap SystemCapability.Notification.Notification 110 * @since 7 111 * @deprecated since 11 112 * @useinstead NotificationRequest#notificationSlotType 113 */ 114 slotType?: notification.SlotType; 115 116 /** 117 * Notification slot type. The default value is OTHER_TYPES. 118 * 119 * @type { ?notificationManager.SlotType } 120 * @syscap SystemCapability.Notification.Notification 121 * @since arkts {'1.1':'11', '1.2':'20'} 122 * @arkts 1.1&1.2 123 */ 124 notificationSlotType?: notificationManager.SlotType; 125 126 /** 127 * Whether the notification is an ongoing notification. 128 * 129 * @type { ?boolean } 130 * @syscap SystemCapability.Notification.Notification 131 * @since 7 132 */ 133 /** 134 * Whether the notification is an ongoing notification. 135 * 136 * @type { ?boolean } 137 * @syscap SystemCapability.Notification.Notification 138 * @crossplatform 139 * @since arkts {'1.1':'12', '1.2':'20'} 140 * @arkts 1.1&1.2 141 */ 142 isOngoing?: boolean; 143 144 /** 145 * Whether the notification can be removed. 146 * 147 * @type { ?boolean } 148 * @syscap SystemCapability.Notification.Notification 149 * @since arkts {'1.1':'7', '1.2':'20'} 150 * @arkts 1.1&1.2 151 */ 152 isUnremovable?: boolean; 153 154 /** 155 * Whether to update notifications only. 156 * - true: If a notification with the same ID exists, the notification is updated; otherwise, the notification fails to update and no notification is created. 157 * - false (default): If a notification with the same ID exists, the notification is updated; otherwise, a notification is created. 158 * 159 * @type { ?boolean } 160 * @syscap SystemCapability.Notification.Notification 161 * @since arkts {'1.1':'18', '1.2':'20'} 162 * @arkts 1.1&1.2 163 */ 164 updateOnly?: boolean; 165 166 /** 167 * Time when the notification is sent. This API is automatically generated by the system. Data format: timestamp, in milliseconds. 168 * 169 * @type { ?number } 170 * @syscap SystemCapability.Notification.Notification 171 * @since 7 172 */ 173 /** 174 * Time when the notification is sent. This API is automatically generated by the system. Data format: timestamp, in milliseconds. 175 * 176 * @type { ?number } 177 * @syscap SystemCapability.Notification.Notification 178 * @crossplatform 179 * @since arkts {'1.1':'12', '1.2':'20'} 180 * @arkts 1.1&1.2 181 */ 182 deliveryTime?: number; 183 184 /** 185 * Whether the notification is automatically cleared. This parameter is valid only when the notification carries wantAgent or actionButtons. 186 * - true (default): The current notification is automatically cleared after the notification or button is tapped. 187 * - false: The current notification is retained after the notification or button is tapped. 188 * 189 * @type { ?boolean } 190 * @syscap SystemCapability.Notification.Notification 191 * @since 7 192 */ 193 /** 194 * Whether the notification is automatically cleared. This parameter is valid only when the notification carries wantAgent or actionButtons. 195 * - true (default): The current notification is automatically cleared after the notification or button is tapped. 196 * - false: The current notification is retained after the notification or button is tapped. 197 * 198 * @type { ?boolean } 199 * @syscap SystemCapability.Notification.Notification 200 * @crossplatform 201 * @since arkts {'1.1':'12', '1.2':'20'} 202 * @arkts 1.1&1.2 203 */ 204 tapDismissed?: boolean; 205 206 /** 207 * Time when the notification is automatically cleared. Data format: timestamp, in milliseconds. 208 * For example, if a notification is to be cleared after being displayed for 3 seconds (3000 ms), 209 * you can set new Date().getTime() + 3000 to meet this requirement. 210 * 211 * @type { ?number } 212 * @syscap SystemCapability.Notification.Notification 213 * @since 7 214 */ 215 /** 216 * Time when the notification is automatically cleared. Data format: timestamp, in milliseconds. 217 * For example, if a notification is to be cleared after being displayed for 3 seconds (3000 ms), 218 * you can set new Date().getTime() + 3000 to meet this requirement. 219 * 220 * @type { ?number } 221 * @syscap SystemCapability.Notification.Notification 222 * @crossplatform 223 * @since arkts {'1.1':'12', '1.2':'20'} 224 * @arkts 1.1&1.2 225 */ 226 autoDeletedTime?: number; 227 228 /** 229 * WantAgent instance to which the notification will be redirected after being clicked. 230 * 231 * @type { ?WantAgent } 232 * @syscap SystemCapability.Notification.Notification 233 * @since arkts {'1.1':'7', '1.2':'20'} 234 * @arkts 1.1&1.2 235 */ 236 wantAgent?: WantAgent; 237 238 /** 239 * Expand parameters to provide customized services for applications. 240 * 241 * @type { ?object } 242 * @syscap SystemCapability.Notification.Notification 243 * @since 7 244 */ 245 extraInfo?: { [key: string]: any }; 246 247 /** 248 * Expand parameters to provide customized services for applications. 249 * 250 * @type { ?Record<string, Object> } 251 * @syscap SystemCapability.Notification.Notification 252 * @since 20 253 * @arkts 1.2 254 */ 255 extraInfo?: Record<string, Object>; 256 257 /** 258 * Extended parameter. Recommendation system application usage. 259 * 260 * @type { ?Record<string, Object> } 261 * @syscap SystemCapability.Notification.Notification 262 * @systemapi 263 * @since 20 264 * @arkts 1.1&1.2 265 */ 266 extendInfo?: Record<string, Object>; 267 268 /** 269 * Background color of the notification. 270 * 271 * @type { ?number } 272 * @syscap SystemCapability.Notification.Notification 273 * @since arkts {'1.1':'7', '1.2':'20'} 274 * @arkts 1.1&1.2 275 */ 276 color?: number; 277 278 /** 279 * Whether the notification background color can be enabled. 280 * 281 * @type { ?boolean } 282 * @syscap SystemCapability.Notification.Notification 283 * @since arkts {'1.1':'7', '1.2':'20'} 284 * @arkts 1.1&1.2 285 */ 286 colorEnabled?: boolean; 287 288 /** 289 * Whether to send a notification only once when the notification is published or updated. 290 * - true: A notification is sent only when the notification is published for the first time. For subsequent update, 291 * the notification mode is changed to LEVEL_MIN. 292 * - false (default): A notification is sent based on the configured notification mode. 293 * 294 * @type { ?boolean } 295 * @syscap SystemCapability.Notification.Notification 296 * @since 7 297 */ 298 /** 299 * Whether to send a notification only once when the notification is published or updated. 300 * - true: A notification is sent only when the notification is published for the first time. For subsequent update, 301 * the notification mode is changed to LEVEL_MIN. 302 * - false (default): A notification is sent based on the configured notification mode. 303 * 304 * @type { ?boolean } 305 * @syscap SystemCapability.Notification.Notification 306 * @crossplatform 307 * @since arkts {'1.1':'12', '1.2':'20'} 308 * @arkts 1.1&1.2 309 */ 310 isAlertOnce?: boolean; 311 312 /** 313 * Whether to display the stopwatch. 314 * 315 * @type { ?boolean } 316 * @syscap SystemCapability.Notification.Notification 317 * @since arkts {'1.1':'7', '1.2':'20'} 318 * @arkts 1.1&1.2 319 */ 320 isStopwatch?: boolean; 321 322 /** 323 * Whether to display the countdown time. 324 * 325 * @type { ?boolean } 326 * @syscap SystemCapability.Notification.Notification 327 * @since arkts {'1.1':'7', '1.2':'20'} 328 * @arkts 1.1&1.2 329 */ 330 isCountDown?: boolean; 331 332 /** 333 * Whether the notification is displayed as a floating icon in the status bar. 334 * 335 * @type { ?boolean } 336 * @syscap SystemCapability.Notification.Notification 337 * @since arkts {'1.1':'7', '1.2':'20'} 338 * @arkts 1.1&1.2 339 */ 340 isFloatingIcon?: boolean; 341 342 /** 343 * Notification label. The label field can be used independently, or used together with ID as a notification identifier. ID is preferentially used. 344 * If the label is not empty when a notification is published, you need to specify the label when updating or deleting the notification. 345 * 346 * @type { ?string } 347 * @syscap SystemCapability.Notification.Notification 348 * @since arkts {'1.1':'7', '1.2':'20'} 349 * @arkts 1.1&1.2 350 */ 351 label?: string; 352 353 /** 354 * Notification badge type. 355 * 356 * @type { ?number } 357 * @syscap SystemCapability.Notification.Notification 358 * @since arkts {'1.1':'7', '1.2':'20'} 359 * @arkts 1.1&1.2 360 */ 361 badgeIconStyle?: number; 362 363 /** 364 * Whether to display the time when the notification is delivered. 365 * 366 * @type { ?boolean } 367 * @syscap SystemCapability.Notification.Notification 368 * @since 7 369 */ 370 /** 371 * Whether to display the time when the notification is delivered. 372 * 373 * @type { ?boolean } 374 * @syscap SystemCapability.Notification.Notification 375 * @crossplatform 376 * @since arkts {'1.1':'12', '1.2':'20'} 377 * @arkts 1.1&1.2 378 */ 379 showDeliveryTime?: boolean; 380 381 /** 382 * Notification button. A notification can contain a maximum of two buttons by default. 383 * 384 * @type { ?Array<NotificationActionButton> } 385 * @syscap SystemCapability.Notification.Notification 386 * @since arkts {'1.1':'7', '1.2':'20'} 387 * @arkts 1.1&1.2 388 */ 389 actionButtons?: Array<NotificationActionButton>; 390 391 /** 392 * Small notification icon. Optional field. The total number of the icon pixel bytes cannot exceed 192 KB (which is 393 * obtained through getPixelBytesNumber. The recommended icon size is 128 px × 128 px. 394 * 395 * @type { ?image.PixelMap } 396 * @syscap SystemCapability.Notification.Notification 397 * @since arkts {'1.1':'7', '1.2':'20'} 398 * @arkts 1.1&1.2 399 */ 400 smallIcon?: image.PixelMap; 401 402 /** 403 * Large notification icon. Optional field. The total number of the icon pixel bytes cannot exceed 192 KB (which is 404 * obtained through getPixelBytesNumber. The recommended icon size is 128 px × 128 px. 405 * 406 * @type { ?image.PixelMap } 407 * @syscap SystemCapability.Notification.Notification 408 * @since arkts {'1.1':'7', '1.2':'20'} 409 * @arkts 1.1&1.2 410 */ 411 largeIcon?: image.PixelMap; 412 413 /** 414 * Overlay notification icon. 415 * 416 * @type { ?image.PixelMap } 417 * @syscap SystemCapability.Notification.Notification 418 * @systemapi 419 * @since arkts {'1.1':'11', '1.2':'20'} 420 * @arkts 1.1&1.2 421 */ 422 overlayIcon?: image.PixelMap; 423 424 /** 425 * Notification group name. This parameter is left blank by default. 426 * 427 * @type { ?string } 428 * @syscap SystemCapability.Notification.Notification 429 * @since 8 430 */ 431 /** 432 * Notification group name. This parameter is left blank by default. 433 * 434 * @type { ?string } 435 * @syscap SystemCapability.Notification.Notification 436 * @crossplatform 437 * @since arkts {'1.1':'12', '1.2':'20'} 438 * @arkts 1.1&1.2 439 */ 440 groupName?: string; 441 442 /** 443 * Name of the bundle that creates the notification. 444 * 445 * @type { ?string } 446 * @readonly 447 * @syscap SystemCapability.Notification.Notification 448 * @since arkts {'1.1':'7', '1.2':'20'} 449 * @arkts 1.1&1.2 450 */ 451 readonly creatorBundleName?: string; 452 453 /** 454 * UID used for creating the notification. 455 * 456 * @type { ?number } 457 * @readonly 458 * @syscap SystemCapability.Notification.Notification 459 * @since arkts {'1.1':'7', '1.2':'20'} 460 * @arkts 1.1&1.2 461 */ 462 readonly creatorUid?: number; 463 464 /** 465 * PID used for creating the notification. 466 * 467 * @type { ?number } 468 * @readonly 469 * @syscap SystemCapability.Notification.Notification 470 * @since arkts {'1.1':'7', '1.2':'20'} 471 * @arkts 1.1&1.2 472 */ 473 readonly creatorPid?: number; 474 475 /** 476 * ID of the user who creates the notification. 477 * 478 * @type { ?number } 479 * @readonly 480 * @syscap SystemCapability.Notification.Notification 481 * @since arkts {'1.1':'8', '1.2':'20'} 482 * @arkts 1.1&1.2 483 */ 484 readonly creatorUserId?: number; 485 486 /** 487 * Application instance key. 488 * 489 * @type { ?number } 490 * @readonly 491 * @syscap SystemCapability.Notification.Notification 492 * @systemapi 493 * @since 12 494 * @deprecated since 15 495 * @useinstead NotificationRequest#appInstanceKey 496 */ 497 readonly creatorInstanceKey?: number; 498 499 /** 500 * Name of the custom ringtone file for application notifications. 501 * 502 * @type { ?string } 503 * @syscap SystemCapability.Notification.Notification 504 * @since arkts {'1.1':'12', '1.2':'20'} 505 * @arkts 1.1&1.2 506 */ 507 sound?: string; 508 509 /** 510 * Obtains the classification of this notification. 511 * 512 * @type { ?string } 513 * @syscap SystemCapability.Notification.Notification 514 * @systemapi 515 * @since arkts {'1.1':'7', '1.2':'20'} 516 * @arkts 1.1&1.2 517 */ 518 classification?: string; 519 520 /** 521 * Unique ID of the notification. 522 * 523 * @type { ?string } 524 * @readonly 525 * @syscap SystemCapability.Notification.Notification 526 * @since arkts {'1.1':'7', '1.2':'20'} 527 * @arkts 1.1&1.2 528 */ 529 readonly hashCode?: string; 530 531 /** 532 * Whether the notification can be remove. 533 * 534 * @type { ?boolean } 535 * @default true 536 * @syscap SystemCapability.Notification.Notification 537 * @systemapi 538 * @since 8 539 */ 540 /** 541 * Whether the notification can be remove. 542 * 543 * @permission ohos.permission.SET_UNREMOVABLE_NOTIFICATION 544 * @type { ?boolean } 545 * @default true 546 * @syscap SystemCapability.Notification.Notification 547 * @systemapi 548 * @since arkts {'1.1':'11', '1.2':'20'} 549 * @arkts 1.1&1.2 550 */ 551 isRemoveAllowed?: boolean; 552 553 /** 554 * Notification source. enum SourceType 555 * 556 * @type { ?number } 557 * @readonly 558 * @syscap SystemCapability.Notification.Notification 559 * @systemapi 560 * @since arkts {'1.1':'8', '1.2':'20'} 561 * @arkts 1.1&1.2 562 */ 563 readonly source?: number; 564 565 /** 566 * Notification template. 567 * 568 * @type { ?NotificationTemplate } 569 * @syscap SystemCapability.Notification.Notification 570 * @since arkts {'1.1':'8', '1.2':'20'} 571 * @arkts 1.1&1.2 572 */ 573 template?: NotificationTemplate; 574 575 /** 576 * Distributed notification options. Not supported currently. 577 * 578 * @type { ?DistributedOptions } 579 * @syscap SystemCapability.Notification.Notification 580 * @since arkts {'1.1':'8', '1.2':'20'} 581 * @arkts 1.1&1.2 582 */ 583 distributedOption?: DistributedOptions; 584 585 /** 586 * The device ID of the notification source. 587 * 588 * @type { ?string } 589 * @readonly 590 * @syscap SystemCapability.Notification.Notification 591 * @systemapi 592 * @since arkts {'1.1':'8', '1.2':'20'} 593 * @arkts 1.1&1.2 594 */ 595 readonly deviceId?: string; 596 597 /** 598 * Notification flags. 599 * 600 * @type { ?NotificationFlags } 601 * @readonly 602 * @syscap SystemCapability.Notification.Notification 603 * @since arkts {'1.1':'8', '1.2':'20'} 604 * @arkts 1.1&1.2 605 */ 606 readonly notificationFlags?: NotificationFlags; 607 608 /** 609 * WantAgent instance to which the notification will be redirected when it is removed. 610 * Currently, redirection to UIAbility is not supported. Only common events can be published (that is, actionType is set to 4). 611 * 612 * @type { ?WantAgent } 613 * @syscap SystemCapability.Notification.Notification 614 * @since arkts {'1.1':'9', '1.2':'20'} 615 * @arkts 1.1&1.2 616 */ 617 removalWantAgent?: WantAgent; 618 619 /** 620 * Number of notifications displayed on the application icon. If the badgeNumber is set to 0, badges are cleared; 621 * if the value is greater than 99, 99+ is displayed on the badge. 622 * 623 * @type { ?number } 624 * @syscap SystemCapability.Notification.Notification 625 * @since 9 626 */ 627 /** 628 * Number of notifications displayed on the application icon. If the badgeNumber is set to 0, badges are cleared; 629 * if the value is greater than 99, 99+ is displayed on the badge. 630 * 631 * @type { ?number } 632 * @syscap SystemCapability.Notification.Notification 633 * @crossplatform 634 * @since arkts {'1.1':'12', '1.2':'20'} 635 * @arkts 1.1&1.2 636 */ 637 badgeNumber?: number; 638 639 /** 640 * Whether the notification need to be agent display. 641 * 642 * @type { ?BundleOption } 643 * @syscap SystemCapability.Notification.Notification 644 * @systemapi 645 * @since arkts {'1.1':'12', '1.2':'20'} 646 * @arkts 1.1&1.2 647 */ 648 representativeBundle?: BundleOption; 649 650 /** 651 * Proxy identity of creation notification. 652 * 653 * @type { ?BundleOption } 654 * @readonly 655 * @syscap SystemCapability.Notification.Notification 656 * @systemapi 657 * @since arkts {'1.1':'12', '1.2':'20'} 658 * @arkts 1.1&1.2 659 */ 660 readonly agentBundle?: BundleOption; 661 662 /** 663 * Unified aggregation of information across applications. 664 * 665 * @type { ?UnifiedGroupInfo } 666 * @syscap SystemCapability.Notification.Notification 667 * @systemapi 668 * @since arkts {'1.1':'12', '1.2':'20'} 669 * @arkts 1.1&1.2 670 */ 671 unifiedGroupInfo?: UnifiedGroupInfo; 672 673 /** 674 * Notification control flags. 675 * 676 * @type { ?number } 677 * @syscap SystemCapability.Notification.Notification 678 * @systemapi 679 * @since arkts {'1.1':'12', '1.2':'20'} 680 * @arkts 1.1&1.2 681 */ 682 notificationControlFlags?: number; 683 684 /** 685 * Application instance key. 686 * 687 * @type { ?string } 688 * @readonly 689 * @syscap SystemCapability.Notification.Notification 690 * @systemapi 691 * @since arkts {'1.1':'15', '1.2':'20'} 692 * @arkts 1.1&1.2 693 */ 694 readonly appInstanceKey?: string; 695 696 /** 697 * Force distributed forwarding flag. 698 * 699 * @type { ?boolean } 700 * @default false 701 * @syscap SystemCapability.Notification.Notification 702 * @systemapi 703 * @since arkts {'1.1':'18', '1.2':'20'} 704 * @arkts 1.1&1.2 705 */ 706 forceDistributed?: boolean; 707 708 /** 709 * Distributed forwarding flag. 710 * 711 * @type { ?boolean } 712 * @default false 713 * @syscap SystemCapability.Notification.Notification 714 * @systemapi 715 * @since arkts {'1.1':'18', '1.2':'20'} 716 * @arkts 1.1&1.2 717 */ 718 notDistributed?: boolean; 719} 720 721/** 722 * Describes distributed notification options. 723 * 724 * @typedef DistributedOptions 725 * @syscap SystemCapability.Notification.Notification 726 * @since arkts {'1.1':'8', '1.2':'20'} 727 * @arkts 1.1&1.2 728 */ 729export interface DistributedOptions { 730 /** 731 * Whether the notification is a distributed notification. 732 * 733 * @type { ?boolean } 734 * @default true 735 * @syscap SystemCapability.Notification.Notification 736 * @since arkts {'1.1':'8', '1.2':'20'} 737 * @arkts 1.1&1.2 738 */ 739 isDistributed?: boolean; 740 741 /** 742 * List of the devices to which the notification can be synchronized. 743 * 744 * @type { ?Array<string> } 745 * @syscap SystemCapability.Notification.Notification 746 * @since arkts {'1.1':'8', '1.2':'20'} 747 * @arkts 1.1&1.2 748 */ 749 supportDisplayDevices?: Array<string>; 750 751 /** 752 * List of the devices on which the notification can be opened. 753 * 754 * @type { ?Array<string> } 755 * @syscap SystemCapability.Notification.Notification 756 * @since arkts {'1.1':'8', '1.2':'20'} 757 * @arkts 1.1&1.2 758 */ 759 supportOperateDevices?: Array<string>; 760 761 /** 762 * Obtains the remind mode of the notification. enum DeviceRemindType. 763 * 764 * @type { ?number } 765 * @readonly 766 * @syscap SystemCapability.Notification.Notification 767 * @systemapi 768 * @since arkts {'1.1':'8', '1.2':'20'} 769 * @arkts 1.1&1.2 770 */ 771 readonly remindType?: number; 772} 773 774/** 775 * Describes notification filter. 776 * 777 * @typedef NotificationFilter 778 * @syscap SystemCapability.Notification.Notification 779 * @systemapi 780 * @since arkts {'1.1':'11', '1.2':'20'} 781 * @arkts 1.1&1.2 782 */ 783export interface NotificationFilter { 784 /** 785 * BundleOption of the notification. 786 * 787 * @type { BundleOption } 788 * @syscap SystemCapability.Notification.Notification 789 * @systemapi 790 * @since arkts {'1.1':'11', '1.2':'20'} 791 * @arkts 1.1&1.2 792 */ 793 bundle: BundleOption; 794 795 /** 796 * Indicates the label and id of the notification. 797 * 798 * @type { notificationSubscribe.NotificationKey } 799 * @syscap SystemCapability.Notification.Notification 800 * @systemapi 801 * @since arkts {'1.1':'11', '1.2':'20'} 802 * @arkts 1.1&1.2 803 */ 804 notificationKey: notificationSubscribe.NotificationKey; 805 806 /** 807 * Indicates the additional information filter keys list. 808 * 809 * @type { ?Array<string> } 810 * @syscap SystemCapability.Notification.Notification 811 * @systemapi 812 * @since arkts {'1.1':'11', '1.2':'20'} 813 * @arkts 1.1&1.2 814 */ 815 extraInfoKeys?: Array<string>; 816} 817 818/** 819 * Describes notification check information. 820 * 821 * @typedef NotificationCheckRequest 822 * @syscap SystemCapability.Notification.Notification 823 * @systemapi 824 * @since arkts {'1.1':'11', '1.2':'20'} 825 * @arkts 1.1&1.2 826 */ 827export interface NotificationCheckRequest { 828 /** 829 * The notification content type. 830 * 831 * @type { notificationManager.ContentType } 832 * @syscap SystemCapability.Notification.Notification 833 * @systemapi 834 * @since arkts {'1.1':'11', '1.2':'20'} 835 * @arkts 1.1&1.2 836 */ 837 contentType: notificationManager.ContentType; 838 839 /** 840 * Type of the notification slot.. 841 * 842 * @type { notificationManager.SlotType } 843 * @syscap SystemCapability.Notification.Notification 844 * @systemapi 845 * @since arkts {'1.1':'11', '1.2':'20'} 846 * @arkts 1.1&1.2 847 */ 848 slotType: notificationManager.SlotType; 849 850 /** 851 * Additional information of the notification. 852 * 853 * @type { Array<string> } 854 * @syscap SystemCapability.Notification.Notification 855 * @systemapi 856 * @since arkts {'1.1':'11', '1.2':'20'} 857 * @arkts 1.1&1.2 858 */ 859 extraInfoKeys: Array<string>; 860} 861 862/** 863 * Unified aggregation of information across applications. 864 * 865 * @typedef UnifiedGroupInfo 866 * @syscap SystemCapability.Notification.Notification 867 * @systemapi 868 * @since arkts {'1.1':'12', '1.2':'20'} 869 * @arkts 1.1&1.2 870 */ 871export interface UnifiedGroupInfo { 872 /** 873 * The key is aggregated across applications. 874 * 875 * @type { ?string } 876 * @syscap SystemCapability.Notification.Notification 877 * @systemapi 878 * @since arkts {'1.1':'12', '1.2':'20'} 879 * @arkts 1.1&1.2 880 */ 881 key?: string; 882 883 /** 884 * The title is aggregated across applications. 885 * 886 * @type { ?string } 887 * @syscap SystemCapability.Notification.Notification 888 * @systemapi 889 * @since arkts {'1.1':'12', '1.2':'20'} 890 * @arkts 1.1&1.2 891 */ 892 title?: string; 893 894 /** 895 * The content is aggregated across applications. 896 * 897 * @type { ?string } 898 * @syscap SystemCapability.Notification.Notification 899 * @systemapi 900 * @since arkts {'1.1':'12', '1.2':'20'} 901 * @arkts 1.1&1.2 902 */ 903 content?: string; 904 905 /** 906 * Aggregation scenario name. 907 * 908 * @type { ?string } 909 * @syscap SystemCapability.Notification.Notification 910 * @systemapi 911 * @since arkts {'1.1':'12', '1.2':'20'} 912 * @arkts 1.1&1.2 913 */ 914 sceneName?: string; 915 916 /** 917 * Other information is aggregated across applications. 918 * 919 * @type { ?object } 920 * @syscap SystemCapability.Notification.Notification 921 * @systemapi 922 * @since 12 923 */ 924 extraInfo?: { [key: string]: any }; 925 926 /** 927 * Other information is aggregated across applications. 928 * 929 * @type { ?object } 930 * @syscap SystemCapability.Notification.Notification 931 * @systemapi 932 * @since 20 933 * @arkts 1.2 934 */ 935 extraInfo?: Record<string, Object>; 936} 937