diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index c24a7a258edb2b7d88ac7454abbe095270b6d098..34512b83aa0f6d81a77153fcdc678e26ca288d17 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -49,6 +49,16 @@ declare namespace notification { function publish(request: NotificationRequest, callback: AsyncCallback): void; function publish(request: NotificationRequest): Promise; + /** + * Publishes a notification to the specified user. + * + * @param Publishes a notification. + * @param userId of the subscriber receiving the notification + * + */ + function publish(request: NotificationRequest, userId: number, callback: AsyncCallback): void; + function publish(request: NotificationRequest, userId: number): Promise; + /** * Cancels a notification with the specified ID. * @@ -328,6 +338,14 @@ declare namespace notification { */ function isNotificationEnabled(callback: AsyncCallback): void; + /** + * isNotificationEnabled + * + * @systemapi Hide this for inner system use. + */ + function isNotificationEnabled(userId: number, callback: AsyncCallback): void; + function isNotificationEnabled(userId: number): Promise; + /** * isNotificationEnabled * @@ -457,6 +475,15 @@ declare namespace notification { */ function removeAll(callback: AsyncCallback): void; + /** + * removeAll + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function removeAll(userId: number, callback: AsyncCallback): void; + function removeAll(userId: number): Promise; + /** * removeAll * @@ -523,6 +550,16 @@ declare namespace notification { function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback): void; function setDoNotDisturbDate(date: DoNotDisturbDate): Promise; + /** + * Set the Do Not Disturb date. + * + * @since 8 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallback): void; + function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise; + /** * Obtains the Do Not Disturb date. * @@ -533,6 +570,16 @@ declare namespace notification { function getDoNotDisturbDate(callback: AsyncCallback): void; function getDoNotDisturbDate(): Promise; + /** + * Obtains the Do Not Disturb date. + * + * @since 8 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function getDoNotDisturbDate(userId: number, callback: AsyncCallback): void; + function getDoNotDisturbDate(userId: number): Promise; + /** * Obtains whether to support the Do Not Disturb mode. * diff --git a/api/notification/notificationRequest.d.ts b/api/notification/notificationRequest.d.ts index 669a492e34c68711c4299849667f51a044b3c8ae..f2a09360a8b2a0a9d68a1648a564339c6a8ca0b2 100644 --- a/api/notification/notificationRequest.d.ts +++ b/api/notification/notificationRequest.d.ts @@ -20,6 +20,27 @@ import { NotificationContent } from './notificationContent'; import { NotificationActionButton } from './notificationActionButton'; import { NotificationTemplate } from './notificationTemplate'; +/** + * Describes a NotificationTemplate instance. + * + * @name NotificationTemplate + * @since 8 + * @devices phone, tablet, tv, wearable, car + * @permission N/A + * @sysCap SystemCapability.Notification.ANS + */ +export interface NotificationFlags { + /** + * Whether to enable sound reminder. + */ + readonly soundEnabled?: boolean; + + /** + * Whether to enable vibration reminder. + */ + readonly vibrationEnabled?: boolean; +} + /** * Defines a NotificationRequest instance. * @@ -162,6 +183,11 @@ export interface NotificationRequest { */ readonly creatorPid?: number; + /** + * Read-only UserId of the notification creator. + */ + readonly creatorUserId?: number; + /** * Obtains the classification of this notification. * @@ -197,4 +223,11 @@ export interface NotificationRequest { * @since 8 */ template?: NotificationTemplate; + + /** + * Obtains the set of identifiers for the notification. + * + * @since 8 + */ + readonly notificationFlags?: NotificationFlags; }