1/* 2 * Copyright (c) 2021 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 16import { AsyncCallback } from './basic'; 17import { NotificationSlot } from './notification/notificationSlot'; 18import { NotificationSubscriber } from './notification/notificationSubscriber'; 19import { NotificationSubscribeInfo } from './notification/notificationSubscribeInfo'; 20import { NotificationRequest } from './notification/notificationRequest'; 21 22/** 23 * Manages notifications. 24 * 25 * <p>Generally, only system applications have permissions on notification subscription and unsubscription. 26 * You can specify the content of a notification to be published and the content is carried by 27 * {@link NotificationRequest}. A notification ID is unique in an application and must be specified 28 * when using {@link NotificationRequest} to carry the notification content. If a notification 29 * with this ID has been published and you need to use this ID to publish another notification, 30 * the original notification will be updated. In addition, the notification ID can be used to cancel 31 * a notification by calling the {@link #cancel(int)} method. 32 * 33 * @name notification 34 * @since 7 35 * @syscap SystemCapability.Notification.Notification 36 * @import import notification from '@ohos.notification'; 37 * @permission N/A 38 */ 39declare namespace notification { 40 /** 41 * Publishes a notification. 42 * 43 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 44 * this method will update the notification. 45 * 46 * @param request notification request 47 * @param callback callback function 48 */ 49 function publish(request: NotificationRequest, callback: AsyncCallback<void>): void; 50 function publish(request: NotificationRequest): Promise<void>; 51 52 /** 53 * Publishes a notification to the specified user. 54 * 55 * @since 8 56 * @param Publishes a notification. 57 * @param userId of subscriber receiving the notification 58 * @systemapi Hide this for inner system use. 59 * @permission ohos.permission.NOTIFICATION_CONTROLLER 60 * 61 */ 62 function publish(request: NotificationRequest, userId: number, callback: AsyncCallback<void>): void; 63 function publish(request: NotificationRequest, userId: number): Promise<void>; 64 65 /** 66 * Cancels a notification with the specified ID. 67 * 68 * @param id of the notification to cancel, which must be unique in the application. 69 * @param callback callback function 70 */ 71 function cancel(id: number, callback: AsyncCallback<void>): void; 72 73 /** 74 * Cancels a notification with the specified label and ID. 75 * 76 * @param id ID of the notification to cancel, which must be unique in the application. 77 * @param label Label of the notification to cancel. 78 * @param callback callback function 79 */ 80 function cancel(id: number, label: string, callback: AsyncCallback<void>): void; 81 function cancel(id: number, label?: string): Promise<void>; 82 83 /** 84 * Cancels all notifications of the current application. 85 */ 86 function cancelAll(callback: AsyncCallback<void>): void; 87 function cancelAll(): Promise<void>; 88 89 /** 90 * Creates a notification slot. 91 * 92 * @param slot Indicates the notification slot to be created, which is set by {@link NotificationSlot}. 93 * This parameter must be specified. 94 * @param callback callback function 95 * @systemapi Hide this for inner system use. 96 * @permission ohos.permission.NOTIFICATION_CONTROLLER 97 */ 98 function addSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; 99 100 /** 101 * Creates a notification slot. 102 * 103 * @param slot Indicates the notification slot to be created, which is set by {@link NotificationSlot}. 104 * This parameter must be specified. 105 * 106 * @systemapi Hide this for inner system use. 107 * @permission ohos.permission.NOTIFICATION_CONTROLLER 108 */ 109 function addSlot(slot: NotificationSlot): Promise<void>; 110 111 /** 112 * Adds a slot type. 113 * 114 * @param type Slot type to add. 115 * @param callback callback function 116 */ 117 function addSlot(type: SlotType, callback: AsyncCallback<void>): void; 118 function addSlot(type: SlotType): Promise<void>; 119 120 /** 121 * Creates a notification slot. 122 * 123 * @param slots Indicates the notification slots to be created, which is set by {@link NotificationSlot}. 124 * This parameter must be specified. 125 * @param callback callback function 126 * @systemapi Hide this for inner system use. 127 * @permission ohos.permission.NOTIFICATION_CONTROLLER 128 */ 129 function addSlots(slots: Array<NotificationSlot>, callback: AsyncCallback<void>): void; 130 131 /** 132 * Creates a notification slot. 133 * 134 * @param slots Indicates the notification slots to be created, which is set by {@link NotificationSlot}. 135 * This parameter must be specified. 136 * 137 * @systemapi Hide this for inner system use. 138 * @permission ohos.permission.NOTIFICATION_CONTROLLER 139 */ 140 function addSlots(slots: Array<NotificationSlot>): Promise<void>; 141 142 /** 143 * Obtains a notification slot of the specified slot type. 144 * 145 * @param slotType Type of the notification slot to obtain. 146 * @param callback callback function 147 * @return Returns the created {@link NotificationSlot}. 148 */ 149 function getSlot(slotType: SlotType, callback: AsyncCallback<NotificationSlot>): void; 150 function getSlot(slotType: SlotType): Promise<NotificationSlot>; 151 152 /** 153 * Obtains all NotificationSlot objects created by the current application. 154 * 155 * @return Returns all notification slots of this application. 156 */ 157 function getSlots(callback: AsyncCallback<Array<NotificationSlot>>): void; 158 function getSlots(): Promise<Array<NotificationSlot>>; 159 160 /** 161 * Removes a NotificationSlot of the specified SlotType created by the current application. 162 * 163 * @param slotType Type of the NotificationSlot to remove. 164 * @param callback callback function 165 */ 166 function removeSlot(slotType: SlotType, callback: AsyncCallback<void>): void; 167 function removeSlot(slotType: SlotType): Promise<void>; 168 169 /** 170 * Removes all NotificationSlot objects created by the current application. 171 */ 172 function removeAllSlots(callback: AsyncCallback<void>): void; 173 function removeAllSlots(): Promise<void>; 174 175 /** 176 * Describes NotificationSlot types. 177 */ 178 export enum SlotType { 179 /** 180 * NotificationSlot of an unknown type. 181 */ 182 UNKNOWN_TYPE = 0, 183 184 /** 185 * NotificationSlot for social communication. 186 */ 187 SOCIAL_COMMUNICATION = 1, 188 189 /** 190 * NotificationSlot for service information. 191 */ 192 SERVICE_INFORMATION = 2, 193 194 /** 195 * NotificationSlot for service information. 196 */ 197 CONTENT_INFORMATION = 3, 198 199 /** 200 * NotificationSlot for other purposes. 201 */ 202 OTHER_TYPES = 0xFFFF, 203 } 204 205 /** 206 * Describes notification content types. 207 * 208 * @name ContentType 209 * @since 7 210 * @syscap SystemCapability.Notification.Notification 211 * @permission N/A 212 */ 213 export enum ContentType { 214 /** 215 * Normal text notification. 216 */ 217 NOTIFICATION_CONTENT_BASIC_TEXT, 218 219 /** 220 * Long text notification. 221 */ 222 NOTIFICATION_CONTENT_LONG_TEXT, 223 224 /** 225 * Picture-attached notification. 226 */ 227 NOTIFICATION_CONTENT_PICTURE, 228 229 /** 230 * Conversation notification. 231 */ 232 NOTIFICATION_CONTENT_CONVERSATION, 233 234 /** 235 * Multi-line text notification. 236 */ 237 NOTIFICATION_CONTENT_MULTILINE, 238 } 239 240 /** 241 * Indicates the level of the slot 242 */ 243 export enum SlotLevel { 244 /** 245 * Indicates that the notification function is disabled. 246 */ 247 LEVEL_NONE = 0, 248 249 /** 250 * Indicates that the notification function is enabled but notification 251 * icons are not displayed in the status bar, with no banner or prompt tone. 252 */ 253 LEVEL_MIN = 1, 254 255 /** 256 * Indicates that the notification function is enabled and notification 257 * icons are displayed in the status bar, with no banner or prompt tone. 258 */ 259 LEVEL_LOW = 2, 260 261 /** 262 * Indicates that the notification function is enabled and notification 263 * icons are displayed in the status bar, with no banner but with a prompt tone. 264 */ 265 LEVEL_DEFAULT = 3, 266 267 /** 268 * Indicates that the notification function is enabled and notification 269 * icons are displayed in the status bar, with a banner and a prompt tone. 270 */ 271 LEVEL_HIGH = 4, 272 } 273 274 /** 275 * subscribe 276 * 277 * @systemapi Hide this for inner system use. 278 * @permission ohos.permission.NOTIFICATION_CONTROLLER 279 */ 280 function subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback<void>): void; 281 282 /** 283 * subscribe 284 * 285 * @systemapi Hide this for inner system use. 286 * @permission ohos.permission.NOTIFICATION_CONTROLLER 287 */ 288 function subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback<void>): void; 289 290 /** 291 * subscribe 292 * 293 * @systemapi Hide this for inner system use. 294 * @permission ohos.permission.NOTIFICATION_CONTROLLER 295 */ 296 function subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise<void>; 297 298 /** 299 * unsubscribe 300 * 301 * @systemapi Hide this for inner system use. 302 * @permission ohos.permission.NOTIFICATION_CONTROLLER 303 */ 304 function unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback<void>): void; 305 306 /** 307 * unsubscribe 308 * 309 * @systemapi Hide this for inner system use. 310 * @permission ohos.permission.NOTIFICATION_CONTROLLER 311 */ 312 function unsubscribe(subscriber: NotificationSubscriber): Promise<void>; 313 314 /** 315 * enableNotification 316 * 317 * @systemapi Hide this for inner system use. 318 * @permission ohos.permission.NOTIFICATION_CONTROLLER 319 */ 320 function enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 321 322 /** 323 * enableNotification 324 * 325 * @systemapi Hide this for inner system use. 326 * @permission ohos.permission.NOTIFICATION_CONTROLLER 327 */ 328 function enableNotification(bundle: BundleOption, enable: boolean): Promise<void>; 329 330 /** 331 * isNotificationEnabled 332 * 333 * @systemapi Hide this for inner system use. 334 * @permission ohos.permission.NOTIFICATION_CONTROLLER 335 */ 336 function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 337 338 /** 339 * isNotificationEnabled 340 * 341 * @systemapi Hide this for inner system use. 342 * @permission ohos.permission.NOTIFICATION_CONTROLLER 343 */ 344 function isNotificationEnabled(bundle: BundleOption): Promise<boolean>; 345 346 /** 347 * isNotificationEnabled 348 * 349 * @systemapi Hide this for inner system use. 350 * @permission ohos.permission.NOTIFICATION_CONTROLLER 351 */ 352 function isNotificationEnabled(callback: AsyncCallback<boolean>): void; 353 354 /** 355 * isNotificationEnabled 356 * 357 * @systemapi Hide this for inner system use. 358 * @permission ohos.permission.NOTIFICATION_CONTROLLER 359 */ 360 function isNotificationEnabled(): Promise<boolean>; 361 362 /** 363 * Checks whether this application has permission to publish notifications under the user. 364 * 365 * since 8 366 * @systemapi Hide this for inner system use. 367 * @permission ohos.permission.NOTIFICATION_CONTROLLER 368 */ 369 function isNotificationEnabled(userId: number, callback: AsyncCallback<boolean>): void; 370 function isNotificationEnabled(userId: number): Promise<boolean>; 371 372 /** 373 * displayBadge 374 * 375 * @systemapi Hide this for inner system use. 376 * @permission ohos.permission.NOTIFICATION_CONTROLLER 377 */ 378 function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 379 380 /** 381 * displayBadge 382 * 383 * @systemapi Hide this for inner system use. 384 * @permission ohos.permission.NOTIFICATION_CONTROLLER 385 */ 386 function displayBadge(bundle: BundleOption, enable: boolean): Promise<void>; 387 388 /** 389 * isBadgeDisplayed 390 * 391 * @systemapi Hide this for inner system use. 392 * @permission ohos.permission.NOTIFICATION_CONTROLLER 393 */ 394 function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 395 396 /** 397 * isBadgeDisplayed 398 * 399 * @systemapi Hide this for inner system use. 400 * @permission ohos.permission.NOTIFICATION_CONTROLLER 401 */ 402 function isBadgeDisplayed(bundle: BundleOption): Promise<boolean>; 403 404 /** 405 * setSlotByBundle 406 * 407 * @systemapi Hide this for inner system use. 408 * @permission ohos.permission.NOTIFICATION_CONTROLLER 409 */ 410 function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback<void>): void; 411 412 /** 413 * setSlotByBundle 414 * 415 * @systemapi Hide this for inner system use. 416 * @permission ohos.permission.NOTIFICATION_CONTROLLER 417 */ 418 function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise<void>; 419 420 /** 421 * getSlotsByBundle 422 * 423 * @systemapi Hide this for inner system use. 424 * @permission ohos.permission.NOTIFICATION_CONTROLLER 425 */ 426 function getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array<NotificationSlot>>): void; 427 428 /** 429 * getSlotsByBundle 430 * 431 * @systemapi Hide this for inner system use. 432 * @permission ohos.permission.NOTIFICATION_CONTROLLER 433 */ 434 function getSlotsByBundle(bundle: BundleOption): Promise<Array<NotificationSlot>>; 435 436 /** 437 * getSlotNumByBundle 438 * 439 * @systemapi Hide this for inner system use. 440 * @permission ohos.permission.NOTIFICATION_CONTROLLER 441 */ 442 function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback<number>): void; 443 444 /** 445 * getSlotNumByBundle 446 * 447 * @systemapi Hide this for inner system use. 448 * @permission ohos.permission.NOTIFICATION_CONTROLLER 449 */ 450 function getSlotNumByBundle(bundle: BundleOption): Promise<number>; 451 452 /** 453 * remove 454 * 455 * @systemapi Hide this for inner system use. 456 * @permission ohos.permission.NOTIFICATION_CONTROLLER 457 */ 458 function remove(bundle: BundleOption, notificationKey: NotificationKey, callback: AsyncCallback<void>): void; 459 460 /** 461 * remove 462 * 463 * @systemapi Hide this for inner system use. 464 * @permission ohos.permission.NOTIFICATION_CONTROLLER 465 */ 466 function remove(bundle: BundleOption, notificationKey: NotificationKey): Promise<void>; 467 468 /** 469 * remove 470 * 471 * @systemapi Hide this for inner system use. 472 * @permission ohos.permission.NOTIFICATION_CONTROLLER 473 */ 474 function remove(hashCode: string, callback: AsyncCallback<void>): void; 475 476 /** 477 * remove 478 * 479 * @systemapi Hide this for inner system use. 480 * @permission ohos.permission.NOTIFICATION_CONTROLLER 481 */ 482 function remove(hashCode: string): Promise<void>; 483 484 /** 485 * removeAll 486 * 487 * @systemapi Hide this for inner system use. 488 * @permission ohos.permission.NOTIFICATION_CONTROLLER 489 */ 490 function removeAll(bundle: BundleOption, callback: AsyncCallback<void>): void; 491 492 /** 493 * removeAll 494 * 495 * @systemapi Hide this for inner system use. 496 * @permission ohos.permission.NOTIFICATION_CONTROLLER 497 */ 498 function removeAll(callback: AsyncCallback<void>): void; 499 500 /** 501 * Remove all notifications under the specified user. 502 * 503 * @since 8 504 * @systemapi Hide this for inner system use. 505 * @permission ohos.permission.NOTIFICATION_CONTROLLER 506 */ 507 function removeAll(userId: number, callback: AsyncCallback<void>): void; 508 function removeAll(userId: number): Promise<void>; 509 510 /** 511 * removeAll 512 * 513 * @systemapi Hide this for inner system use. 514 * @permission ohos.permission.NOTIFICATION_CONTROLLER 515 */ 516 function removeAll(bundle?: BundleOption): Promise<void>; 517 518 /** 519 * Obtains all active notifications in the current system. The caller must have system permissions to 520 * call this method. 521 * 522 * @systemapi Hide this for inner system use. 523 * @permission ohos.permission.NOTIFICATION_CONTROLLER 524 */ 525 function getAllActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 526 527 /** 528 * Obtains all active notifications in the current system. The caller must have system permissions to 529 * call this method. 530 * 531 * @systemapi Hide this for inner system use. 532 * @permission ohos.permission.NOTIFICATION_CONTROLLER 533 */ 534 function getAllActiveNotifications(): Promise<Array<NotificationRequest>>; 535 536 /** 537 * Obtains the number of all active notifications. 538 */ 539 function getActiveNotificationCount(callback: AsyncCallback<number>): void; 540 function getActiveNotificationCount(): Promise<number>; 541 542 /** 543 * Obtains an array of active notifications. 544 */ 545 function getActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 546 function getActiveNotifications(): Promise<Array<NotificationRequest>>; 547 548 /** 549 * Cancel the notification of a specified group for this application. 550 * 551 * @since 8 552 */ 553 function cancelGroup(groupName: string, callback: AsyncCallback<void>): void; 554 function cancelGroup(groupName: string): Promise<void>; 555 556 /** 557 * Delete the notification of a specified group for this application. 558 * 559 * @since 8 560 * @systemapi Hide this for inner system use. 561 * @permission ohos.permission.NOTIFICATION_CONTROLLER 562 */ 563 function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback<void>): void; 564 function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise<void>; 565 566 /** 567 * Set the Do Not Disturb date. 568 * 569 * @since 8 570 * @systemapi Hide this for inner system use. 571 * @permission ohos.permission.NOTIFICATION_CONTROLLER 572 */ 573 function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback<void>): void; 574 function setDoNotDisturbDate(date: DoNotDisturbDate): Promise<void>; 575 576 /** 577 * Set the Do Not Disturb date under the specified user. 578 * 579 * @since 8 580 * @systemapi Hide this for inner system use. 581 * @permission ohos.permission.NOTIFICATION_CONTROLLER 582 */ 583 function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallback<void>): void; 584 function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise<void>; 585 586 /** 587 * Obtains the Do Not Disturb date. 588 * 589 * @since 8 590 * @systemapi Hide this for inner system use. 591 * @permission ohos.permission.NOTIFICATION_CONTROLLER 592 */ 593 function getDoNotDisturbDate(callback: AsyncCallback<DoNotDisturbDate>): void; 594 function getDoNotDisturbDate(): Promise<DoNotDisturbDate>; 595 596 /** 597 * Obtains the Do Not Disturb date. 598 * 599 * @since 8 600 * @systemapi Hide this for inner system use under the specified user. 601 * @permission ohos.permission.NOTIFICATION_CONTROLLER 602 */ 603 function getDoNotDisturbDate(userId: number, callback: AsyncCallback<DoNotDisturbDate>): void; 604 function getDoNotDisturbDate(userId: number): Promise<DoNotDisturbDate>; 605 606 /** 607 * Obtains whether to support the Do Not Disturb mode. 608 * 609 * @since 8 610 * @systemapi Hide this for inner system use. 611 * @permission ohos.permission.NOTIFICATION_CONTROLLER 612 */ 613 function supportDoNotDisturbMode(callback: AsyncCallback<boolean>): void; 614 function supportDoNotDisturbMode(): Promise<boolean>; 615 616 /** 617 * Obtains whether the template is supported by the system. 618 * 619 * @since 8 620 * @param templateName Name of template to be Obtained 621 * @param callback callback function 622 */ 623 function isSupportTemplate(templateName: string, callback: AsyncCallback<boolean>): void; 624 function isSupportTemplate(templateName: string): Promise<boolean>; 625 626 /** 627 * Request permission to send notification. 628 * 629 * @since 8 630 */ 631 function requestEnableNotification(callback: AsyncCallback<void>): void; 632 function requestEnableNotification(): Promise<void>; 633 634 /** 635 * Sets whether the device supports distributed notification. 636 * 637 * @since 8 638 * @systemapi Hide this for inner system use. 639 * @permission ohos.permission.NOTIFICATION_CONTROLLER 640 */ 641 function enableDistributed(enable: boolean, callback: AsyncCallback<void>): void; 642 function enableDistributed(enable: boolean): Promise<void>; 643 644 /** 645 * Obtains whether the device supports distributed notification. 646 * 647 * @since 8 648 */ 649 function isDistributedEnabled(callback: AsyncCallback<boolean>): void; 650 function isDistributedEnabled(): Promise<boolean>; 651 652 /** 653 * Sets whether an application supports distributed notification. 654 * 655 * @since 8 656 * @systemapi Hide this for inner system use. 657 * @permission ohos.permission.NOTIFICATION_CONTROLLER 658 */ 659 function enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 660 function enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise<void>; 661 662 /** 663 * Obtains whether an application supports distributed notification. 664 * 665 * @since 8 666 * @systemapi Hide this for inner system use. 667 * @permission ohos.permission.NOTIFICATION_CONTROLLER 668 */ 669 function isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 670 function isDistributedEnabledByBundle(bundle: BundleOption): Promise<boolean>; 671 672 /** 673 * Obtains the remind modes of the notification. 674 * 675 * @since 8 676 * @systemapi Hide this for inner system use. 677 * @permission ohos.permission.NOTIFICATION_CONTROLLER 678 */ 679 function getDeviceRemindType(callback: AsyncCallback<DeviceRemindType>): void; 680 function getDeviceRemindType(): Promise<DeviceRemindType>; 681 682 /** 683 * Describes a BundleOption. 684 */ 685 export interface BundleOption { 686 bundle: string; 687 uid?: number; 688 } 689 690 /** 691 * Describes a NotificationKey, which can be used to identify a notification. 692 */ 693 export interface NotificationKey { 694 id: number; 695 label?: string; 696 } 697 698 /** 699 * The type of the Do Not Disturb. 700 * 701 * @since 8 702 * @systemapi Hide this for inner system use. 703 */ 704 export enum DoNotDisturbType { 705 /** 706 * Non do not disturb type notification 707 */ 708 TYPE_NONE = 0, 709 710 /** 711 * Execute do not disturb once in the set time period (only watch hours and minutes) 712 */ 713 TYPE_ONCE = 1, 714 715 /** 716 * Execute do not disturb every day with a set time period (only watch hours and minutes) 717 */ 718 TYPE_DAILY = 2, 719 720 /** 721 * Execute in the set time period (specify the time, month, day and hour) 722 */ 723 TYPE_CLEARLY = 3, 724 } 725 726 /** 727 * Describes a DoNotDisturbDate instance. 728 * 729 * @systemapi Hide this for inner system use. 730 */ 731 export interface DoNotDisturbDate { 732 /** 733 * the type of the Do Not Disturb. 734 * 735 * @since 8 736 */ 737 type: DoNotDisturbType; 738 739 /** 740 * the start time of the Do Not Disturb. 741 * 742 * @since 8 743 */ 744 begin: Date; 745 746 /** 747 * the end time of the Do Not Disturb. 748 * 749 * @since 8 750 */ 751 end: Date; 752 } 753 754 /** 755 * The type of the Do Not Disturb. 756 * 757 * @since 8 758 * @systemapi Hide this for inner system use. 759 */ 760 export enum DoNotDisturbType { 761 /** 762 * Non do not disturb type notification 763 */ 764 TYPE_NONE = 0, 765 766 /** 767 * Execute do not disturb once in the set time period (only watch hours and minutes) 768 */ 769 TYPE_ONCE = 1, 770 771 /** 772 * Execute do not disturb every day with a set time period (only watch hours and minutes) 773 */ 774 TYPE_DAILY = 2, 775 776 /** 777 * Execute in the set time period (specify the time, month, day and hour) 778 */ 779 TYPE_CLEARLY = 3, 780 } 781 782 /** 783 * Describes a DoNotDisturbDate instance. 784 * 785 * @systemapi Hide this for inner system use. 786 */ 787 export interface DoNotDisturbDate { 788 /** 789 * the type of the Do Not Disturb. 790 * 791 * @since 8 792 */ 793 type: DoNotDisturbType; 794 795 /** 796 * the start time of the Do Not Disturb. 797 * 798 * @since 8 799 */ 800 begin: Date; 801 802 /** 803 * the end time of the Do Not Disturb. 804 * 805 * @since 8 806 */ 807 end: Date; 808 } 809 810 /** 811 * The remind type of the nofication. 812 * 813 * @since 8 814 * @systemapi Hide this for inner system use. 815 */ 816 export enum DeviceRemindType { 817 /** 818 * The device is not in use, no reminder 819 */ 820 IDLE_DONOT_REMIND = 0, 821 822 /** 823 * The device is not in use, remind 824 */ 825 IDLE_REMIND = 1, 826 827 /** 828 * The device is in use, no reminder 829 */ 830 ACTIVE_DONOT_REMIND = 2, 831 832 /** 833 * The device is in use, reminder 834 */ 835 ACTIVE_REMIND = 3, 836 } 837} 838 839export default notification; 840