1/* 2 * Copyright (c) 2022 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 BackgroundTasksKit 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22import notification from './@ohos.notificationManager'; 23import { NotificationSlot } from './notification/notificationSlot'; 24import { ValuesBucket } from './@ohos.data.ValuesBucket'; 25 26/** 27 * Providers static methods for managing reminders, including publishing or canceling a reminder. 28 * Add or remove a notification slot, and obtain or cancel all reminders of the current application. 29 * 30 * @namespace reminderAgentManager 31 * @syscap SystemCapability.Notification.ReminderAgent 32 * @since 9 33 */ 34declare namespace reminderAgentManager { 35 /** 36 * Publishes a scheduled reminder. 37 * 38 * @permission ohos.permission.PUBLISH_AGENT_REMINDER 39 * @param { ReminderRequest } reminderReq - Indicates the reminder instance to publish. 40 * @param { AsyncCallback<number> } callback - Indicates the callback function. 41 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 42 * @throws { BusinessError } 1700001 - Notification is not enabled. 43 * @throws { BusinessError } 1700002 - The number of reminders exceeds the limit. 44 * @syscap SystemCapability.Notification.ReminderAgent 45 * @since 9 46 */ 47 function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void; 48 49 /** 50 * Publishes a scheduled reminder. 51 * 52 * @permission ohos.permission.PUBLISH_AGENT_REMINDER 53 * @param { ReminderRequest } reminderReq - Indicates the reminder instance to publish. 54 * @returns { Promise<number> } The reminder id. 55 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 56 * @throws { BusinessError } 1700001 - Notification is not enabled. 57 * @throws { BusinessError } 1700002 - The number of reminders exceeds the limit. 58 * @syscap SystemCapability.Notification.ReminderAgent 59 * @since 9 60 */ 61 function publishReminder(reminderReq: ReminderRequest): Promise<number>; 62 63 /** 64 * Cancel a reminder. 65 * 66 * @param { number } reminderId - Indicates the reminder id. 67 * @param { AsyncCallback<void> } callback - Indicates the callback function. 68 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 69 * @throws { BusinessError } 1700003 - The reminder does not exist. 70 * @throws { BusinessError } 1700004 - The bundle name does not exist. 71 * @syscap SystemCapability.Notification.ReminderAgent 72 * @since 9 73 */ 74 function cancelReminder(reminderId: number, callback: AsyncCallback<void>): void; 75 76 /** 77 * Cancel a reminder. 78 * 79 * @param { number } reminderId - Indicates the reminder id. 80 * @returns { Promise<void> } The promise returned by the function. 81 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 82 * @throws { BusinessError } 1700003 - The reminder does not exist. 83 * @throws { BusinessError } 1700004 - The bundle name does not exist. 84 * @syscap SystemCapability.Notification.ReminderAgent 85 * @since 9 86 */ 87 function cancelReminder(reminderId: number): Promise<void>; 88 89 /** 90 * Obtains all the valid reminders of current application. 91 * 92 * @param { AsyncCallback<Array<ReminderRequest>> } callback - Indicates the callback function. 93 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 94 * @throws { BusinessError } 1700004 - The bundle name does not exist. 95 * @syscap SystemCapability.Notification.ReminderAgent 96 * @since 9 97 */ 98 function getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void; 99 100 /** 101 * Obtains all the valid reminders of current application. 102 * 103 * @returns { Promise<Array<ReminderRequest>> } The promise returned by the function. 104 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 105 * @throws { BusinessError } 1700004 - The bundle name does not exist. 106 * @syscap SystemCapability.Notification.ReminderAgent 107 * @since 9 108 */ 109 function getValidReminders(): Promise<Array<ReminderRequest>>; 110 111 /** 112 * Cancel all the reminders of current application. 113 * 114 * @param { AsyncCallback<void> } callback - Indicates the callback function. 115 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 116 * @throws { BusinessError } 1700004 - The bundle name does not exist. 117 * @syscap SystemCapability.Notification.ReminderAgent 118 * @since 9 119 */ 120 function cancelAllReminders(callback: AsyncCallback<void>): void; 121 122 /** 123 * Cancel all the reminders of current application. 124 * 125 * @returns { Promise<void> } The promise returned by the function. 126 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 127 * @throws { BusinessError } 1700004 - The bundle name does not exist. 128 * @syscap SystemCapability.Notification.ReminderAgent 129 * @since 9 130 */ 131 function cancelAllReminders(): Promise<void>; 132 133 /** 134 * Add notification slot. 135 * 136 * @param { NotificationSlot } slot - Indicates the slot. 137 * @param { AsyncCallback<void> } callback - Indicates the callback function. 138 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 139 * @syscap SystemCapability.Notification.ReminderAgent 140 * @since 9 141 */ 142 function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; 143 144 /** 145 * Add notification slot. 146 * 147 * @param { NotificationSlot } slot - Indicates the slot. 148 * @returns { Promise<void> } The promise returned by the function. 149 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 150 * @syscap SystemCapability.Notification.ReminderAgent 151 * @since 9 152 */ 153 function addNotificationSlot(slot: NotificationSlot): Promise<void>; 154 155 /** 156 * Deletes a created notification slot based on the slot type. 157 * 158 * @param { notification.SlotType } slotType Indicates the type of the slot. 159 * @param { AsyncCallback<void> } callback - Indicates the callback function. 160 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 161 * @syscap SystemCapability.Notification.ReminderAgent 162 * @since 9 163 */ 164 function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void; 165 166 /** 167 * Deletes a created notification slot based on the slot type. 168 * 169 * @param { notification.SlotType } slotType Indicates the type of the slot. 170 * @returns { Promise<void> } The promise returned by the function. 171 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 172 * @syscap SystemCapability.Notification.ReminderAgent 173 * @since 9 174 */ 175 function removeNotificationSlot(slotType: notification.SlotType): Promise<void>; 176 177 /** 178 * add exclude date for calendar reminder request. 179 * 180 * @param { number } reminderId reminder id 181 * @param { Date } date date time 182 * @returns { Promise<void> } The promise returned by the function. 183 * @throws { BusinessError } 201 - Permission denied 184 * @throws { BusinessError } 401 - If the input parameter is not valid parameter. 185 * @throws { BusinessError } 1700003 - The reminder does not exist. 186 * @syscap SystemCapability.Notification.ReminderAgent 187 * @since 12 188 */ 189 function addExcludeDate(reminderId: number, date: Date): Promise<void>; 190 191 /** 192 * delete exclude date for calendar reminder request. 193 * 194 * @param { number } reminderId reminder id 195 * @returns { Promise<void> } The promise returned by the function. 196 * @throws { BusinessError } 201 - Permission denied 197 * @throws { BusinessError } 1700003 - The reminder does not exist. 198 * @syscap SystemCapability.Notification.ReminderAgent 199 * @since 12 200 */ 201 function deleteExcludeDates(reminderId: number): Promise<void>; 202 203 /** 204 * get exclude dates 205 * 206 * @param { number } reminderId reminder id 207 * @returns { Promise<Array<Date>> } The promise returned by the function. 208 * @throws { BusinessError } 201 - Permission denied 209 * @throws { BusinessError } 1700003 - The reminder does not exist. 210 * @syscap SystemCapability.Notification.ReminderAgent 211 * @since 12 212 */ 213 function getExcludeDates(reminderId: number): Promise<Array<Date>>; 214 215 /** 216 * Obtains all the valid reminders of current application, include reminderId. 217 * 218 * @returns { Promise<Array<ReminderInfo>> } The promise returned by the function. 219 * @throws { BusinessError } 201 - Permission denied. 220 * @syscap SystemCapability.Notification.ReminderAgent 221 * @since 12 222 */ 223 function getAllValidReminders(): Promise<Array<ReminderInfo>>; 224 225 /** 226 * Updates a scheduled reminder. 227 * 228 * @permission ohos.permission.PUBLISH_AGENT_REMINDER 229 * @param { reminderId } number - Indicates the reminder id. 230 * @param { ReminderRequest } reminderReq - Indicates the reminder. 231 * @returns { Promise<void> } The promise returned by the function. 232 * @throws { BusinessError } 201 - Permission denied. 233 * @throws { BusinessError } 1700003 - The reminder does not exist. 234 * @throws { BusinessError } 1700007 - If the input parameter is not valid parameter. 235 * @syscap SystemCapability.Notification.ReminderAgent 236 * @since 20 237 */ 238 function updateReminder(reminderId: number, reminderReq: ReminderRequest): Promise<void>; 239 240 /** 241 * Declares action button type. 242 * 243 * @enum { number } 244 * @syscap SystemCapability.Notification.ReminderAgent 245 * @since 9 246 */ 247 export enum ActionButtonType { 248 /** 249 * Button for closing the reminder. 250 * 251 * @syscap SystemCapability.Notification.ReminderAgent 252 * @since 9 253 */ 254 ACTION_BUTTON_TYPE_CLOSE = 0, 255 256 /** 257 * Button for snoozing the reminder. 258 * 259 * @syscap SystemCapability.Notification.ReminderAgent 260 * @since 9 261 */ 262 ACTION_BUTTON_TYPE_SNOOZE = 1, 263 264 /** 265 * The custom button. 266 * 267 * @syscap SystemCapability.Notification.ReminderAgent 268 * @systemapi Hide this for inner system use. 269 * @since 10 270 */ 271 ACTION_BUTTON_TYPE_CUSTOM = 2 272 } 273 274 /** 275 * Declares reminder type. 276 * 277 * @enum { number } 278 * 279 * @syscap SystemCapability.Notification.ReminderAgent 280 * @since 9 281 */ 282 export enum ReminderType { 283 /** 284 * Countdown reminder. 285 * 286 * @syscap SystemCapability.Notification.ReminderAgent 287 * @since 9 288 */ 289 REMINDER_TYPE_TIMER = 0, 290 291 /** 292 * Calendar reminder. 293 * 294 * @syscap SystemCapability.Notification.ReminderAgent 295 * @since 9 296 */ 297 REMINDER_TYPE_CALENDAR = 1, 298 299 /** 300 * Alarm reminder. 301 * 302 * @syscap SystemCapability.Notification.ReminderAgent 303 * @since 9 304 */ 305 REMINDER_TYPE_ALARM = 2 306 } 307 308 /** 309 * Action button information. The button will show on displayed reminder. 310 * 311 * @interface ActionButton 312 * 313 * @syscap SystemCapability.Notification.ReminderAgent 314 * @since 9 315 */ 316 interface ActionButton { 317 /** 318 * Text on the button. 319 * 320 * @type { string } 321 * @syscap SystemCapability.Notification.ReminderAgent 322 * @since 9 323 */ 324 title: string; 325 326 /** 327 * Resource ID for button title. 328 * 329 * @type { ?string } 330 * @syscap SystemCapability.Notification.ReminderAgent 331 * @since 11 332 */ 333 titleResource?: string; 334 335 /** 336 * Button type. 337 * 338 * @type { ActionButtonType } 339 * @syscap SystemCapability.Notification.ReminderAgent 340 * @since 9 341 */ 342 type: ActionButtonType; 343 344 /** 345 * Information about the ability that is redirected to when the button is clicked. 346 * 347 * @type { ?WantAgent } 348 * @syscap SystemCapability.Notification.ReminderAgent 349 * @systemapi Hide this for inner system use. 350 * @since 10 351 */ 352 wantAgent?: WantAgent; 353 354 /** 355 * It will update the database when the button is clicked. 356 * 357 * @type { ?DataShareUpdate } 358 * @syscap SystemCapability.Notification.ReminderAgent 359 * @systemapi Hide this for inner system use. 360 * @since 11 361 */ 362 dataShareUpdate?: DataShareUpdate; 363 } 364 365 /** 366 * Want agent information. 367 * It will switch to target ability when you click the displayed reminder. 368 * 369 * @interface WantAgent 370 * @syscap SystemCapability.Notification.ReminderAgent 371 * @since 9 372 */ 373 interface WantAgent { 374 /** 375 * Name of the package redirected to when the reminder notification is clicked. 376 * 377 * @type { string } 378 * @syscap SystemCapability.Notification.ReminderAgent 379 * @since 9 380 */ 381 pkgName: string; 382 383 /** 384 * Name of the ability that is redirected to when the reminder notification is clicked. 385 * 386 * @type { string } 387 * @syscap SystemCapability.Notification.ReminderAgent 388 * @since 9 389 */ 390 abilityName: string; 391 392 /** 393 * The Uniform Resource Identifier (URI) that will be redirected to. 394 * 395 * @type { ?string } 396 * @syscap SystemCapability.Notification.ReminderAgent 397 * @since 12 398 */ 399 uri?: string; 400 401 /** 402 * The description of the WantParams object in an Want 403 * 404 * @type { ?Record<string, Object> } 405 * @syscap SystemCapability.Notification.ReminderAgent 406 * @since 12 407 */ 408 parameters?: Record<string, Object>; 409 } 410 411 /** 412 * DataShareUpdate information. 413 * It will update the database when the button is clicked. 414 * 415 * @interface DataShareUpdate 416 * @syscap SystemCapability.Notification.ReminderAgent 417 * @systemapi Hide this for inner system use. 418 * @since 11 419 */ 420 interface DataShareUpdate { 421 /** 422 * Indicates the path of data to update. 423 * 424 * @type { string } 425 * @syscap SystemCapability.Notification.ReminderAgent 426 * @systemapi Hide this for inner system use. 427 * @since 11 428 */ 429 uri: string; 430 431 /** 432 * Indicates filter criteria. 433 * 434 * @type { Record<string, number | string | boolean> } 435 * @syscap SystemCapability.Notification.ReminderAgent 436 * @systemapi Hide this for inner system use. 437 * @since 11 438 */ 439 equalTo: Record<string, number | string | boolean>; 440 441 /** 442 * Indicates the data to update. This parameter can be null. 443 * 444 * @type { ValuesBucket } 445 * @syscap SystemCapability.Notification.ReminderAgent 446 * @systemapi Hide this for inner system use. 447 * @since 11 448 */ 449 value: ValuesBucket; 450 } 451 452 /** 453 * Max screen want agent information. 454 * 455 * @interface MaxScreenWantAgent 456 * @syscap SystemCapability.Notification.ReminderAgent 457 * @since 9 458 */ 459 interface MaxScreenWantAgent { 460 /** 461 * Name of the package that is automatically started when the reminder arrives and the device is not in use. 462 * 463 * @type { string } 464 * @syscap SystemCapability.Notification.ReminderAgent 465 * @since 9 466 */ 467 pkgName: string; 468 469 /** 470 * Name of the ability that is automatically started when the reminder arrives and the device is not in use. 471 * 472 * @type { string } 473 * @syscap SystemCapability.Notification.ReminderAgent 474 * @since 9 475 */ 476 abilityName: string; 477 } 478 479 /** 480 * Declares ring channel. 481 * 482 * @enum { number } 483 * 484 * @syscap SystemCapability.Notification.ReminderAgent 485 * @since 20 486 */ 487 export enum RingChannel { 488 /** 489 * Ring channel alarm. 490 * 491 * @syscap SystemCapability.Notification.ReminderAgent 492 * @since 20 493 */ 494 RING_CHANNEL_ALARM = 0, 495 496 /** 497 * Ring channel alarm. 498 * 499 * @syscap SystemCapability.Notification.ReminderAgent 500 * @since 20 501 */ 502 RING_CHANNEL_MEDIA = 1, 503 } 504 505 /** 506 * Reminder Common information. 507 * 508 * @interface ReminderRequest 509 * @syscap SystemCapability.Notification.ReminderAgent 510 * @since 9 511 */ 512 interface ReminderRequest { 513 /** 514 * Type of the reminder. 515 * 516 * @type { ReminderType } 517 * @syscap SystemCapability.Notification.ReminderAgent 518 * @since 9 519 */ 520 reminderType: ReminderType; 521 522 /** 523 * Action button displayed on the reminder notification. 524 * (The parameter is optional. Up to two buttons are supported). 525 * 526 * @syscap SystemCapability.Notification.ReminderAgent 527 * @since 9 528 */ 529 /** 530 * Action button displayed on the reminder notification. 531 * (The parameter is optional. Up to three buttons are supported). 532 * 533 * @type { ?[ActionButton?, ActionButton?, ActionButton?] } 534 * @syscap SystemCapability.Notification.ReminderAgent 535 * @since 10 536 */ 537 actionButton?: [ActionButton?, ActionButton?, ActionButton?]; 538 539 /** 540 * Information about the ability that is redirected to when the notification is clicked. 541 * 542 * @type { ?WantAgent } 543 * @syscap SystemCapability.Notification.ReminderAgent 544 * @since 9 545 */ 546 wantAgent?: WantAgent; 547 548 /** 549 * Information about the ability that is automatically started when the reminder arrives. 550 * If the device is in use, a notification will be displayed. 551 * 552 * @type { ?MaxScreenWantAgent } 553 * @syscap SystemCapability.Notification.ReminderAgent 554 * @since 9 555 */ 556 maxScreenWantAgent?: MaxScreenWantAgent; 557 558 /** 559 * Ringing duration. 560 * 561 * @type { ?number } 562 * @syscap SystemCapability.Notification.ReminderAgent 563 * @since 9 564 */ 565 ringDuration?: number; 566 567 /** 568 * Type of the ring channel. 569 * 570 * @type { ?RingChannel } 571 * @syscap SystemCapability.Notification.ReminderAgent 572 * @since 20 573 */ 574 ringChannel?: RingChannel; 575 576 /** 577 * Number of reminder snooze times. 578 * 579 * @type { ?number } 580 * @syscap SystemCapability.Notification.ReminderAgent 581 * @since 9 582 */ 583 snoozeTimes?: number; 584 585 /** 586 * Reminder snooze interval. 587 * 588 * @type { ?number } 589 * @syscap SystemCapability.Notification.ReminderAgent 590 * @since 9 591 */ 592 timeInterval?: number; 593 594 /** 595 * Reminder title. 596 * 597 * @type { ?string } 598 * @syscap SystemCapability.Notification.ReminderAgent 599 * @since 9 600 */ 601 title?: string; 602 603 /** 604 * Resource ID for title. 605 * 606 * @type { ?number } 607 * @syscap SystemCapability.Notification.ReminderAgent 608 * @since 18 609 */ 610 titleResourceId?: number; 611 612 /** 613 * Reminder content. 614 * 615 * @type { ?string } 616 * @syscap SystemCapability.Notification.ReminderAgent 617 * @since 9 618 */ 619 content?: string; 620 621 /** 622 * Resource ID for content. 623 * 624 * @type { ?number } 625 * @syscap SystemCapability.Notification.ReminderAgent 626 * @since 18 627 */ 628 contentResourceId?: number; 629 630 /** 631 * Content to be displayed when the reminder is expired. 632 * 633 * @type { ?string } 634 * @syscap SystemCapability.Notification.ReminderAgent 635 * @since 9 636 */ 637 expiredContent?: string; 638 639 /** 640 * Resource ID for expired content. 641 * 642 * @type { ?number } 643 * @syscap SystemCapability.Notification.ReminderAgent 644 * @since 18 645 */ 646 expiredContentResourceId?: number; 647 648 /** 649 * Content to be displayed when the reminder is snoozing. 650 * 651 * @type { ?string } 652 * @syscap SystemCapability.Notification.ReminderAgent 653 * @since 9 654 */ 655 snoozeContent?: string; 656 657 /** 658 * Resource ID for snooze content. 659 * 660 * @type { ?number } 661 * @syscap SystemCapability.Notification.ReminderAgent 662 * @since 18 663 */ 664 snoozeContentResourceId?: number; 665 666 /** 667 * Notification id. If there are reminders with the same ID, the later one will overwrite the earlier one. 668 * 669 * @type { ?number } 670 * @syscap SystemCapability.Notification.ReminderAgent 671 * @since 9 672 */ 673 notificationId?: number; 674 675 /** 676 * If the same group ID is set for reminders, these reminders are canceled together. 677 * 678 * @type { ?string } 679 * @syscap SystemCapability.Notification.ReminderAgent 680 * @since 11 681 */ 682 groupId?: string; 683 684 /** 685 * Type of the slot used by the reminder. 686 * 687 * @type { ?notification.SlotType } 688 * @syscap SystemCapability.Notification.ReminderAgent 689 * @since 9 690 */ 691 slotType?: notification.SlotType; 692 693 /** 694 * Whether the notification is automatically cleared. 695 * 696 * @type { ?boolean } 697 * @syscap SystemCapability.Notification.ReminderAgent 698 * @since 10 699 */ 700 tapDismissed?: boolean; 701 702 /** 703 * Time when the notification is automatically cleared. 704 * 705 * @type { ?number } 706 * @syscap SystemCapability.Notification.ReminderAgent 707 * @since 10 708 */ 709 autoDeletedTime?: number; 710 711 /** 712 * Type of the snoozeSlot used by the reminder. 713 * 714 * @type { ?notification.SlotType } 715 * @syscap SystemCapability.Notification.ReminderAgent 716 * @since 11 717 */ 718 snoozeSlotType?: notification.SlotType; 719 720 /** 721 * The directory of storing reminder announcements. 722 * 723 * @type { ?string } 724 * @syscap SystemCapability.Notification.ReminderAgent 725 * @since 11 726 */ 727 customRingUri?: string; 728 } 729 730 /** 731 * Calendar reminder information. 732 * 733 * @extends ReminderRequest 734 * @typedef ReminderRequestCalendar 735 * @syscap SystemCapability.Notification.ReminderAgent 736 * @since 9 737 */ 738 interface ReminderRequestCalendar extends ReminderRequest { 739 /** 740 * Reminder time. 741 * 742 * @type { LocalDateTime } 743 * @syscap SystemCapability.Notification.ReminderAgent 744 * @since 9 745 */ 746 dateTime: LocalDateTime; 747 748 /** 749 * Month in which the reminder repeats. 750 * 751 * @type { ?Array<number> } 752 * @syscap SystemCapability.Notification.ReminderAgent 753 * @since 9 754 */ 755 repeatMonths?: Array<number>; 756 757 /** 758 * Date on which the reminder repeats. 759 * 760 * @type { ?Array<number> } 761 * @syscap SystemCapability.Notification.ReminderAgent 762 * @since 9 763 */ 764 repeatDays?: Array<number>; 765 766 /** 767 * Days of a week when the reminder repeats. 768 * 769 * @type { ?Array<number> } 770 * @syscap SystemCapability.Notification.ReminderAgent 771 * @since 11 772 */ 773 daysOfWeek?: Array<number>; 774 775 /** 776 * calendar end date time 777 * 778 * @type { ?LocalDateTime } 779 * @syscap SystemCapability.Notification.ReminderAgent 780 * @since 12 781 */ 782 endDateTime?: LocalDateTime; 783 784 /** 785 * For custom repeat calendar(RRule), the service extension will pull up when 786 * param set and the notification arrived. 787 * 788 * @type { ?WantAgent } 789 * @syscap SystemCapability.Notification.ReminderAgent 790 * @systemapi Hide this for inner system use. 791 * @since 12 792 */ 793 rruleWantAgent?: WantAgent; 794 } 795 796 /** 797 * Alarm reminder information. 798 * 799 * @extends ReminderRequest 800 * @typedef ReminderRequestAlarm 801 * @syscap SystemCapability.Notification.ReminderAgent 802 * @since 9 803 */ 804 interface ReminderRequestAlarm extends ReminderRequest { 805 /** 806 * Hour portion of the reminder time. 807 * 808 * @type { number } 809 * @syscap SystemCapability.Notification.ReminderAgent 810 * @since 9 811 */ 812 hour: number; 813 814 /** 815 * Minute portion of the reminder time. 816 * 817 * @type { number } 818 * @syscap SystemCapability.Notification.ReminderAgent 819 * @since 9 820 */ 821 minute: number; 822 823 /** 824 * Days of a week when the reminder repeats. 825 * 826 * @type { ?Array<number> } 827 * @syscap SystemCapability.Notification.ReminderAgent 828 * @since 9 829 */ 830 daysOfWeek?: Array<number>; 831 } 832 833 /** 834 * CountDown reminder information. 835 * 836 * @extends ReminderRequest 837 * @typedef ReminderRequestTimer 838 * @syscap SystemCapability.Notification.ReminderAgent 839 * @since 9 840 */ 841 interface ReminderRequestTimer extends ReminderRequest { 842 /** 843 * The number of seconds to count down. 844 * 845 * @type { number } 846 * @syscap SystemCapability.Notification.ReminderAgent 847 * @since 9 848 */ 849 triggerTimeInSeconds: number; 850 } 851 852 /** 853 * Reminder information, include reminderId. 854 * 855 * @interface ReminderInfo 856 * @syscap SystemCapability.Notification.ReminderAgent 857 * @since 12 858 */ 859 interface ReminderInfo { 860 /** 861 * Reminder id. 862 * 863 * @type { number } 864 * @syscap SystemCapability.Notification.ReminderAgent 865 * @since 12 866 */ 867 reminderId: number; 868 869 /** 870 * Reminder request. 871 * 872 * @type { ReminderRequest } 873 * @syscap SystemCapability.Notification.ReminderAgent 874 * @since 12 875 */ 876 reminderReq: ReminderRequest; 877 } 878 879 /** 880 * Used for ReminderRequestCalendar when set the time. 881 * 882 * @interface LocalDateTime 883 * @syscap SystemCapability.Notification.ReminderAgent 884 * @since 9 885 */ 886 interface LocalDateTime { 887 /** 888 * Value of year. 889 * 890 * @type { number } 891 * @syscap SystemCapability.Notification.ReminderAgent 892 * @since 9 893 */ 894 year: number; 895 896 /** 897 * Value of month. 898 * 899 * @type { number } 900 * @syscap SystemCapability.Notification.ReminderAgent 901 * @since 9 902 */ 903 month: number; 904 905 /** 906 * Value of day. 907 * 908 * @type { number } 909 * @syscap SystemCapability.Notification.ReminderAgent 910 * @since 9 911 */ 912 day: number; 913 914 /** 915 * Value of hour. 916 * 917 * @type { number } 918 * @syscap SystemCapability.Notification.ReminderAgent 919 * @since 9 920 */ 921 hour: number; 922 923 /** 924 * Value of minute. 925 * 926 * @type { number } 927 * @syscap SystemCapability.Notification.ReminderAgent 928 * @since 9 929 */ 930 minute: number; 931 932 /** 933 * Value of second. 934 * 935 * @type { ?number } 936 * @syscap SystemCapability.Notification.ReminderAgent 937 * @since 9 938 */ 939 second?: number; 940 } 941} 942export default reminderAgentManager; 943