161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"), 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ciimport { AsyncCallback } from './@ohos.base'; 1761847f8eSopenharmony_ciimport { NotificationActionButton } from './notification/notificationActionButton'; 1861847f8eSopenharmony_ciimport { NotificationBasicContent } from './notification/notificationContent'; 1961847f8eSopenharmony_ciimport { NotificationContent } from './notification/notificationContent'; 2061847f8eSopenharmony_ciimport { NotificationLongTextContent } from './notification/notificationContent'; 2161847f8eSopenharmony_ciimport { NotificationMultiLineContent } from './notification/notificationContent'; 2261847f8eSopenharmony_ciimport { NotificationPictureContent } from './notification/notificationContent'; 2361847f8eSopenharmony_ciimport { NotificationFlags } from './notification/notificationFlags'; 2461847f8eSopenharmony_ciimport { NotificationFlagStatus } from './notification/notificationFlags'; 2561847f8eSopenharmony_ciimport { NotificationRequest } from './notification/notificationRequest'; 2661847f8eSopenharmony_ciimport { DistributedOptions } from './notification/notificationRequest'; 2761847f8eSopenharmony_ciimport { NotificationSlot } from './notification/notificationSlot'; 2861847f8eSopenharmony_ciimport { NotificationSorting } from './notification/notificationSorting'; 2961847f8eSopenharmony_ciimport { NotificationSubscribeInfo } from './notification/notificationSubscribeInfo'; 3061847f8eSopenharmony_ciimport { NotificationSubscriber } from './notification/notificationSubscriber'; 3161847f8eSopenharmony_ciimport { SubscribeCallbackData } from './notification/notificationSubscriber'; 3261847f8eSopenharmony_ciimport { EnabledNotificationCallbackData } from './notification/notificationSubscriber'; 3361847f8eSopenharmony_ciimport { NotificationTemplate } from './notification/notificationTemplate'; 3461847f8eSopenharmony_ciimport { NotificationUserInput } from './notification/notificationUserInput'; 3561847f8eSopenharmony_ci 3661847f8eSopenharmony_ci/** 3761847f8eSopenharmony_ci * Manages notifications. 3861847f8eSopenharmony_ci * <p>Generally, only system applications have permissions on notification subscription and unsubscribe. 3961847f8eSopenharmony_ci * You can specify the content of a notification to be published and the content is carried by 4061847f8eSopenharmony_ci * {@link NotificationRequest}. A notification ID is unique in an application and must be specified 4161847f8eSopenharmony_ci * when using {@link NotificationRequest} to carry the notification content. If a notification 4261847f8eSopenharmony_ci * with this ID has been published and you need to use this ID to publish another notification, 4361847f8eSopenharmony_ci * the original notification will be updated. In addition, the notification ID can be used to cancel 4461847f8eSopenharmony_ci * a notification by calling the {@link #cancel(int)} method. 4561847f8eSopenharmony_ci * 4661847f8eSopenharmony_ci * @namespace notification 4761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 4861847f8eSopenharmony_ci * @since 7 4961847f8eSopenharmony_ci * @deprecated since 9 5061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager and ohos.notificationSubscribe/notificationSubscribe 5161847f8eSopenharmony_ci */ 5261847f8eSopenharmony_cideclare namespace notification { 5361847f8eSopenharmony_ci /** 5461847f8eSopenharmony_ci * Publishes a notification. 5561847f8eSopenharmony_ci * <p>If a notification with the same ID has been published by the current application and has not been deleted, 5661847f8eSopenharmony_ci * this method will update the notification. 5761847f8eSopenharmony_ci * 5861847f8eSopenharmony_ci * @param { NotificationRequest } request - notification request 5961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback function 6061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 6161847f8eSopenharmony_ci * @since 7 6261847f8eSopenharmony_ci * @deprecated since 9 6361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#publish 6461847f8eSopenharmony_ci */ 6561847f8eSopenharmony_ci function publish(request: NotificationRequest, callback: AsyncCallback<void>): void; 6661847f8eSopenharmony_ci 6761847f8eSopenharmony_ci /** 6861847f8eSopenharmony_ci * Publishes a notification. 6961847f8eSopenharmony_ci * <p>If a notification with the same ID has been published by the current application and has not been deleted, 7061847f8eSopenharmony_ci * this method will update the notification. 7161847f8eSopenharmony_ci * 7261847f8eSopenharmony_ci * @param { NotificationRequest } request - notification request 7361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 7461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 7561847f8eSopenharmony_ci * @since 7 7661847f8eSopenharmony_ci * @deprecated since 9 7761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#publish 7861847f8eSopenharmony_ci */ 7961847f8eSopenharmony_ci function publish(request: NotificationRequest): Promise<void>; 8061847f8eSopenharmony_ci 8161847f8eSopenharmony_ci /** 8261847f8eSopenharmony_ci * Publishes a notification to the specified user. 8361847f8eSopenharmony_ci * 8461847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 8561847f8eSopenharmony_ci * @param { NotificationRequest } request - Publishes a notification. 8661847f8eSopenharmony_ci * @param { number } userId - of subscriber receiving the notification 8761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Callback method for publishing notifications. 8861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 8961847f8eSopenharmony_ci * @systemapi 9061847f8eSopenharmony_ci * @since 8 9161847f8eSopenharmony_ci * @deprecated since 9 9261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#publish 9361847f8eSopenharmony_ci */ 9461847f8eSopenharmony_ci function publish(request: NotificationRequest, userId: number, callback: AsyncCallback<void>): void; 9561847f8eSopenharmony_ci 9661847f8eSopenharmony_ci /** 9761847f8eSopenharmony_ci * Publishes a notification to the specified user. 9861847f8eSopenharmony_ci * 9961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 10061847f8eSopenharmony_ci * @param { NotificationRequest } request - Publishes a notification. 10161847f8eSopenharmony_ci * @param { number } userId - of subscriber receiving the notification 10261847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 10361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 10461847f8eSopenharmony_ci * @systemapi 10561847f8eSopenharmony_ci * @since 8 10661847f8eSopenharmony_ci * @deprecated since 9 10761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#publish 10861847f8eSopenharmony_ci */ 10961847f8eSopenharmony_ci function publish(request: NotificationRequest, userId: number): Promise<void>; 11061847f8eSopenharmony_ci 11161847f8eSopenharmony_ci /** 11261847f8eSopenharmony_ci * Cancel a notification with the specified ID. 11361847f8eSopenharmony_ci * 11461847f8eSopenharmony_ci * @param { number } id - of the notification to cancel, which must be unique in the application. 11561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback function 11661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 11761847f8eSopenharmony_ci * @since 7 11861847f8eSopenharmony_ci * @deprecated since 9 11961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#cancel 12061847f8eSopenharmony_ci */ 12161847f8eSopenharmony_ci function cancel(id: number, callback: AsyncCallback<void>): void; 12261847f8eSopenharmony_ci 12361847f8eSopenharmony_ci /** 12461847f8eSopenharmony_ci * Cancel a notification with the specified label and ID. 12561847f8eSopenharmony_ci * 12661847f8eSopenharmony_ci * @param { number } id - ID of the notification to cancel, which must be unique in the application. 12761847f8eSopenharmony_ci * @param { string } label - Label of the notification to cancel. 12861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback function 12961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 13061847f8eSopenharmony_ci * @since 7 13161847f8eSopenharmony_ci * @deprecated since 9 13261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#cancel 13361847f8eSopenharmony_ci */ 13461847f8eSopenharmony_ci function cancel(id: number, label: string, callback: AsyncCallback<void>): void; 13561847f8eSopenharmony_ci 13661847f8eSopenharmony_ci /** 13761847f8eSopenharmony_ci * Cancel a notification with the specified label and ID. 13861847f8eSopenharmony_ci * 13961847f8eSopenharmony_ci * @param { number } id - ID of the notification to cancel, which must be unique in the application. 14061847f8eSopenharmony_ci * @param { string } [label] - Label of the notification to cancel. 14161847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 14261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 14361847f8eSopenharmony_ci * @since 7 14461847f8eSopenharmony_ci * @deprecated since 9 14561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#cancel 14661847f8eSopenharmony_ci */ 14761847f8eSopenharmony_ci function cancel(id: number, label?: string): Promise<void>; 14861847f8eSopenharmony_ci 14961847f8eSopenharmony_ci /** 15061847f8eSopenharmony_ci * Cancels all notifications of the current application. 15161847f8eSopenharmony_ci * 15261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - The specified callback method. 15361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 15461847f8eSopenharmony_ci * @since 7 15561847f8eSopenharmony_ci * @deprecated since 9 15661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#cancelAll 15761847f8eSopenharmony_ci */ 15861847f8eSopenharmony_ci function cancelAll(callback: AsyncCallback<void>): void; 15961847f8eSopenharmony_ci 16061847f8eSopenharmony_ci /** 16161847f8eSopenharmony_ci * Cancels all notifications of the current application. 16261847f8eSopenharmony_ci * 16361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 16461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 16561847f8eSopenharmony_ci * @since 7 16661847f8eSopenharmony_ci * @deprecated since 9 16761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#cancelAll 16861847f8eSopenharmony_ci */ 16961847f8eSopenharmony_ci function cancelAll(): Promise<void>; 17061847f8eSopenharmony_ci 17161847f8eSopenharmony_ci /** 17261847f8eSopenharmony_ci * Creates a notification slot. 17361847f8eSopenharmony_ci * 17461847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 17561847f8eSopenharmony_ci * @param { NotificationSlot } slot - Indicates the notification slot to be created, which is set by 17661847f8eSopenharmony_ci * {@link NotificationSlot}.This parameter must be specified. 17761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback function 17861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 17961847f8eSopenharmony_ci * @systemapi 18061847f8eSopenharmony_ci * @since 7 18161847f8eSopenharmony_ci * @deprecated since 9 18261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#addSlot 18361847f8eSopenharmony_ci */ 18461847f8eSopenharmony_ci function addSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; 18561847f8eSopenharmony_ci 18661847f8eSopenharmony_ci /** 18761847f8eSopenharmony_ci * Creates a notification slot. 18861847f8eSopenharmony_ci * 18961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 19061847f8eSopenharmony_ci * @param { NotificationSlot } slot - Indicates the notification slot to be created, which is set by 19161847f8eSopenharmony_ci * {@link NotificationSlot}.This parameter must be specified. 19261847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 19361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 19461847f8eSopenharmony_ci * @systemapi 19561847f8eSopenharmony_ci * @since 7 19661847f8eSopenharmony_ci * @deprecated since 9 19761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#addSlot 19861847f8eSopenharmony_ci */ 19961847f8eSopenharmony_ci function addSlot(slot: NotificationSlot): Promise<void>; 20061847f8eSopenharmony_ci 20161847f8eSopenharmony_ci /** 20261847f8eSopenharmony_ci * Adds a slot type. 20361847f8eSopenharmony_ci * 20461847f8eSopenharmony_ci * @param { SlotType } type - Slot type to add. 20561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback function 20661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 20761847f8eSopenharmony_ci * @since 7 20861847f8eSopenharmony_ci * @deprecated since 9 20961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#addSlot 21061847f8eSopenharmony_ci */ 21161847f8eSopenharmony_ci function addSlot(type: SlotType, callback: AsyncCallback<void>): void; 21261847f8eSopenharmony_ci 21361847f8eSopenharmony_ci /** 21461847f8eSopenharmony_ci * Adds a slot type. 21561847f8eSopenharmony_ci * 21661847f8eSopenharmony_ci * @param { SlotType } type - Slot type to add. 21761847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 21861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 21961847f8eSopenharmony_ci * @since 7 22061847f8eSopenharmony_ci * @deprecated since 9 22161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#addSlot 22261847f8eSopenharmony_ci */ 22361847f8eSopenharmony_ci function addSlot(type: SlotType): Promise<void>; 22461847f8eSopenharmony_ci 22561847f8eSopenharmony_ci /** 22661847f8eSopenharmony_ci * Creates a notification slot. 22761847f8eSopenharmony_ci * 22861847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 22961847f8eSopenharmony_ci * @param { Array<NotificationSlot> } slots - Indicates the notification slots to be created, which is set by 23061847f8eSopenharmony_ci * {@link NotificationSlot}.This parameter must be specified. 23161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback function 23261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 23361847f8eSopenharmony_ci * @systemapi 23461847f8eSopenharmony_ci * @since 7 23561847f8eSopenharmony_ci * @deprecated since 9 23661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#addSlots 23761847f8eSopenharmony_ci */ 23861847f8eSopenharmony_ci function addSlots(slots: Array<NotificationSlot>, callback: AsyncCallback<void>): void; 23961847f8eSopenharmony_ci 24061847f8eSopenharmony_ci /** 24161847f8eSopenharmony_ci * Creates a notification slot. 24261847f8eSopenharmony_ci * 24361847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 24461847f8eSopenharmony_ci * @param { Array<NotificationSlot> } slots - Indicates the notification slots to be created, which is set by 24561847f8eSopenharmony_ci * {@link NotificationSlot}.This parameter must be specified. 24661847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 24761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 24861847f8eSopenharmony_ci * @systemapi 24961847f8eSopenharmony_ci * @since 7 25061847f8eSopenharmony_ci * @deprecated since 9 25161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#addSlots 25261847f8eSopenharmony_ci */ 25361847f8eSopenharmony_ci function addSlots(slots: Array<NotificationSlot>): Promise<void>; 25461847f8eSopenharmony_ci 25561847f8eSopenharmony_ci /** 25661847f8eSopenharmony_ci * Obtains a notification slot of the specified slot type. 25761847f8eSopenharmony_ci * 25861847f8eSopenharmony_ci * @param { SlotType } slotType - Type of the notification slot to obtain. 25961847f8eSopenharmony_ci * @param { AsyncCallback<NotificationSlot> } callback - callback function 26061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 26161847f8eSopenharmony_ci * @since 7 26261847f8eSopenharmony_ci * @deprecated since 9 26361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getSlot 26461847f8eSopenharmony_ci */ 26561847f8eSopenharmony_ci function getSlot(slotType: SlotType, callback: AsyncCallback<NotificationSlot>): void; 26661847f8eSopenharmony_ci 26761847f8eSopenharmony_ci /** 26861847f8eSopenharmony_ci * Obtains a notification slot of the specified slot type. 26961847f8eSopenharmony_ci * 27061847f8eSopenharmony_ci * @param { SlotType } slotType - Type of the notification slot to obtain. 27161847f8eSopenharmony_ci * @returns { Promise<NotificationSlot> } Returns the created {@link NotificationSlot}. 27261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 27361847f8eSopenharmony_ci * @since 7 27461847f8eSopenharmony_ci * @deprecated since 9 27561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getSlot 27661847f8eSopenharmony_ci */ 27761847f8eSopenharmony_ci function getSlot(slotType: SlotType): Promise<NotificationSlot>; 27861847f8eSopenharmony_ci 27961847f8eSopenharmony_ci /** 28061847f8eSopenharmony_ci * Obtains all NotificationSlot objects created by the current application. 28161847f8eSopenharmony_ci * 28261847f8eSopenharmony_ci * @param { AsyncCallback<Array<NotificationSlot>> } callback - Returns the result of obtaining all notification 28361847f8eSopenharmony_ci * channels for this application in the form of callback. 28461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 28561847f8eSopenharmony_ci * @since 7 28661847f8eSopenharmony_ci * @deprecated since 9 28761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getSlots 28861847f8eSopenharmony_ci */ 28961847f8eSopenharmony_ci function getSlots(callback: AsyncCallback<Array<NotificationSlot>>): void; 29061847f8eSopenharmony_ci 29161847f8eSopenharmony_ci /** 29261847f8eSopenharmony_ci * Obtains all NotificationSlot objects created by the current application. 29361847f8eSopenharmony_ci * 29461847f8eSopenharmony_ci * @returns { Promise<Array<NotificationSlot>> } Returns all notification slots of this application. 29561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 29661847f8eSopenharmony_ci * @since 7 29761847f8eSopenharmony_ci * @deprecated since 9 29861847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getSlots 29961847f8eSopenharmony_ci */ 30061847f8eSopenharmony_ci function getSlots(): Promise<Array<NotificationSlot>>; 30161847f8eSopenharmony_ci 30261847f8eSopenharmony_ci /** 30361847f8eSopenharmony_ci * Removes a NotificationSlot of the specified SlotType created by the current application. 30461847f8eSopenharmony_ci * 30561847f8eSopenharmony_ci * @param { SlotType } slotType - Type of the NotificationSlot to remove. 30661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - callback function 30761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 30861847f8eSopenharmony_ci * @since 7 30961847f8eSopenharmony_ci * @deprecated since 9 31061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#removeSlot 31161847f8eSopenharmony_ci */ 31261847f8eSopenharmony_ci function removeSlot(slotType: SlotType, callback: AsyncCallback<void>): void; 31361847f8eSopenharmony_ci 31461847f8eSopenharmony_ci /** 31561847f8eSopenharmony_ci * Removes a NotificationSlot of the specified SlotType created by the current application. 31661847f8eSopenharmony_ci * 31761847f8eSopenharmony_ci * @param { SlotType } slotType - The types of notification channels are currently divided into social communication, 31861847f8eSopenharmony_ci * service reminders, content consulting, and other types 31961847f8eSopenharmony_ci * @returns { Promise<void> } Returns all notification slots of this application. 32061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 32161847f8eSopenharmony_ci * @since 7 32261847f8eSopenharmony_ci * @deprecated since 9 32361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#removeSlot 32461847f8eSopenharmony_ci */ 32561847f8eSopenharmony_ci function removeSlot(slotType: SlotType): Promise<void>; 32661847f8eSopenharmony_ci 32761847f8eSopenharmony_ci /** 32861847f8eSopenharmony_ci * Removes all NotificationSlot objects created by the current application. 32961847f8eSopenharmony_ci * 33061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Represents the specified callback method. 33161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 33261847f8eSopenharmony_ci * @since 7 33361847f8eSopenharmony_ci * @deprecated since 9 33461847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#removeAllSlots 33561847f8eSopenharmony_ci */ 33661847f8eSopenharmony_ci function removeAllSlots(callback: AsyncCallback<void>): void; 33761847f8eSopenharmony_ci 33861847f8eSopenharmony_ci /** 33961847f8eSopenharmony_ci * Removes all NotificationSlot objects created by the current application. 34061847f8eSopenharmony_ci * 34161847f8eSopenharmony_ci * @returns { Promise<void> } Returns all notification slots of this application. 34261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 34361847f8eSopenharmony_ci * @since 7 34461847f8eSopenharmony_ci * @deprecated since 9 34561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#removeAllSlots 34661847f8eSopenharmony_ci */ 34761847f8eSopenharmony_ci function removeAllSlots(): Promise<void>; 34861847f8eSopenharmony_ci 34961847f8eSopenharmony_ci /** 35061847f8eSopenharmony_ci * Describes NotificationSlot types. 35161847f8eSopenharmony_ci * 35261847f8eSopenharmony_ci * @enum { number } 35361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 35461847f8eSopenharmony_ci * @since 7 35561847f8eSopenharmony_ci * @deprecated since 9 35661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#SlotType 35761847f8eSopenharmony_ci */ 35861847f8eSopenharmony_ci export enum SlotType { 35961847f8eSopenharmony_ci /** 36061847f8eSopenharmony_ci * NotificationSlot of an unknown type. 36161847f8eSopenharmony_ci * 36261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 36361847f8eSopenharmony_ci * @since 7 36461847f8eSopenharmony_ci * @deprecated since 9 36561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotType#UNKNOWN_TYPE 36661847f8eSopenharmony_ci */ 36761847f8eSopenharmony_ci UNKNOWN_TYPE = 0, 36861847f8eSopenharmony_ci 36961847f8eSopenharmony_ci /** 37061847f8eSopenharmony_ci * NotificationSlot for social communication. 37161847f8eSopenharmony_ci * 37261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 37361847f8eSopenharmony_ci * @since 7 37461847f8eSopenharmony_ci * @deprecated since 9 37561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotType#SOCIAL_COMMUNICATION 37661847f8eSopenharmony_ci */ 37761847f8eSopenharmony_ci SOCIAL_COMMUNICATION = 1, 37861847f8eSopenharmony_ci 37961847f8eSopenharmony_ci /** 38061847f8eSopenharmony_ci * NotificationSlot for service information. 38161847f8eSopenharmony_ci * 38261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 38361847f8eSopenharmony_ci * @since 7 38461847f8eSopenharmony_ci * @deprecated since 9 38561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotType#SERVICE_INFORMATION 38661847f8eSopenharmony_ci */ 38761847f8eSopenharmony_ci SERVICE_INFORMATION = 2, 38861847f8eSopenharmony_ci 38961847f8eSopenharmony_ci /** 39061847f8eSopenharmony_ci * NotificationSlot for content information. 39161847f8eSopenharmony_ci * 39261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 39361847f8eSopenharmony_ci * @since 7 39461847f8eSopenharmony_ci * @deprecated since 9 39561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotType#CONTENT_INFORMATION 39661847f8eSopenharmony_ci */ 39761847f8eSopenharmony_ci CONTENT_INFORMATION = 3, 39861847f8eSopenharmony_ci 39961847f8eSopenharmony_ci /** 40061847f8eSopenharmony_ci * NotificationSlot for other purposes. 40161847f8eSopenharmony_ci * 40261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 40361847f8eSopenharmony_ci * @since 7 40461847f8eSopenharmony_ci * @deprecated since 9 40561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotType#OTHER_TYPES 40661847f8eSopenharmony_ci */ 40761847f8eSopenharmony_ci OTHER_TYPES = 0xFFFF 40861847f8eSopenharmony_ci } 40961847f8eSopenharmony_ci 41061847f8eSopenharmony_ci /** 41161847f8eSopenharmony_ci * Describes notification content types. 41261847f8eSopenharmony_ci * 41361847f8eSopenharmony_ci * @enum { string } 41461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 41561847f8eSopenharmony_ci * @since 7 41661847f8eSopenharmony_ci * @deprecated since 9 41761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotType#ContentType 41861847f8eSopenharmony_ci */ 41961847f8eSopenharmony_ci export enum ContentType { 42061847f8eSopenharmony_ci /** 42161847f8eSopenharmony_ci * Normal text notification. 42261847f8eSopenharmony_ci * 42361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 42461847f8eSopenharmony_ci * @since 7 42561847f8eSopenharmony_ci * @deprecated since 9 42661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.ContentType#NOTIFICATION_CONTENT_BASIC_TEXT 42761847f8eSopenharmony_ci */ 42861847f8eSopenharmony_ci NOTIFICATION_CONTENT_BASIC_TEXT, 42961847f8eSopenharmony_ci 43061847f8eSopenharmony_ci /** 43161847f8eSopenharmony_ci * Long text notification. 43261847f8eSopenharmony_ci * 43361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 43461847f8eSopenharmony_ci * @since 7 43561847f8eSopenharmony_ci * @deprecated since 9 43661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.ContentType#NOTIFICATION_CONTENT_LONG_TEXT 43761847f8eSopenharmony_ci */ 43861847f8eSopenharmony_ci NOTIFICATION_CONTENT_LONG_TEXT, 43961847f8eSopenharmony_ci 44061847f8eSopenharmony_ci /** 44161847f8eSopenharmony_ci * Picture-attached notification. 44261847f8eSopenharmony_ci * 44361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 44461847f8eSopenharmony_ci * @since 7 44561847f8eSopenharmony_ci * @deprecated since 9 44661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.ContentType#NOTIFICATION_CONTENT_PICTURE 44761847f8eSopenharmony_ci */ 44861847f8eSopenharmony_ci NOTIFICATION_CONTENT_PICTURE, 44961847f8eSopenharmony_ci 45061847f8eSopenharmony_ci /** 45161847f8eSopenharmony_ci * Conversation notification. 45261847f8eSopenharmony_ci * 45361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 45461847f8eSopenharmony_ci * @since 7 45561847f8eSopenharmony_ci * @deprecated since 9 45661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.ContentType#NOTIFICATION_CONTENT_CONVERSATION 45761847f8eSopenharmony_ci */ 45861847f8eSopenharmony_ci NOTIFICATION_CONTENT_CONVERSATION, 45961847f8eSopenharmony_ci 46061847f8eSopenharmony_ci /** 46161847f8eSopenharmony_ci * Multi-line text notification. 46261847f8eSopenharmony_ci * 46361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 46461847f8eSopenharmony_ci * @since 7 46561847f8eSopenharmony_ci * @deprecated since 9 46661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.ContentType#NOTIFICATION_CONTENT_MULTILINE 46761847f8eSopenharmony_ci */ 46861847f8eSopenharmony_ci NOTIFICATION_CONTENT_MULTILINE 46961847f8eSopenharmony_ci } 47061847f8eSopenharmony_ci 47161847f8eSopenharmony_ci /** 47261847f8eSopenharmony_ci * Indicates the level of the slot 47361847f8eSopenharmony_ci * 47461847f8eSopenharmony_ci * @enum { number } 47561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 47661847f8eSopenharmony_ci * @since 7 47761847f8eSopenharmony_ci * @deprecated since 9 47861847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#SlotLevel 47961847f8eSopenharmony_ci */ 48061847f8eSopenharmony_ci export enum SlotLevel { 48161847f8eSopenharmony_ci /** 48261847f8eSopenharmony_ci * Indicates that the notification function is disabled. 48361847f8eSopenharmony_ci * 48461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 48561847f8eSopenharmony_ci * @since 7 48661847f8eSopenharmony_ci * @deprecated since 9 48761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotLevel#LEVEL_NONE 48861847f8eSopenharmony_ci */ 48961847f8eSopenharmony_ci LEVEL_NONE = 0, 49061847f8eSopenharmony_ci 49161847f8eSopenharmony_ci /** 49261847f8eSopenharmony_ci * Indicates that the notification function is enabled but notification 49361847f8eSopenharmony_ci * icons are not displayed in the status bar, with no banner or prompt tone. 49461847f8eSopenharmony_ci * 49561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 49661847f8eSopenharmony_ci * @since 7 49761847f8eSopenharmony_ci * @deprecated since 9 49861847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotLevel#LEVEL_MIN 49961847f8eSopenharmony_ci */ 50061847f8eSopenharmony_ci LEVEL_MIN = 1, 50161847f8eSopenharmony_ci 50261847f8eSopenharmony_ci /** 50361847f8eSopenharmony_ci * Indicates that the notification function is enabled and notification 50461847f8eSopenharmony_ci * icons are displayed in the status bar, with no banner or prompt tone. 50561847f8eSopenharmony_ci * 50661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 50761847f8eSopenharmony_ci * @since 7 50861847f8eSopenharmony_ci * @deprecated since 9 50961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotLevel#LEVEL_LOW 51061847f8eSopenharmony_ci */ 51161847f8eSopenharmony_ci LEVEL_LOW = 2, 51261847f8eSopenharmony_ci 51361847f8eSopenharmony_ci /** 51461847f8eSopenharmony_ci * Indicates that the notification function is enabled and notification 51561847f8eSopenharmony_ci * icons are displayed in the status bar, with no banner but with a prompt tone. 51661847f8eSopenharmony_ci * 51761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 51861847f8eSopenharmony_ci * @since 7 51961847f8eSopenharmony_ci * @deprecated since 9 52061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotLevel#LEVEL_DEFAULT 52161847f8eSopenharmony_ci */ 52261847f8eSopenharmony_ci LEVEL_DEFAULT = 3, 52361847f8eSopenharmony_ci 52461847f8eSopenharmony_ci /** 52561847f8eSopenharmony_ci * Indicates that the notification function is enabled and notification 52661847f8eSopenharmony_ci * icons are displayed in the status bar, with a banner and a prompt tone. 52761847f8eSopenharmony_ci * 52861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 52961847f8eSopenharmony_ci * @since 7 53061847f8eSopenharmony_ci * @deprecated since 9 53161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SlotLevel#LEVEL_HIGH 53261847f8eSopenharmony_ci */ 53361847f8eSopenharmony_ci LEVEL_HIGH = 4 53461847f8eSopenharmony_ci } 53561847f8eSopenharmony_ci 53661847f8eSopenharmony_ci /** 53761847f8eSopenharmony_ci * subscribe 53861847f8eSopenharmony_ci * 53961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 54061847f8eSopenharmony_ci * @param { NotificationSubscriber } subscriber - Notification subscription object. 54161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Subscription action callback parameters. 54261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 54361847f8eSopenharmony_ci * @systemapi 54461847f8eSopenharmony_ci * @since 7 54561847f8eSopenharmony_ci * @deprecated since 9 54661847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#subscribe 54761847f8eSopenharmony_ci */ 54861847f8eSopenharmony_ci function subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback<void>): void; 54961847f8eSopenharmony_ci 55061847f8eSopenharmony_ci /** 55161847f8eSopenharmony_ci * subscribe 55261847f8eSopenharmony_ci * 55361847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 55461847f8eSopenharmony_ci * @param { NotificationSubscriber } subscriber - Notification subscription object. 55561847f8eSopenharmony_ci * @param { NotificationSubscribeInfo } info - Notification subscription information. 55661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Subscription Action Callback Function. 55761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 55861847f8eSopenharmony_ci * @systemapi 55961847f8eSopenharmony_ci * @since 7 56061847f8eSopenharmony_ci * @deprecated since 9 56161847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#subscribe 56261847f8eSopenharmony_ci */ 56361847f8eSopenharmony_ci function subscribe( 56461847f8eSopenharmony_ci subscriber: NotificationSubscriber, 56561847f8eSopenharmony_ci info: NotificationSubscribeInfo, 56661847f8eSopenharmony_ci callback: AsyncCallback<void> 56761847f8eSopenharmony_ci ): void; 56861847f8eSopenharmony_ci 56961847f8eSopenharmony_ci /** 57061847f8eSopenharmony_ci * subscribe 57161847f8eSopenharmony_ci * 57261847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 57361847f8eSopenharmony_ci * @param { NotificationSubscriber } subscriber - Notification subscription object. 57461847f8eSopenharmony_ci * @param { NotificationSubscribeInfo } [info] - Notification subscription information. 57561847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 57661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 57761847f8eSopenharmony_ci * @systemapi 57861847f8eSopenharmony_ci * @since 7 57961847f8eSopenharmony_ci * @deprecated since 9 58061847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#subscribe 58161847f8eSopenharmony_ci */ 58261847f8eSopenharmony_ci function subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise<void>; 58361847f8eSopenharmony_ci 58461847f8eSopenharmony_ci /** 58561847f8eSopenharmony_ci * unsubscribe 58661847f8eSopenharmony_ci * 58761847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 58861847f8eSopenharmony_ci * @param { NotificationSubscriber } subscriber - Notification subscription object. 58961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Unsubscribe Action Callback Function. 59061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 59161847f8eSopenharmony_ci * @systemapi 59261847f8eSopenharmony_ci * @since 7 59361847f8eSopenharmony_ci * @deprecated since 9 59461847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#unsubscribe 59561847f8eSopenharmony_ci */ 59661847f8eSopenharmony_ci function unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback<void>): void; 59761847f8eSopenharmony_ci 59861847f8eSopenharmony_ci /** 59961847f8eSopenharmony_ci * unsubscribe 60061847f8eSopenharmony_ci * 60161847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 60261847f8eSopenharmony_ci * @param { NotificationSubscriber } subscriber - Subscription action callback parameters. 60361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 60461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 60561847f8eSopenharmony_ci * @systemapi 60661847f8eSopenharmony_ci * @since 7 60761847f8eSopenharmony_ci * @deprecated since 9 60861847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#unsubscribe 60961847f8eSopenharmony_ci */ 61061847f8eSopenharmony_ci function unsubscribe(subscriber: NotificationSubscriber): Promise<void>; 61161847f8eSopenharmony_ci 61261847f8eSopenharmony_ci /** 61361847f8eSopenharmony_ci * enableNotification 61461847f8eSopenharmony_ci * 61561847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 61661847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 61761847f8eSopenharmony_ci * @param { boolean } enable - Enabling state. 61861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Set notification enable callback function. 61961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 62061847f8eSopenharmony_ci * @systemapi 62161847f8eSopenharmony_ci * @since 7 62261847f8eSopenharmony_ci * @deprecated since 9 62361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setNotificationEnable 62461847f8eSopenharmony_ci */ 62561847f8eSopenharmony_ci function enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 62661847f8eSopenharmony_ci 62761847f8eSopenharmony_ci /** 62861847f8eSopenharmony_ci * enableNotification 62961847f8eSopenharmony_ci * 63061847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 63161847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 63261847f8eSopenharmony_ci * @param { boolean } enable - Enabling state. 63361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 63461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 63561847f8eSopenharmony_ci * @systemapi 63661847f8eSopenharmony_ci * @since 7 63761847f8eSopenharmony_ci * @deprecated since 9 63861847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setNotificationEnable 63961847f8eSopenharmony_ci */ 64061847f8eSopenharmony_ci function enableNotification(bundle: BundleOption, enable: boolean): Promise<void>; 64161847f8eSopenharmony_ci 64261847f8eSopenharmony_ci /** 64361847f8eSopenharmony_ci * isNotificationEnabled 64461847f8eSopenharmony_ci * 64561847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 64661847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 64761847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Get notification enable callback function. 64861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 64961847f8eSopenharmony_ci * @systemapi 65061847f8eSopenharmony_ci * @since 7 65161847f8eSopenharmony_ci * @deprecated since 9 65261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isNotificationEnabled 65361847f8eSopenharmony_ci */ 65461847f8eSopenharmony_ci function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 65561847f8eSopenharmony_ci 65661847f8eSopenharmony_ci /** 65761847f8eSopenharmony_ci * isNotificationEnabled 65861847f8eSopenharmony_ci * 65961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 66061847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 66161847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the result of obtaining notification enable status in the form of Promise. 66261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 66361847f8eSopenharmony_ci * @systemapi 66461847f8eSopenharmony_ci * @since 7 66561847f8eSopenharmony_ci * @deprecated since 9 66661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isNotificationEnabled 66761847f8eSopenharmony_ci */ 66861847f8eSopenharmony_ci function isNotificationEnabled(bundle: BundleOption): Promise<boolean>; 66961847f8eSopenharmony_ci 67061847f8eSopenharmony_ci /** 67161847f8eSopenharmony_ci * isNotificationEnabled 67261847f8eSopenharmony_ci * 67361847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 67461847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Get notification enable callback function. 67561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 67661847f8eSopenharmony_ci * @systemapi 67761847f8eSopenharmony_ci * @since 7 67861847f8eSopenharmony_ci * @deprecated since 9 67961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isNotificationEnabled 68061847f8eSopenharmony_ci */ 68161847f8eSopenharmony_ci function isNotificationEnabled(callback: AsyncCallback<boolean>): void; 68261847f8eSopenharmony_ci 68361847f8eSopenharmony_ci /** 68461847f8eSopenharmony_ci * isNotificationEnabled 68561847f8eSopenharmony_ci * 68661847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 68761847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the result of obtaining notification enable status in the form of Promise. 68861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 68961847f8eSopenharmony_ci * @systemapi 69061847f8eSopenharmony_ci * @since 7 69161847f8eSopenharmony_ci * @deprecated since 9 69261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isNotificationEnabled 69361847f8eSopenharmony_ci */ 69461847f8eSopenharmony_ci function isNotificationEnabled(): Promise<boolean>; 69561847f8eSopenharmony_ci 69661847f8eSopenharmony_ci /** 69761847f8eSopenharmony_ci * Checks whether this application has permission to publish notifications under the user. 69861847f8eSopenharmony_ci * 69961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 70061847f8eSopenharmony_ci * @param { number } userId - userId 70161847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Get notification enable callback function. 70261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 70361847f8eSopenharmony_ci * @systemapi 70461847f8eSopenharmony_ci * @since 8 70561847f8eSopenharmony_ci * @deprecated since 9 70661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isNotificationEnabled 70761847f8eSopenharmony_ci */ 70861847f8eSopenharmony_ci function isNotificationEnabled(userId: number, callback: AsyncCallback<boolean>): void; 70961847f8eSopenharmony_ci 71061847f8eSopenharmony_ci /** 71161847f8eSopenharmony_ci * Checks whether this application has permission to publish notifications under the user. 71261847f8eSopenharmony_ci * 71361847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 71461847f8eSopenharmony_ci * @param { number } userId - userId 71561847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the result of obtaining notification enable status in the form of Promise. 71661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 71761847f8eSopenharmony_ci * @systemapi 71861847f8eSopenharmony_ci * @since 8 71961847f8eSopenharmony_ci * @deprecated since 9 72061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isNotificationEnabled 72161847f8eSopenharmony_ci */ 72261847f8eSopenharmony_ci function isNotificationEnabled(userId: number): Promise<boolean>; 72361847f8eSopenharmony_ci 72461847f8eSopenharmony_ci /** 72561847f8eSopenharmony_ci * displayBadge 72661847f8eSopenharmony_ci * 72761847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 72861847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 72961847f8eSopenharmony_ci * @param { boolean } enable - Enabling state. 73061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Set the corner marker enable callback function. 73161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 73261847f8eSopenharmony_ci * @systemapi 73361847f8eSopenharmony_ci * @since 7 73461847f8eSopenharmony_ci * @deprecated since 9 73561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#displayBadge 73661847f8eSopenharmony_ci */ 73761847f8eSopenharmony_ci function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 73861847f8eSopenharmony_ci 73961847f8eSopenharmony_ci /** 74061847f8eSopenharmony_ci * displayBadge 74161847f8eSopenharmony_ci * 74261847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 74361847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 74461847f8eSopenharmony_ci * @param { boolean } enable - Enabling state. 74561847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 74661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 74761847f8eSopenharmony_ci * @systemapi 74861847f8eSopenharmony_ci * @since 7 74961847f8eSopenharmony_ci * @deprecated since 9 75061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#displayBadge 75161847f8eSopenharmony_ci */ 75261847f8eSopenharmony_ci function displayBadge(bundle: BundleOption, enable: boolean): Promise<void>; 75361847f8eSopenharmony_ci 75461847f8eSopenharmony_ci /** 75561847f8eSopenharmony_ci * isBadgeDisplayed 75661847f8eSopenharmony_ci * 75761847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 75861847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 75961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Set the corner marker enable callback function. 76061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 76161847f8eSopenharmony_ci * @systemapi 76261847f8eSopenharmony_ci * @since 7 76361847f8eSopenharmony_ci * @deprecated since 9 76461847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isBadgeDisplayed 76561847f8eSopenharmony_ci */ 76661847f8eSopenharmony_ci function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 76761847f8eSopenharmony_ci 76861847f8eSopenharmony_ci /** 76961847f8eSopenharmony_ci * isBadgeDisplayed 77061847f8eSopenharmony_ci * 77161847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 77261847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 77361847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the result of obtaining notification enable status in the form of Promise. 77461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 77561847f8eSopenharmony_ci * @systemapi 77661847f8eSopenharmony_ci * @since 7 77761847f8eSopenharmony_ci * @deprecated since 9 77861847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isBadgeDisplayed 77961847f8eSopenharmony_ci */ 78061847f8eSopenharmony_ci function isBadgeDisplayed(bundle: BundleOption): Promise<boolean>; 78161847f8eSopenharmony_ci 78261847f8eSopenharmony_ci /** 78361847f8eSopenharmony_ci * setSlotByBundle 78461847f8eSopenharmony_ci * 78561847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 78661847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 78761847f8eSopenharmony_ci * @param { NotificationSlot } slot - Notification channel. 78861847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Set notification channel callback function. 78961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 79061847f8eSopenharmony_ci * @systemapi 79161847f8eSopenharmony_ci * @since 7 79261847f8eSopenharmony_ci * @deprecated since 9 79361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setSlotByBundle 79461847f8eSopenharmony_ci */ 79561847f8eSopenharmony_ci function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback<void>): void; 79661847f8eSopenharmony_ci 79761847f8eSopenharmony_ci /** 79861847f8eSopenharmony_ci * setSlotByBundle 79961847f8eSopenharmony_ci * 80061847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 80161847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 80261847f8eSopenharmony_ci * @param { NotificationSlot } slot - Notification channel. 80361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 80461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 80561847f8eSopenharmony_ci * @systemapi 80661847f8eSopenharmony_ci * @since 7 80761847f8eSopenharmony_ci * @deprecated since 9 80861847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setSlotByBundle 80961847f8eSopenharmony_ci */ 81061847f8eSopenharmony_ci function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise<void>; 81161847f8eSopenharmony_ci 81261847f8eSopenharmony_ci /** 81361847f8eSopenharmony_ci * getSlotsByBundle 81461847f8eSopenharmony_ci * 81561847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 81661847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 81761847f8eSopenharmony_ci * @param { AsyncCallback<Array<NotificationSlot>> } callback - Set the corner marker enable callback function. 81861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 81961847f8eSopenharmony_ci * @systemapi 82061847f8eSopenharmony_ci * @since 7 82161847f8eSopenharmony_ci * @deprecated since 9 82261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getSlotsByBundle 82361847f8eSopenharmony_ci */ 82461847f8eSopenharmony_ci function getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array<NotificationSlot>>): void; 82561847f8eSopenharmony_ci 82661847f8eSopenharmony_ci /** 82761847f8eSopenharmony_ci * getSlotsByBundle 82861847f8eSopenharmony_ci * 82961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 83061847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 83161847f8eSopenharmony_ci * @returns { Promise<Array<NotificationSlot>> } Returns the notification channel of the specified application in 83261847f8eSopenharmony_ci * the form of a promise. 83361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 83461847f8eSopenharmony_ci * @systemapi 83561847f8eSopenharmony_ci * @since 7 83661847f8eSopenharmony_ci * @deprecated since 9 83761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getSlotsByBundle 83861847f8eSopenharmony_ci */ 83961847f8eSopenharmony_ci function getSlotsByBundle(bundle: BundleOption): Promise<Array<NotificationSlot>>; 84061847f8eSopenharmony_ci 84161847f8eSopenharmony_ci /** 84261847f8eSopenharmony_ci * getSlotNumByBundle 84361847f8eSopenharmony_ci * 84461847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 84561847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 84661847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - Set the corner marker enable callback function. 84761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 84861847f8eSopenharmony_ci * @systemapi 84961847f8eSopenharmony_ci * @since 7 85061847f8eSopenharmony_ci * @deprecated since 9 85161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getSlotNumByBundle 85261847f8eSopenharmony_ci */ 85361847f8eSopenharmony_ci function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback<number>): void; 85461847f8eSopenharmony_ci 85561847f8eSopenharmony_ci /** 85661847f8eSopenharmony_ci * getSlotNumByBundle 85761847f8eSopenharmony_ci * 85861847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 85961847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 86061847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of notification channels for the specified application 86161847f8eSopenharmony_ci * in the form of Promise. 86261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 86361847f8eSopenharmony_ci * @systemapi 86461847f8eSopenharmony_ci * @since 7 86561847f8eSopenharmony_ci * @deprecated since 9 86661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getSlotNumByBundle 86761847f8eSopenharmony_ci */ 86861847f8eSopenharmony_ci function getSlotNumByBundle(bundle: BundleOption): Promise<number>; 86961847f8eSopenharmony_ci 87061847f8eSopenharmony_ci /** 87161847f8eSopenharmony_ci * remove 87261847f8eSopenharmony_ci * 87361847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 87461847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 87561847f8eSopenharmony_ci * @param { NotificationKey } notificationKey - Notification Key Value 87661847f8eSopenharmony_ci * @param { RemoveReason } reason - Reason for notification deletion. 87761847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Delete the specified notification callback function. 87861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 87961847f8eSopenharmony_ci * @systemapi 88061847f8eSopenharmony_ci * @since 7 88161847f8eSopenharmony_ci * @deprecated since 9 88261847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#remove 88361847f8eSopenharmony_ci */ 88461847f8eSopenharmony_ci function remove( 88561847f8eSopenharmony_ci bundle: BundleOption, 88661847f8eSopenharmony_ci notificationKey: NotificationKey, 88761847f8eSopenharmony_ci reason: RemoveReason, 88861847f8eSopenharmony_ci callback: AsyncCallback<void> 88961847f8eSopenharmony_ci ): void; 89061847f8eSopenharmony_ci 89161847f8eSopenharmony_ci /** 89261847f8eSopenharmony_ci * remove 89361847f8eSopenharmony_ci * 89461847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 89561847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 89661847f8eSopenharmony_ci * @param { NotificationKey } notificationKey - Notification Key Value 89761847f8eSopenharmony_ci * @param { RemoveReason } reason - Reason for notification deletion. 89861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 89961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 90061847f8eSopenharmony_ci * @systemapi 90161847f8eSopenharmony_ci * @since 7 90261847f8eSopenharmony_ci * @deprecated since 9 90361847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#remove 90461847f8eSopenharmony_ci */ 90561847f8eSopenharmony_ci function remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason): Promise<void>; 90661847f8eSopenharmony_ci 90761847f8eSopenharmony_ci /** 90861847f8eSopenharmony_ci * remove 90961847f8eSopenharmony_ci * 91061847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 91161847f8eSopenharmony_ci * @param { string } hashCode - The unique ID of the notification can be obtained through the input parameter 91261847f8eSopenharmony_ci * SubscribeCallbackData of the onConsumer callback to obtain the hashCode in its internal NotificationRequest object 91361847f8eSopenharmony_ci * @param { RemoveReason } reason - Reason for notification deletion. 91461847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Delete the specified notification callback function. 91561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 91661847f8eSopenharmony_ci * @systemapi 91761847f8eSopenharmony_ci * @since 7 91861847f8eSopenharmony_ci * @deprecated since 9 91961847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#remove 92061847f8eSopenharmony_ci */ 92161847f8eSopenharmony_ci function remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback<void>): void; 92261847f8eSopenharmony_ci 92361847f8eSopenharmony_ci /** 92461847f8eSopenharmony_ci * remove 92561847f8eSopenharmony_ci * 92661847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 92761847f8eSopenharmony_ci * @param { string } hashCode - Notification unique ID. 92861847f8eSopenharmony_ci * @param { RemoveReason } reason - Reason for notification deletion. 92961847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 93061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 93161847f8eSopenharmony_ci * @systemapi 93261847f8eSopenharmony_ci * @since 7 93361847f8eSopenharmony_ci * @deprecated since 9 93461847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#remove 93561847f8eSopenharmony_ci */ 93661847f8eSopenharmony_ci function remove(hashCode: string, reason: RemoveReason): Promise<void>; 93761847f8eSopenharmony_ci 93861847f8eSopenharmony_ci /** 93961847f8eSopenharmony_ci * removeAll 94061847f8eSopenharmony_ci * 94161847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 94261847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 94361847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Delete the specified notification callback function. 94461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 94561847f8eSopenharmony_ci * @systemapi 94661847f8eSopenharmony_ci * @since 7 94761847f8eSopenharmony_ci * @deprecated since 9 94861847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#removeAll 94961847f8eSopenharmony_ci */ 95061847f8eSopenharmony_ci function removeAll(bundle: BundleOption, callback: AsyncCallback<void>): void; 95161847f8eSopenharmony_ci 95261847f8eSopenharmony_ci /** 95361847f8eSopenharmony_ci * removeAll 95461847f8eSopenharmony_ci * 95561847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 95661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Delete the specified notification callback function. 95761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 95861847f8eSopenharmony_ci * @systemapi 95961847f8eSopenharmony_ci * @since 7 96061847f8eSopenharmony_ci * @deprecated since 9 96161847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#removeAll 96261847f8eSopenharmony_ci */ 96361847f8eSopenharmony_ci function removeAll(callback: AsyncCallback<void>): void; 96461847f8eSopenharmony_ci 96561847f8eSopenharmony_ci /** 96661847f8eSopenharmony_ci * Remove all notifications under the specified user. 96761847f8eSopenharmony_ci * 96861847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 96961847f8eSopenharmony_ci * @param { number } userId - userId 97061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Delete the specified notification callback function. 97161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 97261847f8eSopenharmony_ci * @systemapi 97361847f8eSopenharmony_ci * @since 8 97461847f8eSopenharmony_ci * @deprecated since 9 97561847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#removeAll 97661847f8eSopenharmony_ci */ 97761847f8eSopenharmony_ci function removeAll(userId: number, callback: AsyncCallback<void>): void; 97861847f8eSopenharmony_ci 97961847f8eSopenharmony_ci /** 98061847f8eSopenharmony_ci * Remove all notifications under the specified user. 98161847f8eSopenharmony_ci * 98261847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 98361847f8eSopenharmony_ci * @param { number } userId - userId 98461847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 98561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 98661847f8eSopenharmony_ci * @systemapi 98761847f8eSopenharmony_ci * @since 8 98861847f8eSopenharmony_ci * @deprecated since 9 98961847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#removeAll 99061847f8eSopenharmony_ci */ 99161847f8eSopenharmony_ci function removeAll(userId: number): Promise<void>; 99261847f8eSopenharmony_ci 99361847f8eSopenharmony_ci /** 99461847f8eSopenharmony_ci * removeAll 99561847f8eSopenharmony_ci * 99661847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 99761847f8eSopenharmony_ci * @param { BundleOption } [bundle] - Specify the package information for the application. 99861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 99961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 100061847f8eSopenharmony_ci * @systemapi 100161847f8eSopenharmony_ci * @since 7 100261847f8eSopenharmony_ci * @deprecated since 9 100361847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#removeAll 100461847f8eSopenharmony_ci */ 100561847f8eSopenharmony_ci function removeAll(bundle?: BundleOption): Promise<void>; 100661847f8eSopenharmony_ci 100761847f8eSopenharmony_ci /** 100861847f8eSopenharmony_ci * Obtains all active notifications in the current system. The caller must have system permissions to 100961847f8eSopenharmony_ci * call this method. 101061847f8eSopenharmony_ci * 101161847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 101261847f8eSopenharmony_ci * @param { AsyncCallback<Array<NotificationRequest>> } callback - Gets the activity notification callback function. 101361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 101461847f8eSopenharmony_ci * @systemapi 101561847f8eSopenharmony_ci * @since 7 101661847f8eSopenharmony_ci * @deprecated since 9 101761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getAllActiveNotifications 101861847f8eSopenharmony_ci */ 101961847f8eSopenharmony_ci function getAllActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 102061847f8eSopenharmony_ci 102161847f8eSopenharmony_ci /** 102261847f8eSopenharmony_ci * Obtains all active notifications in the current system. The caller must have system permissions to 102361847f8eSopenharmony_ci * call this method. 102461847f8eSopenharmony_ci * 102561847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 102661847f8eSopenharmony_ci * @returns { Promise<Array<NotificationRequest>> } Return in the form of Promise to obtain activity notifications. 102761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 102861847f8eSopenharmony_ci * @systemapi 102961847f8eSopenharmony_ci * @since 7 103061847f8eSopenharmony_ci * @deprecated since 9 103161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getAllActiveNotifications 103261847f8eSopenharmony_ci */ 103361847f8eSopenharmony_ci function getAllActiveNotifications(): Promise<Array<NotificationRequest>>; 103461847f8eSopenharmony_ci 103561847f8eSopenharmony_ci /** 103661847f8eSopenharmony_ci * Obtains the number of all active notifications. 103761847f8eSopenharmony_ci * 103861847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - Callback function to obtain the number of undelete notifications. 103961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 104061847f8eSopenharmony_ci * @since 7 104161847f8eSopenharmony_ci * @deprecated since 9 104261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getActiveNotificationCount 104361847f8eSopenharmony_ci */ 104461847f8eSopenharmony_ci function getActiveNotificationCount(callback: AsyncCallback<number>): void; 104561847f8eSopenharmony_ci 104661847f8eSopenharmony_ci /** 104761847f8eSopenharmony_ci * Obtains the number of all active notifications. 104861847f8eSopenharmony_ci * 104961847f8eSopenharmony_ci * @returns { Promise<number> } Returns the number of undelete notifications for the current application as promise. 105061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 105161847f8eSopenharmony_ci * @since 7 105261847f8eSopenharmony_ci * @deprecated since 9 105361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getActiveNotificationCount 105461847f8eSopenharmony_ci */ 105561847f8eSopenharmony_ci function getActiveNotificationCount(): Promise<number>; 105661847f8eSopenharmony_ci 105761847f8eSopenharmony_ci /** 105861847f8eSopenharmony_ci * Obtains an array of active notifications. 105961847f8eSopenharmony_ci * 106061847f8eSopenharmony_ci * @param { AsyncCallback<Array<NotificationRequest>> } callback - Retrieve the callback function for the current 106161847f8eSopenharmony_ci * application notification list. 106261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 106361847f8eSopenharmony_ci * @since 7 106461847f8eSopenharmony_ci * @deprecated since 9 106561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getActiveNotifications 106661847f8eSopenharmony_ci */ 106761847f8eSopenharmony_ci function getActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 106861847f8eSopenharmony_ci 106961847f8eSopenharmony_ci /** 107061847f8eSopenharmony_ci * Obtains an array of active notifications. 107161847f8eSopenharmony_ci * 107261847f8eSopenharmony_ci * @returns { Promise<Array<NotificationRequest>> } Return to obtain the current application in the form of Promise. 107361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 107461847f8eSopenharmony_ci * @since 7 107561847f8eSopenharmony_ci * @deprecated since 9 107661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getActiveNotifications 107761847f8eSopenharmony_ci */ 107861847f8eSopenharmony_ci function getActiveNotifications(): Promise<Array<NotificationRequest>>; 107961847f8eSopenharmony_ci 108061847f8eSopenharmony_ci /** 108161847f8eSopenharmony_ci * Cancel the notification of a specified group for this application. 108261847f8eSopenharmony_ci * 108361847f8eSopenharmony_ci * @param { string } groupName - Notification group name, which needs to be specified through the NotificationRequest 108461847f8eSopenharmony_ci * object when publishing notifications. 108561847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Cancel the callback function for notifications under the specified group 108661847f8eSopenharmony_ci * of this application. 108761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 108861847f8eSopenharmony_ci * @since 8 108961847f8eSopenharmony_ci * @deprecated since 9 109061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#cancelGroup 109161847f8eSopenharmony_ci */ 109261847f8eSopenharmony_ci function cancelGroup(groupName: string, callback: AsyncCallback<void>): void; 109361847f8eSopenharmony_ci 109461847f8eSopenharmony_ci /** 109561847f8eSopenharmony_ci * Cancel the notification of a specified group for this application. 109661847f8eSopenharmony_ci * 109761847f8eSopenharmony_ci * @param { string } groupName - Notification group name. 109861847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 109961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 110061847f8eSopenharmony_ci * @since 8 110161847f8eSopenharmony_ci * @deprecated since 9 110261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#cancelGroup 110361847f8eSopenharmony_ci */ 110461847f8eSopenharmony_ci function cancelGroup(groupName: string): Promise<void>; 110561847f8eSopenharmony_ci 110661847f8eSopenharmony_ci /** 110761847f8eSopenharmony_ci * Delete the notification of a specified group for this application. 110861847f8eSopenharmony_ci * 110961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 111061847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 111161847f8eSopenharmony_ci * @param { string } groupName - Notification group name. 111261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Delete the specified notification callback function. 111361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 111461847f8eSopenharmony_ci * @systemapi 111561847f8eSopenharmony_ci * @since 8 111661847f8eSopenharmony_ci * @deprecated since 9 111761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#removeGroupByBundle 111861847f8eSopenharmony_ci */ 111961847f8eSopenharmony_ci function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback<void>): void; 112061847f8eSopenharmony_ci 112161847f8eSopenharmony_ci /** 112261847f8eSopenharmony_ci * Delete the notification of a specified group for this application. 112361847f8eSopenharmony_ci * 112461847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 112561847f8eSopenharmony_ci * @param { BundleOption } bundle - Specify the package information for the application. 112661847f8eSopenharmony_ci * @param { string } groupName - Notification group name. 112761847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 112861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 112961847f8eSopenharmony_ci * @systemapi 113061847f8eSopenharmony_ci * @since 8 113161847f8eSopenharmony_ci * @deprecated since 9 113261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#removeGroupByBundle 113361847f8eSopenharmony_ci */ 113461847f8eSopenharmony_ci function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise<void>; 113561847f8eSopenharmony_ci 113661847f8eSopenharmony_ci /** 113761847f8eSopenharmony_ci * Set the Do Not Disturb date. 113861847f8eSopenharmony_ci * 113961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 114061847f8eSopenharmony_ci * @param { DoNotDisturbDate } date - Disturbance free time option. 114161847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Set the undisturbed time callback function. 114261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 114361847f8eSopenharmony_ci * @systemapi 114461847f8eSopenharmony_ci * @since 8 114561847f8eSopenharmony_ci * @deprecated since 9 114661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setDoNotDisturbDate 114761847f8eSopenharmony_ci */ 114861847f8eSopenharmony_ci function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback<void>): void; 114961847f8eSopenharmony_ci 115061847f8eSopenharmony_ci /** 115161847f8eSopenharmony_ci * Set the Do Not Disturb date. 115261847f8eSopenharmony_ci * 115361847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 115461847f8eSopenharmony_ci * @param { DoNotDisturbDate } date - Disturbance free time option. 115561847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 115661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 115761847f8eSopenharmony_ci * @systemapi 115861847f8eSopenharmony_ci * @since 8 115961847f8eSopenharmony_ci * @deprecated since 9 116061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setDoNotDisturbDate 116161847f8eSopenharmony_ci */ 116261847f8eSopenharmony_ci function setDoNotDisturbDate(date: DoNotDisturbDate): Promise<void>; 116361847f8eSopenharmony_ci 116461847f8eSopenharmony_ci /** 116561847f8eSopenharmony_ci * Set the Do Not Disturb date under the specified user. 116661847f8eSopenharmony_ci * 116761847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 116861847f8eSopenharmony_ci * @param { DoNotDisturbDate } date - Disturbance free time option. 116961847f8eSopenharmony_ci * @param { number } userId - userId 117061847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Set the undisturbed time callback function 117161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 117261847f8eSopenharmony_ci * @systemapi 117361847f8eSopenharmony_ci * @since 8 117461847f8eSopenharmony_ci * @deprecated since 9 117561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setDoNotDisturbDate 117661847f8eSopenharmony_ci */ 117761847f8eSopenharmony_ci function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallback<void>): void; 117861847f8eSopenharmony_ci 117961847f8eSopenharmony_ci /** 118061847f8eSopenharmony_ci * Set the Do Not Disturb date under the specified user. 118161847f8eSopenharmony_ci * 118261847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 118361847f8eSopenharmony_ci * @param { DoNotDisturbDate } date - Disturbance free time option. 118461847f8eSopenharmony_ci * @param { number } userId - userId 118561847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 118661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 118761847f8eSopenharmony_ci * @systemapi 118861847f8eSopenharmony_ci * @since 8 118961847f8eSopenharmony_ci * @deprecated since 9 119061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setDoNotDisturbDate 119161847f8eSopenharmony_ci */ 119261847f8eSopenharmony_ci function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise<void>; 119361847f8eSopenharmony_ci 119461847f8eSopenharmony_ci /** 119561847f8eSopenharmony_ci * Obtains the Do Not Disturb date. 119661847f8eSopenharmony_ci * 119761847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 119861847f8eSopenharmony_ci * @param { AsyncCallback<DoNotDisturbDate> } callback - Query the undisturbed time callback function. 119961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 120061847f8eSopenharmony_ci * @systemapi 120161847f8eSopenharmony_ci * @since 8 120261847f8eSopenharmony_ci * @deprecated since 9 120361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getDoNotDisturbDate 120461847f8eSopenharmony_ci */ 120561847f8eSopenharmony_ci function getDoNotDisturbDate(callback: AsyncCallback<DoNotDisturbDate>): void; 120661847f8eSopenharmony_ci 120761847f8eSopenharmony_ci /** 120861847f8eSopenharmony_ci * Obtains the Do Not Disturb date. 120961847f8eSopenharmony_ci * 121061847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 121161847f8eSopenharmony_ci * @returns { Promise<DoNotDisturbDate> } Return in the form of Promise to obtain the queried uninterrupted time. 121261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 121361847f8eSopenharmony_ci * @systemapi 121461847f8eSopenharmony_ci * @since 8 121561847f8eSopenharmony_ci * @deprecated since 9 121661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getDoNotDisturbDate 121761847f8eSopenharmony_ci */ 121861847f8eSopenharmony_ci function getDoNotDisturbDate(): Promise<DoNotDisturbDate>; 121961847f8eSopenharmony_ci 122061847f8eSopenharmony_ci /** 122161847f8eSopenharmony_ci * Obtains the Do Not Disturb date. 122261847f8eSopenharmony_ci * 122361847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 122461847f8eSopenharmony_ci * @param { number } userId - userId 122561847f8eSopenharmony_ci * @param { AsyncCallback<DoNotDisturbDate> } callback - Query the undisturbed time callback function. 122661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 122761847f8eSopenharmony_ci * @systemapi 122861847f8eSopenharmony_ci * @since 8 122961847f8eSopenharmony_ci * @deprecated since 9 123061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getDoNotDisturbDate 123161847f8eSopenharmony_ci */ 123261847f8eSopenharmony_ci function getDoNotDisturbDate(userId: number, callback: AsyncCallback<DoNotDisturbDate>): void; 123361847f8eSopenharmony_ci 123461847f8eSopenharmony_ci /** 123561847f8eSopenharmony_ci * Obtains the Do Not Disturb date. 123661847f8eSopenharmony_ci * 123761847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 123861847f8eSopenharmony_ci * @param { number } userId - userId 123961847f8eSopenharmony_ci * @returns { Promise<DoNotDisturbDate> } Return in the form of Promise to obtain the queried uninterrupted time. 124061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 124161847f8eSopenharmony_ci * @systemapi 124261847f8eSopenharmony_ci * @since 8 124361847f8eSopenharmony_ci * @deprecated since 9 124461847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getDoNotDisturbDate 124561847f8eSopenharmony_ci */ 124661847f8eSopenharmony_ci function getDoNotDisturbDate(userId: number): Promise<DoNotDisturbDate>; 124761847f8eSopenharmony_ci 124861847f8eSopenharmony_ci /** 124961847f8eSopenharmony_ci * Obtains whether to support the Do Not Disturb mode. 125061847f8eSopenharmony_ci * 125161847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 125261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Check if callback function for anti-interference function is supported. 125361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 125461847f8eSopenharmony_ci * @systemapi 125561847f8eSopenharmony_ci * @since 8 125661847f8eSopenharmony_ci * @deprecated since 9 125761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isSupportDoNotDisturbMode 125861847f8eSopenharmony_ci */ 125961847f8eSopenharmony_ci function supportDoNotDisturbMode(callback: AsyncCallback<boolean>): void; 126061847f8eSopenharmony_ci 126161847f8eSopenharmony_ci /** 126261847f8eSopenharmony_ci * Obtains whether to support the Do Not Disturb mode. 126361847f8eSopenharmony_ci * 126461847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 126561847f8eSopenharmony_ci * @returns { Promise<boolean> } Return the result in the form of Promise to obtain whether the anti-interference 126661847f8eSopenharmony_ci * function is supported. 126761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 126861847f8eSopenharmony_ci * @systemapi 126961847f8eSopenharmony_ci * @since 8 127061847f8eSopenharmony_ci * @deprecated since 9 127161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isSupportDoNotDisturbMode 127261847f8eSopenharmony_ci */ 127361847f8eSopenharmony_ci function supportDoNotDisturbMode(): Promise<boolean>; 127461847f8eSopenharmony_ci 127561847f8eSopenharmony_ci /** 127661847f8eSopenharmony_ci * Obtains whether the template is supported by the system. 127761847f8eSopenharmony_ci * 127861847f8eSopenharmony_ci * @param { string } templateName - Name of template to be Obtained 127961847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - callback function 128061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 128161847f8eSopenharmony_ci * @since 8 128261847f8eSopenharmony_ci * @deprecated since 9 128361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isSupportTemplate 128461847f8eSopenharmony_ci */ 128561847f8eSopenharmony_ci function isSupportTemplate(templateName: string, callback: AsyncCallback<boolean>): void; 128661847f8eSopenharmony_ci 128761847f8eSopenharmony_ci /** 128861847f8eSopenharmony_ci * Obtains whether the template is supported by the system. 128961847f8eSopenharmony_ci * 129061847f8eSopenharmony_ci * @param { string } templateName - Name of template to be Obtained 129161847f8eSopenharmony_ci * @returns { Promise<boolean> } The Promise method returns the result of whether the template exists. 129261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 129361847f8eSopenharmony_ci * @since 8 129461847f8eSopenharmony_ci * @deprecated since 9 129561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isSupportTemplate 129661847f8eSopenharmony_ci */ 129761847f8eSopenharmony_ci function isSupportTemplate(templateName: string): Promise<boolean>; 129861847f8eSopenharmony_ci 129961847f8eSopenharmony_ci /** 130061847f8eSopenharmony_ci * Request permission to send notification. 130161847f8eSopenharmony_ci * 130261847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Application Request Notification Enable Callback Function. 130361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 130461847f8eSopenharmony_ci * @since 8 130561847f8eSopenharmony_ci * @deprecated since 9 130661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#requestEnableNotification 130761847f8eSopenharmony_ci */ 130861847f8eSopenharmony_ci function requestEnableNotification(callback: AsyncCallback<void>): void; 130961847f8eSopenharmony_ci 131061847f8eSopenharmony_ci /** 131161847f8eSopenharmony_ci * Request permission to send notification. 131261847f8eSopenharmony_ci * 131361847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 131461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 131561847f8eSopenharmony_ci * @since 8 131661847f8eSopenharmony_ci * @deprecated since 9 131761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#requestEnableNotification 131861847f8eSopenharmony_ci */ 131961847f8eSopenharmony_ci function requestEnableNotification(): Promise<void>; 132061847f8eSopenharmony_ci 132161847f8eSopenharmony_ci /** 132261847f8eSopenharmony_ci * Sets whether the device supports distributed notification. 132361847f8eSopenharmony_ci * 132461847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 132561847f8eSopenharmony_ci * @param { boolean } enable - support or not. 132661847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Set whether the device supports callback functions for distributed notifications. 132761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 132861847f8eSopenharmony_ci * @systemapi 132961847f8eSopenharmony_ci * @since 8 133061847f8eSopenharmony_ci * @deprecated since 9 133161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setDistributedEnable 133261847f8eSopenharmony_ci */ 133361847f8eSopenharmony_ci function enableDistributed(enable: boolean, callback: AsyncCallback<void>): void; 133461847f8eSopenharmony_ci 133561847f8eSopenharmony_ci /** 133661847f8eSopenharmony_ci * Sets whether the device supports distributed notification. 133761847f8eSopenharmony_ci * 133861847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 133961847f8eSopenharmony_ci * @param { boolean } enable - support or not. 134061847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 134161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 134261847f8eSopenharmony_ci * @systemapi 134361847f8eSopenharmony_ci * @since 8 134461847f8eSopenharmony_ci * @deprecated since 9 134561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setDistributedEnable 134661847f8eSopenharmony_ci */ 134761847f8eSopenharmony_ci function enableDistributed(enable: boolean): Promise<void>; 134861847f8eSopenharmony_ci 134961847f8eSopenharmony_ci /** 135061847f8eSopenharmony_ci * Obtains whether the device supports distributed notification. 135161847f8eSopenharmony_ci * 135261847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Set whether the device supports callback functions for distributed 135361847f8eSopenharmony_ci * notifications. 135461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 135561847f8eSopenharmony_ci * @since 8 135661847f8eSopenharmony_ci * @deprecated since 9 135761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isDistributedEnabled 135861847f8eSopenharmony_ci */ 135961847f8eSopenharmony_ci function isDistributedEnabled(callback: AsyncCallback<boolean>): void; 136061847f8eSopenharmony_ci 136161847f8eSopenharmony_ci /** 136261847f8eSopenharmony_ci * Obtains whether the device supports distributed notification. 136361847f8eSopenharmony_ci * 136461847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns the result of obtaining whether distributed notifications are supported in 136561847f8eSopenharmony_ci * the form of Promise. 136661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 136761847f8eSopenharmony_ci * @since 8 136861847f8eSopenharmony_ci * @deprecated since 9 136961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isDistributedEnabled 137061847f8eSopenharmony_ci */ 137161847f8eSopenharmony_ci function isDistributedEnabled(): Promise<boolean>; 137261847f8eSopenharmony_ci 137361847f8eSopenharmony_ci /** 137461847f8eSopenharmony_ci * Sets whether an application supports distributed notification. 137561847f8eSopenharmony_ci * 137661847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 137761847f8eSopenharmony_ci * @param { BundleOption } bundle - Package information for the application. 137861847f8eSopenharmony_ci * @param { boolean } enable - support or not. 137961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Does application support callback functions for distributed notifications. 138061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 138161847f8eSopenharmony_ci * @systemapi 138261847f8eSopenharmony_ci * @since 8 138361847f8eSopenharmony_ci * @deprecated since 9 138461847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setDistributedEnableByBundle 138561847f8eSopenharmony_ci */ 138661847f8eSopenharmony_ci function enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 138761847f8eSopenharmony_ci 138861847f8eSopenharmony_ci /** 138961847f8eSopenharmony_ci * Sets whether an application supports distributed notification. 139061847f8eSopenharmony_ci * 139161847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 139261847f8eSopenharmony_ci * @param { BundleOption } bundle - package of application. 139361847f8eSopenharmony_ci * @param { boolean } enable - support or not. 139461847f8eSopenharmony_ci * @returns { Promise<void> } the promise returned by the function. 139561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 139661847f8eSopenharmony_ci * @systemapi 139761847f8eSopenharmony_ci * @since 8 139861847f8eSopenharmony_ci * @deprecated since 9 139961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#setDistributedEnableByBundle 140061847f8eSopenharmony_ci */ 140161847f8eSopenharmony_ci function enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise<void>; 140261847f8eSopenharmony_ci 140361847f8eSopenharmony_ci /** 140461847f8eSopenharmony_ci * Obtains whether an application supports distributed notification. 140561847f8eSopenharmony_ci * 140661847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 140761847f8eSopenharmony_ci * @param { BundleOption } bundle - package of application. 140861847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Query whether callback function for distributed notifications 140961847f8eSopenharmony_ci * is supported. 141061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 141161847f8eSopenharmony_ci * @systemapi 141261847f8eSopenharmony_ci * @since 8 141361847f8eSopenharmony_ci * @deprecated since 9 141461847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isDistributedEnabledByBundle 141561847f8eSopenharmony_ci */ 141661847f8eSopenharmony_ci function isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 141761847f8eSopenharmony_ci 141861847f8eSopenharmony_ci /** 141961847f8eSopenharmony_ci * Obtains whether an application supports distributed notification. 142061847f8eSopenharmony_ci * 142161847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 142261847f8eSopenharmony_ci * @param { BundleOption } bundle - package of application. 142361847f8eSopenharmony_ci * @returns { Promise<boolean> } The Promise method returns the result of whether the specified application supports 142461847f8eSopenharmony_ci * distributed notifications. 142561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 142661847f8eSopenharmony_ci * @systemapi 142761847f8eSopenharmony_ci * @since 8 142861847f8eSopenharmony_ci * @deprecated since 9 142961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#isDistributedEnabledByBundle 143061847f8eSopenharmony_ci */ 143161847f8eSopenharmony_ci function isDistributedEnabledByBundle(bundle: BundleOption): Promise<boolean>; 143261847f8eSopenharmony_ci 143361847f8eSopenharmony_ci /** 143461847f8eSopenharmony_ci * Obtains the remind modes of the notification. 143561847f8eSopenharmony_ci * 143661847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 143761847f8eSopenharmony_ci * @param { AsyncCallback<DeviceRemindType> } callback - Get notification reminder callback function. 143861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 143961847f8eSopenharmony_ci * @systemapi 144061847f8eSopenharmony_ci * @since 8 144161847f8eSopenharmony_ci * @deprecated since 9 144261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getDeviceRemindType 144361847f8eSopenharmony_ci */ 144461847f8eSopenharmony_ci function getDeviceRemindType(callback: AsyncCallback<DeviceRemindType>): void; 144561847f8eSopenharmony_ci 144661847f8eSopenharmony_ci /** 144761847f8eSopenharmony_ci * Obtains the remind modes of the notification. 144861847f8eSopenharmony_ci * 144961847f8eSopenharmony_ci * @permission ohos.permission.NOTIFICATION_CONTROLLER 145061847f8eSopenharmony_ci * @returns { Promise<DeviceRemindType> } The Promise method returns the result of the notification reminder method. 145161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 145261847f8eSopenharmony_ci * @systemapi 145361847f8eSopenharmony_ci * @since 8 145461847f8eSopenharmony_ci * @deprecated since 9 145561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#getDeviceRemindType 145661847f8eSopenharmony_ci */ 145761847f8eSopenharmony_ci function getDeviceRemindType(): Promise<DeviceRemindType>; 145861847f8eSopenharmony_ci 145961847f8eSopenharmony_ci /** 146061847f8eSopenharmony_ci * Describes a BundleOption. 146161847f8eSopenharmony_ci * 146261847f8eSopenharmony_ci * @typedef BundleOption 146361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 146461847f8eSopenharmony_ci * @since 7 146561847f8eSopenharmony_ci * @deprecated since 9 146661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#BundleOption 146761847f8eSopenharmony_ci */ 146861847f8eSopenharmony_ci export interface BundleOption { 146961847f8eSopenharmony_ci /** 147061847f8eSopenharmony_ci * bundle name. 147161847f8eSopenharmony_ci * 147261847f8eSopenharmony_ci * @type { string } 147361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 147461847f8eSopenharmony_ci * @since 7 147561847f8eSopenharmony_ci * @deprecated since 9 147661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#BundleOption 147761847f8eSopenharmony_ci */ 147861847f8eSopenharmony_ci bundle: string; 147961847f8eSopenharmony_ci 148061847f8eSopenharmony_ci /** 148161847f8eSopenharmony_ci * user id. 148261847f8eSopenharmony_ci * 148361847f8eSopenharmony_ci * @type { ?number } 148461847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 148561847f8eSopenharmony_ci * @since 7 148661847f8eSopenharmony_ci * @deprecated since 9 148761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#BundleOption 148861847f8eSopenharmony_ci */ 148961847f8eSopenharmony_ci uid?: number; 149061847f8eSopenharmony_ci } 149161847f8eSopenharmony_ci 149261847f8eSopenharmony_ci /** 149361847f8eSopenharmony_ci * Describes a NotificationKey, which can be used to identify a notification. 149461847f8eSopenharmony_ci * 149561847f8eSopenharmony_ci * @typedef NotificationKey 149661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 149761847f8eSopenharmony_ci * @since 7 149861847f8eSopenharmony_ci * @deprecated since 9 149961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#NotificationKey 150061847f8eSopenharmony_ci */ 150161847f8eSopenharmony_ci export interface NotificationKey { 150261847f8eSopenharmony_ci /** 150361847f8eSopenharmony_ci * Notify ID. 150461847f8eSopenharmony_ci * 150561847f8eSopenharmony_ci * @type { number } 150661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 150761847f8eSopenharmony_ci * @since 7 150861847f8eSopenharmony_ci * @deprecated since 9 150961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#NotificationKey 151061847f8eSopenharmony_ci */ 151161847f8eSopenharmony_ci id: number; 151261847f8eSopenharmony_ci 151361847f8eSopenharmony_ci /** 151461847f8eSopenharmony_ci * Notification label. 151561847f8eSopenharmony_ci * 151661847f8eSopenharmony_ci * @type { ?string } 151761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 151861847f8eSopenharmony_ci * @since 7 151961847f8eSopenharmony_ci * @deprecated since 9 152061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#NotificationKey 152161847f8eSopenharmony_ci */ 152261847f8eSopenharmony_ci label?: string; 152361847f8eSopenharmony_ci } 152461847f8eSopenharmony_ci 152561847f8eSopenharmony_ci /** 152661847f8eSopenharmony_ci * The type of the Do Not Disturb. 152761847f8eSopenharmony_ci * 152861847f8eSopenharmony_ci * @enum { number } 152961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 153061847f8eSopenharmony_ci * @systemapi 153161847f8eSopenharmony_ci * @since 8 153261847f8eSopenharmony_ci * @deprecated since 9 153361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#DoNotDisturbType 153461847f8eSopenharmony_ci */ 153561847f8eSopenharmony_ci export enum DoNotDisturbType { 153661847f8eSopenharmony_ci /** 153761847f8eSopenharmony_ci * Non do not disturb type notification 153861847f8eSopenharmony_ci * 153961847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 154061847f8eSopenharmony_ci * @systemapi 154161847f8eSopenharmony_ci * @since 8 154261847f8eSopenharmony_ci * @deprecated since 9 154361847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DoNotDisturbType#TYPE_NONE 154461847f8eSopenharmony_ci */ 154561847f8eSopenharmony_ci TYPE_NONE = 0, 154661847f8eSopenharmony_ci 154761847f8eSopenharmony_ci /** 154861847f8eSopenharmony_ci * Execute do not disturb once in the set time period (only watch hours and minutes) 154961847f8eSopenharmony_ci * 155061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 155161847f8eSopenharmony_ci * @systemapi 155261847f8eSopenharmony_ci * @since 8 155361847f8eSopenharmony_ci * @deprecated since 9 155461847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DoNotDisturbType#TYPE_ONCE 155561847f8eSopenharmony_ci */ 155661847f8eSopenharmony_ci TYPE_ONCE = 1, 155761847f8eSopenharmony_ci 155861847f8eSopenharmony_ci /** 155961847f8eSopenharmony_ci * Execute do not disturb every day with a set time period (only watch hours and minutes) 156061847f8eSopenharmony_ci * 156161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 156261847f8eSopenharmony_ci * @systemapi 156361847f8eSopenharmony_ci * @since 8 156461847f8eSopenharmony_ci * @deprecated since 9 156561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DoNotDisturbType#TYPE_DAILY 156661847f8eSopenharmony_ci */ 156761847f8eSopenharmony_ci TYPE_DAILY = 2, 156861847f8eSopenharmony_ci 156961847f8eSopenharmony_ci /** 157061847f8eSopenharmony_ci * Execute in the set time period (specify the time, month, day and hour) 157161847f8eSopenharmony_ci * 157261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 157361847f8eSopenharmony_ci * @systemapi 157461847f8eSopenharmony_ci * @since 8 157561847f8eSopenharmony_ci * @deprecated since 9 157661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DoNotDisturbType#TYPE_CLEARLY 157761847f8eSopenharmony_ci */ 157861847f8eSopenharmony_ci TYPE_CLEARLY = 3 157961847f8eSopenharmony_ci } 158061847f8eSopenharmony_ci 158161847f8eSopenharmony_ci /** 158261847f8eSopenharmony_ci * Describes a DoNotDisturbDate instance. 158361847f8eSopenharmony_ci * 158461847f8eSopenharmony_ci * @typedef DoNotDisturbDate 158561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 158661847f8eSopenharmony_ci * @systemapi 158761847f8eSopenharmony_ci * @since 8 158861847f8eSopenharmony_ci * @deprecated since 9 158961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#DoNotDisturbDate 159061847f8eSopenharmony_ci */ 159161847f8eSopenharmony_ci export interface DoNotDisturbDate { 159261847f8eSopenharmony_ci /** 159361847f8eSopenharmony_ci * the type of the Do Not Disturb. 159461847f8eSopenharmony_ci * 159561847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 159661847f8eSopenharmony_ci * @systemapi 159761847f8eSopenharmony_ci * @since 8 159861847f8eSopenharmony_ci * @deprecated since 9 159961847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DoNotDisturbDate#type 160061847f8eSopenharmony_ci */ 160161847f8eSopenharmony_ci type: DoNotDisturbType; 160261847f8eSopenharmony_ci 160361847f8eSopenharmony_ci /** 160461847f8eSopenharmony_ci * the start time of the Do Not Disturb. 160561847f8eSopenharmony_ci * 160661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 160761847f8eSopenharmony_ci * @systemapi 160861847f8eSopenharmony_ci * @since 8 160961847f8eSopenharmony_ci * @deprecated since 9 161061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DoNotDisturbDate#begin 161161847f8eSopenharmony_ci */ 161261847f8eSopenharmony_ci begin: Date; 161361847f8eSopenharmony_ci 161461847f8eSopenharmony_ci /** 161561847f8eSopenharmony_ci * the end time of the Do Not Disturb. 161661847f8eSopenharmony_ci * 161761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 161861847f8eSopenharmony_ci * @systemapi 161961847f8eSopenharmony_ci * @since 8 162061847f8eSopenharmony_ci * @deprecated since 9 162161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DoNotDisturbDate#end 162261847f8eSopenharmony_ci */ 162361847f8eSopenharmony_ci end: Date; 162461847f8eSopenharmony_ci } 162561847f8eSopenharmony_ci 162661847f8eSopenharmony_ci /** 162761847f8eSopenharmony_ci * The remind type of the notification. 162861847f8eSopenharmony_ci * 162961847f8eSopenharmony_ci * @enum { number } 163061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 163161847f8eSopenharmony_ci * @systemapi 163261847f8eSopenharmony_ci * @since 8 163361847f8eSopenharmony_ci * @deprecated since 9 163461847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#DeviceRemindType 163561847f8eSopenharmony_ci */ 163661847f8eSopenharmony_ci export enum DeviceRemindType { 163761847f8eSopenharmony_ci /** 163861847f8eSopenharmony_ci * The device is not in use, no reminder 163961847f8eSopenharmony_ci * 164061847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 164161847f8eSopenharmony_ci * @systemapi 164261847f8eSopenharmony_ci * @since 8 164361847f8eSopenharmony_ci * @deprecated since 9 164461847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DeviceRemindType#IDLE_DONOT_REMIND 164561847f8eSopenharmony_ci */ 164661847f8eSopenharmony_ci IDLE_DONOT_REMIND = 0, 164761847f8eSopenharmony_ci 164861847f8eSopenharmony_ci /** 164961847f8eSopenharmony_ci * The device is not in use, remind 165061847f8eSopenharmony_ci * 165161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 165261847f8eSopenharmony_ci * @systemapi 165361847f8eSopenharmony_ci * @since 8 165461847f8eSopenharmony_ci * @deprecated since 9 165561847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DeviceRemindType#IDLE_REMIND 165661847f8eSopenharmony_ci */ 165761847f8eSopenharmony_ci IDLE_REMIND = 1, 165861847f8eSopenharmony_ci 165961847f8eSopenharmony_ci /** 166061847f8eSopenharmony_ci * The device is in use, no reminder 166161847f8eSopenharmony_ci * 166261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 166361847f8eSopenharmony_ci * @systemapi 166461847f8eSopenharmony_ci * @since 8 166561847f8eSopenharmony_ci * @deprecated since 9 166661847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DeviceRemindType#ACTIVE_DONOT_REMIND 166761847f8eSopenharmony_ci */ 166861847f8eSopenharmony_ci ACTIVE_DONOT_REMIND = 2, 166961847f8eSopenharmony_ci 167061847f8eSopenharmony_ci /** 167161847f8eSopenharmony_ci * The device is in use, reminder 167261847f8eSopenharmony_ci * 167361847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 167461847f8eSopenharmony_ci * @systemapi 167561847f8eSopenharmony_ci * @since 8 167661847f8eSopenharmony_ci * @deprecated since 9 167761847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.DeviceRemindType#ACTIVE_REMIND 167861847f8eSopenharmony_ci */ 167961847f8eSopenharmony_ci ACTIVE_REMIND = 3 168061847f8eSopenharmony_ci } 168161847f8eSopenharmony_ci 168261847f8eSopenharmony_ci /** 168361847f8eSopenharmony_ci * Notification source type 168461847f8eSopenharmony_ci * 168561847f8eSopenharmony_ci * @enum { number } 168661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 168761847f8eSopenharmony_ci * @systemapi 168861847f8eSopenharmony_ci * @since 8 168961847f8eSopenharmony_ci * @deprecated since 9 169061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager#SourceType 169161847f8eSopenharmony_ci */ 169261847f8eSopenharmony_ci export enum SourceType { 169361847f8eSopenharmony_ci /** 169461847f8eSopenharmony_ci * General notification 169561847f8eSopenharmony_ci * 169661847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 169761847f8eSopenharmony_ci * @systemapi 169861847f8eSopenharmony_ci * @since 8 169961847f8eSopenharmony_ci * @deprecated since 9 170061847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SourceType#TYPE_NORMAL 170161847f8eSopenharmony_ci */ 170261847f8eSopenharmony_ci TYPE_NORMAL = 0, 170361847f8eSopenharmony_ci 170461847f8eSopenharmony_ci /** 170561847f8eSopenharmony_ci * Continuous notification 170661847f8eSopenharmony_ci * 170761847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 170861847f8eSopenharmony_ci * @systemapi 170961847f8eSopenharmony_ci * @since 8 171061847f8eSopenharmony_ci * @deprecated since 9 171161847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SourceType#TYPE_CONTINUOUS 171261847f8eSopenharmony_ci */ 171361847f8eSopenharmony_ci TYPE_CONTINUOUS = 1, 171461847f8eSopenharmony_ci 171561847f8eSopenharmony_ci /** 171661847f8eSopenharmony_ci * Scheduled notification 171761847f8eSopenharmony_ci * 171861847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 171961847f8eSopenharmony_ci * @systemapi 172061847f8eSopenharmony_ci * @since 8 172161847f8eSopenharmony_ci * @deprecated since 9 172261847f8eSopenharmony_ci * @useinstead ohos.notificationManager/notificationManager.SourceType#TYPE_TIMER 172361847f8eSopenharmony_ci */ 172461847f8eSopenharmony_ci TYPE_TIMER = 2 172561847f8eSopenharmony_ci } 172661847f8eSopenharmony_ci 172761847f8eSopenharmony_ci /** 172861847f8eSopenharmony_ci * Reason for remove a notification 172961847f8eSopenharmony_ci * 173061847f8eSopenharmony_ci * @enum { number } 173161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 173261847f8eSopenharmony_ci * @systemapi 173361847f8eSopenharmony_ci * @since 7 173461847f8eSopenharmony_ci * @deprecated since 9 173561847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe#RemoveReason 173661847f8eSopenharmony_ci */ 173761847f8eSopenharmony_ci export enum RemoveReason { 173861847f8eSopenharmony_ci /** 173961847f8eSopenharmony_ci * Notification clicked notification on the status bar. 174061847f8eSopenharmony_ci * 174161847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 174261847f8eSopenharmony_ci * @systemapi 174361847f8eSopenharmony_ci * @since 7 174461847f8eSopenharmony_ci * @deprecated since 9 174561847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe.RemoveReason#CLICK_REASON_REMOVE 174661847f8eSopenharmony_ci */ 174761847f8eSopenharmony_ci CLICK_REASON_REMOVE = 1, 174861847f8eSopenharmony_ci 174961847f8eSopenharmony_ci /** 175061847f8eSopenharmony_ci * User dismissal notification on the status bar 175161847f8eSopenharmony_ci * 175261847f8eSopenharmony_ci * @syscap SystemCapability.Notification.Notification 175361847f8eSopenharmony_ci * @systemapi 175461847f8eSopenharmony_ci * @since 7 175561847f8eSopenharmony_ci * @deprecated since 9 175661847f8eSopenharmony_ci * @useinstead ohos.notificationSubscribe/notificationSubscribe.RemoveReason#CANCEL_REASON_REMOVE 175761847f8eSopenharmony_ci */ 175861847f8eSopenharmony_ci CANCEL_REASON_REMOVE = 2 175961847f8eSopenharmony_ci } 176061847f8eSopenharmony_ci} 176161847f8eSopenharmony_ci 176261847f8eSopenharmony_ciexport default notification; 1763