diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index b93b0ba93a7869bbc205b75d2230524c3661c3c4..4722d4e126c824a03d2c91da8e7f77e394dfddbb 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -62,6 +62,21 @@ declare namespace notification { function publish(request: NotificationRequest, userId: number, callback: AsyncCallback): void; function publish(request: NotificationRequest, userId: number): Promise; + /** + * Publishes a representative notification. + * + * @since 9 + * @param request a notification. + * @param representativeBundle bundle name of the representative + * @param userId userid of the representative + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @permission ohos.permission.NOTIFICATION_AGENT_CONTROLLER + * + */ + function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number, callback: AsyncCallback): void; + function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise; + /** * Cancels a notification with the specified ID. * @@ -80,6 +95,20 @@ declare namespace notification { function cancel(id: number, label: string, callback: AsyncCallback): void; function cancel(id: number, label?: string): Promise; + /** + * Cancels a representative notification. + * + * @since 9 + * @param id ID of the notification to cancel, which must be unique in the application. + * @param representativeBundle bundle name of the representative + * @param userId userid of the representative + * @param callback callback function + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @permission ohos.permission.NOTIFICATION_AGENT_CONTROLLER + */ + function cancelAsBundle(id: number, representativeBundle: string, userId: number, callback: AsyncCallback): void; + function cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise; + /** * Cancels all notifications of the current application. */ @@ -679,6 +708,26 @@ declare namespace notification { function getDeviceRemindType(callback: AsyncCallback): void; function getDeviceRemindType(): Promise; + /** + * Set whether the application slot is enabled. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean, callback: AsyncCallback): void; + function enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean): Promise; + + /** + * Obtains whether the application slot is enabled. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback): void; + function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise; + /** * Describes a BundleOption. */ diff --git a/api/notification/notificationSlot.d.ts b/api/notification/notificationSlot.d.ts index a41d522ee00c2ff331513429fcb825e2fecab548..3f23d07f0b4d3092132a04472ebb67559db243a2 100644 --- a/api/notification/notificationSlot.d.ts +++ b/api/notification/notificationSlot.d.ts @@ -78,4 +78,11 @@ export interface NotificationSlot { * Obtains the vibration style of notifications in this notification slot. */ vibrationValues?: Array; + + /** + * Read-only enabled status in this notification slot. + * + * @since 9 + */ + readonly enabled?: boolean; }