From d5c06ba74f42940bb5816d5377034ae997a2e2be Mon Sep 17 00:00:00 2001 From: raul Date: Thu, 15 Sep 2022 16:06:31 +0800 Subject: [PATCH] api support errCode Signed-off-by: raul Change-Id: If4e8e30893d49947182bba0ec241f61976aa53d7 --- api/@ohos.commonEvent.d.ts | 20 + api/@ohos.commonEventManager.d.ts | 996 ++++++++++++++++++++++++ api/@ohos.notification.d.ts | 201 ++++- api/@ohos.notificationManager.d.ts | 1122 ++++++++++++++++++++++++++++ 4 files changed, 2338 insertions(+), 1 deletion(-) create mode 100644 api/@ohos.commonEventManager.d.ts create mode 100644 api/@ohos.notificationManager.d.ts diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 208aa26f1a..c80f994dbf 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -25,6 +25,8 @@ import { CommonEventPublishData } from './commonEvent/commonEventPublishData'; * @since 7 * @syscap SystemCapability.Notification.CommonEvent * @permission N/A + * @deprecated since 9 + * @useinstead commonEventManager */ declare namespace commonEvent { /** @@ -34,6 +36,8 @@ declare namespace commonEvent { * @param event name of the common event. * @param callback Specified callback method. * @return - + * @deprecated since 9 + * @useinstead commonEventManager.publish */ function publish(event: string, callback: AsyncCallback): void; @@ -45,6 +49,8 @@ declare namespace commonEvent { * @param options Indicate the CommonEventPublishData containing the common event content and attributes. * @param callback Specified callback method. * @return - + * @deprecated since 9 + * @useinstead commonEventManager.publish */ function publish(event: string, options: CommonEventPublishData, callback: AsyncCallback): void; @@ -58,6 +64,8 @@ declare namespace commonEvent { * @return - * * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead commonEventManager.publishAsUser */ function publishAsUser(event: string, userId: number, callback: AsyncCallback): void; @@ -72,6 +80,8 @@ declare namespace commonEvent { * @return - * * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead commonEventManager.publishAsUser */ function publishAsUser(event: string, userId: number, options: CommonEventPublishData, callback: AsyncCallback): void; @@ -82,6 +92,8 @@ declare namespace commonEvent { * @param subscribeInfo Indicates the information of the subscriber. * @param callback Specified callback method. * @return - + * @deprecated since 9 + * @useinstead commonEventManager.createSubscriber */ function createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback): void; @@ -91,6 +103,8 @@ declare namespace commonEvent { * @since 7 * @param subscribeInfo Indicates the information of the subscriber. * @return Returns common event subscriber object + * @deprecated since 9 + * @useinstead commonEventManager.createSubscriber */ function createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise; @@ -101,6 +115,8 @@ declare namespace commonEvent { * @param subscriber Indicate the subscriber of the common event. * @param callback Specified callback method. * @return - + * @deprecated since 9 + * @useinstead commonEventManager.subscribe */ function subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): void; @@ -111,6 +127,8 @@ declare namespace commonEvent { * @param subscriber Indicate the subscriber of the common event. * @param callback Specified callback method. * @return - + * @deprecated since 9 + * @useinstead commonEventManager.unsubscribe */ function unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback): void; @@ -119,6 +137,8 @@ declare namespace commonEvent { * @name Support * @since 7 * @permission N/A + * @deprecated since 9 + * @useinstead commonEventManager.Support */ export enum Support { /** diff --git a/api/@ohos.commonEventManager.d.ts b/api/@ohos.commonEventManager.d.ts new file mode 100644 index 0000000000..5c14ba33ed --- /dev/null +++ b/api/@ohos.commonEventManager.d.ts @@ -0,0 +1,996 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +import { CommonEventData } from './commonEvent/commonEventData'; +import { CommonEventSubscriber } from './commonEvent/commonEventSubscriber'; +import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo'; +import { CommonEventPublishData } from './commonEvent/commonEventPublishData'; + +/** + * Common event defination + * + * @name commonEventManager + * @since 9 + * @syscap SystemCapability.Notification.CommonEvent + * @throws { BusinessError } If the input parameter is not valid parameter. + * @permission N/A + */ +declare namespace commonEventManager { + /** + * Publishes an ordered, sticky, or standard common event. + * + * @param event name of the common event. + * @param callback Specified callback method. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return - + */ + function publish(event: string, callback: AsyncCallback): void; + + /** + * Publishes an ordered, sticky, or standard common event. + * + * @param event name of the common event. + * @param options Indicate the CommonEventPublishData containing the common event content and attributes. + * @param callback Specified callback method. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return - + */ + function publish(event: string, options: CommonEventPublishData, callback: AsyncCallback): void; + + /** + * Publishes an ordered, sticky, or standard common event to a specified user. + * + * @param event Specified the names of the common events. + * @param userId Specified the user to receive the common events. + * @param callback Specified callback method. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return - + * + * @systemapi Hide this for inner system use. + */ + function publishAsUser(event: string, userId: number, callback: AsyncCallback): void; + + /** + * Publishes an ordered, sticky, or standard common event to a specified user. + * + * @param event Specified the names of the common events. + * @param userId Specified the user to receive the common events. + * @param options Indicates the CommonEventPublishData containing the common event content and attributes. + * @param callback Specified callback method. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return - + * + * @systemapi Hide this for inner system use. + */ + function publishAsUser(event: string, userId: number, options: CommonEventPublishData, callback: AsyncCallback): void; + + /** + * creates a CommonEventSubscriber for the SubscriberInfo. + * + * @param subscribeInfo Indicates the information of the subscriber. + * @param callback Specified callback method. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return - + */ + function createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback): void; + + /** + * create the CommonEventSubscriber for the SubscriberInfo. + * + * @param subscribeInfo Indicates the information of the subscriber. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns common event subscriber object + */ + function createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise; + + /** + * subscribe an ordered, sticky, or standard common event. + * + * @param subscriber Indicate the subscriber of the common event. + * @param callback Specified callback method. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return - + */ + function subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): void; + + /** + * unsubscribe from an ordered, sticky, or standard common event. + * + * @param subscriber Indicate the subscriber of the common event. + * @param callback Specified callback method. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return - + */ + function unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback): void; + + /** + * the event type that the commonEvent supported + * + * @name Support + * @since 9 + * @permission N/A + */ + export enum Support { + /** + * this commonEvent means when the device is booted or system upgrade completed, and only be sent by system. + */ + COMMON_EVENT_BOOT_COMPLETED = "usual.event.BOOT_COMPLETED", + + /** + * this commonEvent means when the device finnish booting, but still in the locked state. + */ + COMMON_EVENT_LOCKED_BOOT_COMPLETED = "usual.event.LOCKED_BOOT_COMPLETED", + + /** + * this commonEvent means when the device is shutting down, note: turn off, not sleeping. + */ + COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN", + + /** + * this commonEvent means when the charging state, level and so on about the battery. + */ + COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED", + + /** + * this commonEvent means when the device in low battery state.. + */ + COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW", + + /** + * this commonEvent means when the battery level is an ok state. + */ + COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY", + + /** + * this commonEvent means when the other power is connected to the device. + */ + COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED", + + /** + * this commonEvent means when the other power is removed from the device. + */ + COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED", + + /** + * this commonEvent means when the screen is turned off. + */ + COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF", + + /** + * this commonEvent means when the device is waked up and interactive. + */ + COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON", + + /** + * this commonEvent means when the thermal state level change + */ + COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED", + + /** + * this commonEvent means when the user is present after the device waked up. + */ + COMMON_EVENT_USER_PRESENT = "usual.event.USER_PRESENT", + + /** + * this commonEvent means when the current time is changed. + */ + COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK", + + /** + * this commonEvent means when the time is set. + */ + COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED", + + /** + * this commonEvent means when the current date is changed. + */ + COMMON_EVENT_DATE_CHANGED = "usual.event.DATE_CHANGED", + + /** + * this commonEvent means when the time zone is changed. + */ + COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED", + + /** + * this commonEvent means when the dialog to dismiss. + */ + COMMON_EVENT_CLOSE_SYSTEM_DIALOGS = "usual.event.CLOSE_SYSTEM_DIALOGS", + + /** + * this commonEvent means when a new application package is installed on the device. + */ + COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED", + + /** + * this commonEvent means when a new version application package is installed on the device and + * replace the old version.the data contains the name of the package. + */ + COMMON_EVENT_PACKAGE_REPLACED = "usual.event.PACKAGE_REPLACED", + + /** + * this commonEvent means when a new version application package is installed on the device and + * replace the old version, it does not contain additional data and only be sent to the replaced application. + */ + COMMON_EVENT_MY_PACKAGE_REPLACED = "usual.event.MY_PACKAGE_REPLACED", + + /** + * this commonEvent means when an existing application package is removed from the device. + */ + COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED", + + /** + * this commonEvent means when an existing application package is removed from the device. + */ + COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED", + + /** + * this commonEvent means when an existing application package is completely removed from the device. + */ + COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED", + + /** + * this commonEvent means when an existing application package has been changed. + */ + COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED", + + /** + * this commonEvent means the user has restarted a package, and all of its processes have been killed. + */ + COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED", + + /** + * this commonEvent means the user has cleared the package data. + */ + COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED", + + /** + * this commonEvent means the user has cleared the package cache. + */ + COMMON_EVENT_PACKAGE_CACHE_CLEARED = "usual.event.PACKAGE_CACHE_CLEARED", + + /** + * this commonEvent means the packages have been suspended. + */ + COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED", + + /** + * this commonEvent means the packages have been un-suspended. + */ + COMMON_EVENT_PACKAGES_UNSUSPENDED = "usual.event.PACKAGES_UNSUSPENDED", + + /** + * this commonEvent Sent to a package that has been suspended by the system. + */ + COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED", + + /** + * Sent to a package that has been un-suspended. + */ + COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED", + + /** + * a user id has been removed from the system. + */ + COMMON_EVENT_UID_REMOVED = "usual.event.UID_REMOVED", + + /** + * the application is first launched after installed. + */ + COMMON_EVENT_PACKAGE_FIRST_LAUNCH = "usual.event.PACKAGE_FIRST_LAUNCH", + + /** + * sent by system package verifier when a package need to be verified. + */ + COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION = + "usual.event.PACKAGE_NEEDS_VERIFICATION", + + /** + * sent by system package verifier when a package is verified. + */ + COMMON_EVENT_PACKAGE_VERIFIED = "usual.event.PACKAGE_VERIFIED", + + /** + * Resources for a set of packages (which were previously unavailable) are currently + * available since the media on which they exist is available. + */ + COMMON_EVENT_EXTERNAL_APPLICATIONS_AVAILABLE = + "usual.event.EXTERNAL_APPLICATIONS_AVAILABLE", + + /** + * Resources for a set of packages are currently unavailable since the media on which they exist is unavailable. + */ + COMMON_EVENT_EXTERNAL_APPLICATIONS_UNAVAILABLE = + "usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE", + + /** + * the device configuration such as orientation,locale have been changed. + */ + COMMON_EVENT_CONFIGURATION_CHANGED = "usual.event.CONFIGURATION_CHANGED", + + /** + * The current device's locale has changed. + */ + COMMON_EVENT_LOCALE_CHANGED = "usual.event.LOCALE_CHANGED", + + /** + * Indicates low memory condition notification acknowledged by user and package management should be started. + */ + COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE", + + /** + * sent by the smart function when the system in drive mode. + */ + COMMON_EVENT_DRIVE_MODE = "common.event.DRIVE_MODE", + + /** + * sent by the smart function when the system in home mode. + */ + COMMON_EVENT_HOME_MODE = "common.event.HOME_MODE", + + /** + * sent by the smart function when the system in office mode. + */ + COMMON_EVENT_OFFICE_MODE = "common.event.OFFICE_MODE", + + /** + * remind new user of preparing to start. + */ + COMMON_EVENT_USER_STARTED = "usual.event.USER_STARTED", + + /** + * remind previous user of that the service has been the background. + */ + COMMON_EVENT_USER_BACKGROUND = "usual.event.USER_BACKGROUND", + + /** + * remind new user of that the service has been the foreground. + */ + COMMON_EVENT_USER_FOREGROUND = "usual.event.USER_FOREGROUND", + + /** + * remind new user of that the service has been switched to new user. + */ + COMMON_EVENT_USER_SWITCHED = "usual.event.USER_SWITCHED", + + /** + * remind new user of that the service has been starting. + */ + COMMON_EVENT_USER_STARTING = "usual.event.USER_STARTING", + + /** + * remind new user of that the service has been unlocked. + */ + COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED", + + /** + * remind new user of that the service has been stopping. + */ + COMMON_EVENT_USER_STOPPING = "usual.event.USER_STOPPING", + + /** + * remind new user of that the service has stopped. + */ + COMMON_EVENT_USER_STOPPED = "usual.event.USER_STOPPED", + + /** + * HW id login successfully. + */ + COMMON_EVENT_HWID_LOGIN = "common.event.HWID_LOGIN", + + /** + * HW id logout successfully. + */ + COMMON_EVENT_HWID_LOGOUT = "common.event.HWID_LOGOUT", + + /** + * HW id is invalid. + */ + COMMON_EVENT_HWID_TOKEN_INVALID = "common.event.HWID_TOKEN_INVALID", + + /** + * HW id logs off. + */ + COMMON_EVENT_HWID_LOGOFF = "common.event.HWID_LOGOFF", + + /** + * WIFI state. + */ + COMMON_EVENT_WIFI_POWER_STATE = "usual.event.wifi.POWER_STATE", + + /** + * WIFI scan results. + */ + COMMON_EVENT_WIFI_SCAN_FINISHED = "usual.event.wifi.SCAN_FINISHED", + + /** + * WIFI RSSI change. + */ + COMMON_EVENT_WIFI_RSSI_VALUE = "usual.event.wifi.RSSI_VALUE", + + /** + * WIFI connect state. + */ + COMMON_EVENT_WIFI_CONN_STATE = "usual.event.wifi.CONN_STATE", + + /** + * WIFI hotspot state. + */ + COMMON_EVENT_WIFI_HOTSPOT_STATE = "usual.event.wifi.HOTSPOT_STATE", + + /** + * WIFI ap sta join. + */ + COMMON_EVENT_WIFI_AP_STA_JOIN = "usual.event.wifi.WIFI_HS_STA_JOIN", + + /** + * WIFI ap sta join. + */ + COMMON_EVENT_WIFI_AP_STA_LEAVE = "usual.event.wifi.WIFI_HS_STA_LEAVE", + + /** + * Indicates Wi-Fi MpLink state notification acknowledged by binding or unbinding MpLink. + */ + COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE", + + /** + * Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnecting P2P. + */ + COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE", + + /** + * Indicates that the Wi-Fi P2P state change. + */ + COMMON_EVENT_WIFI_P2P_STATE_CHANGED = "usual.event.wifi.p2p.STATE_CHANGE", + + /** + * Indicates that the Wi-Fi P2P peers state change. + */ + COMMON_EVENT_WIFI_P2P_PEERS_STATE_CHANGED = + "usual.event.wifi.p2p.DEVICES_CHANGE", + + /** + * Indicates that the Wi-Fi P2P discovery state change. + */ + COMMON_EVENT_WIFI_P2P_PEERS_DISCOVERY_STATE_CHANGED = + "usual.event.wifi.p2p.PEER_DISCOVERY_STATE_CHANGE", + + /** + * Indicates that the Wi-Fi P2P current device state change. + */ + COMMON_EVENT_WIFI_P2P_CURRENT_DEVICE_STATE_CHANGED = + "usual.event.wifi.p2p.CURRENT_DEVICE_CHANGE", + + /** + * Indicates that the Wi-Fi P2P group info is changed. + */ + COMMON_EVENT_WIFI_P2P_GROUP_STATE_CHANGED = + "usual.event.wifi.p2p.GROUP_STATE_CHANGED", + + /** + * bluetooth.handsfree.ag.connect.state.update. + */ + COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CONNECT_STATE_UPDATE = + "usual.event.bluetooth.handsfree.ag.CONNECT_STATE_UPDATE", + + /** + * bluetooth.handsfree.ag.current.device.update. + */ + COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_CURRENT_DEVICE_UPDATE = + "usual.event.bluetooth.handsfree.ag.CURRENT_DEVICE_UPDATE", + + /** + * bluetooth.handsfree.ag.audio.state.update. + */ + COMMON_EVENT_BLUETOOTH_HANDSFREE_AG_AUDIO_STATE_UPDATE = + "usual.event.bluetooth.handsfree.ag.AUDIO_STATE_UPDATE", + + /** + * bluetooth.a2dpsource.connect.state.update. + */ + COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CONNECT_STATE_UPDATE = + "usual.event.bluetooth.a2dpsource.CONNECT_STATE_UPDATE", + + /** + * bluetooth.a2dpsource.current.device.update. + */ + COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CURRENT_DEVICE_UPDATE = + "usual.event.bluetooth.a2dpsource.CURRENT_DEVICE_UPDATE", + + /** + * bluetooth.a2dpsource.playing.state.update. + */ + COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE = + "usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE", + + /** + * bluetooth.a2dpsource.avrcp.connect.state.update. + */ + COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE = + "usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE", + + /** + * bluetooth.a2dpsource.codec.value.update. + */ + COMMON_EVENT_BLUETOOTH_A2DPSOURCE_CODEC_VALUE_UPDATE = + "usual.event.bluetooth.a2dpsource.CODEC_VALUE_UPDATE", + + /** + * bluetooth.remotedevice.discovered. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_DISCOVERED = + "usual.event.bluetooth.remotedevice.DISCOVERED", + + /** + * bluetooth.remotedevice.class.value.update. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CLASS_VALUE_UPDATE = + "usual.event.bluetooth.remotedevice.CLASS_VALUE_UPDATE", + + /** + * bluetooth.remotedevice.acl.connected. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED = + "usual.event.bluetooth.remotedevice.ACL_CONNECTED", + + /** + * bluetooth.remotedevice.acl.disconnected. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED = + "usual.event.bluetooth.remotedevice.ACL_DISCONNECTED", + + /** + * bluetooth.remotedevice.name.update. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE = + "usual.event.bluetooth.remotedevice.NAME_UPDATE", + + /** + * bluetooth.remotedevice.pair.state. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE = + "usual.event.bluetooth.remotedevice.PAIR_STATE", + + /** + * bluetooth.remotedevice.battery.value.update. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE = + "usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE", + + /** + * bluetooth.remotedevice.sdp.result. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT = + "usual.event.bluetooth.remotedevice.SDP_RESULT", + + /** + * bluetooth.remotedevice.uuid.value. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE = + "usual.event.bluetooth.remotedevice.UUID_VALUE", + + /** + * bluetooth.remotedevice.pairing.req. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ = + "usual.event.bluetooth.remotedevice.PAIRING_REQ", + + /** + * bluetooth.remotedevice.pairing.cancel. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_CANCEL = + "usual.event.bluetooth.remotedevice.PAIRING_CANCEL", + + /** + * bluetooth.remotedevice.connect.req. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REQ = + "usual.event.bluetooth.remotedevice.CONNECT_REQ", + + /** + * bluetooth.remotedevice.connect.reply. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_REPLY = + "usual.event.bluetooth.remotedevice.CONNECT_REPLY", + + /** + * bluetooth.remotedevice.connect.cancel. + */ + COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_CONNECT_CANCEL = + "usual.event.bluetooth.remotedevice.CONNECT_CANCEL", + + /** + * bluetooth.handsfreeunit.connect.state.update. + */ + COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE = + "usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE", + + /** + * bluetooth.handsfreeunit.audio.state.update. + */ + COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE = + "usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE", + + /** + * bluetooth.handsfreeunit.ag.common.event. + */ + COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT = + "usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT", + + /** + * bluetooth.handsfreeunit.ag.call.state.update. + */ + COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE = + "usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE", + + /** + * bluetooth.host.state.update. + */ + COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE = + "usual.event.bluetooth.host.STATE_UPDATE", + + /** + * bluetooth.host.req.discoverable. + */ + COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE = + "usual.event.bluetooth.host.REQ_DISCOVERABLE", + + /** + * bluetooth.host.req.enable. + */ + COMMON_EVENT_BLUETOOTH_HOST_REQ_ENABLE = "usual.event.bluetooth.host.REQ_ENABLE", + + /** + * bluetooth.host.req.disable. + */ + COMMON_EVENT_BLUETOOTH_HOST_REQ_DISABLE = + "usual.event.bluetooth.host.REQ_DISABLE", + + /** + * bluetooth.host.scan.mode.update. + */ + COMMON_EVENT_BLUETOOTH_HOST_SCAN_MODE_UPDATE = + "usual.event.bluetooth.host.SCAN_MODE_UPDATE", + + /** + * bluetooth.host.discovery.stated. + */ + COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_STARTED = + "usual.event.bluetooth.host.DISCOVERY_STARTED", + + /** + * bluetooth.host.discovery.finished. + */ + COMMON_EVENT_BLUETOOTH_HOST_DISCOVERY_FINISHED = + "usual.event.bluetooth.host.DISCOVERY_FINISHED", + + /** + * bluetooth.host.name.update. + */ + COMMON_EVENT_BLUETOOTH_HOST_NAME_UPDATE = + "usual.event.bluetooth.host.NAME_UPDATE", + + /** + * bluetooth.a2dp.connect.state.update. + */ + COMMON_EVENT_BLUETOOTH_A2DPSINK_CONNECT_STATE_UPDATE = + "usual.event.bluetooth.a2dpsink.CONNECT_STATE_UPDATE", + + /** + * bluetooth.a2dp.playing.state.update. + */ + COMMON_EVENT_BLUETOOTH_A2DPSINK_PLAYING_STATE_UPDATE = + "usual.event.bluetooth.a2dpsink.PLAYING_STATE_UPDATE", + + /** + * bluetooth.a2dp.audio.state.update. + */ + COMMON_EVENT_BLUETOOTH_A2DPSINK_AUDIO_STATE_UPDATE = + "usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE", + + /** + * nfc state change. + */ + COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED = + "usual.event.nfc.action.ADAPTER_STATE_CHANGED", + + /** + * nfc field on detected. + */ + COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED = + "usual.event.nfc.action.RF_FIELD_ON_DETECTED", + + /** + * nfc field off detected. + */ + COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED = + "usual.event.nfc.action.RF_FIELD_OFF_DETECTED", + + /** + * Sent when stop charging battery. + */ + COMMON_EVENT_DISCHARGING = "usual.event.DISCHARGING", + + /** + * Sent when start charging battery. + */ + COMMON_EVENT_CHARGING = "usual.event.CHARGING", + + /** + * Sent when device's idle mode changed + */ + COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED = "usual.event.DEVICE_IDLE_MODE_CHANGED", + + /** + * Sent when device's power save mode changed + */ + COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED", + + /** + * user added. + */ + COMMON_EVENT_USER_ADDED = "usual.event.USER_ADDED", + + /** + * user removed. + */ + COMMON_EVENT_USER_REMOVED = "usual.event.USER_REMOVED", + + /** + * Sent when ability is added. + */ + COMMON_EVENT_ABILITY_ADDED = "common.event.ABILITY_ADDED", + + /** + * Sent when ability is removed. + */ + COMMON_EVENT_ABILITY_REMOVED = "common.event.ABILITY_REMOVED", + + /** + * Sent when ability is updated. + */ + COMMON_EVENT_ABILITY_UPDATED = "common.event.ABILITY_UPDATED", + + /** + * gps mode state changed. + */ + COMMON_EVENT_LOCATION_MODE_STATE_CHANGED = + "usual.event.location.MODE_STATE_CHANGED", + + /** + * The ivi is about to go into sleep state when the ivi is turned off power. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_SLEEP = "common.event.IVI_SLEEP", + + /** + * The ivi is slept and notify the app stop playing. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_PAUSE = "common.event.IVI_PAUSE", + + /** + * The ivi is standby and notify the app stop playing. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_STANDBY = "common.event.IVI_STANDBY", + + /** + * The app stop playing and save state. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_LASTMODE_SAVE = "common.event.IVI_LASTMODE_SAVE", + + /** + * The ivi is voltage abnormal. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_VOLTAGE_ABNORMAL = "common.event.IVI_VOLTAGE_ABNORMAL", + + /** + * The ivi temperature is too high. + * This is a protected common event that can only be sent by system.this common event will be delete later, + * please use COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL. + */ + COMMON_EVENT_IVI_HIGH_TEMPERATURE = "common.event.IVI_HIGH_TEMPERATURE", + + /** + * The ivi temperature is extreme high. + * This is a protected common event that can only be sent by system.this common event will be delete later, + * please use COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL. + */ + COMMON_EVENT_IVI_EXTREME_TEMPERATURE = "common.event.IVI_EXTREME_TEMPERATURE", + + /** + * The ivi temperature is abnormal. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL = "common.event.IVI_TEMPERATURE_ABNORMAL", + + /** + * The ivi voltage is recovery. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_VOLTAGE_RECOVERY = "common.event.IVI_VOLTAGE_RECOVERY", + + /** + * The ivi temperature is recovery. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_TEMPERATURE_RECOVERY = "common.event.IVI_TEMPERATURE_RECOVERY", + + /** + * The battery service is active. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_IVI_ACTIVE = "common.event.IVI_ACTIVE", + + /** + * The usb state change events. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_USB_STATE = "usual.event.hardware.usb.action.USB_STATE", + + /** + * The usb port changed. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_USB_PORT_CHANGED = "usual.event.hardware.usb.action.USB_PORT_CHANGED", + + /** + * The usb device attached. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_USB_DEVICE_ATTACHED = + "usual.event.hardware.usb.action.USB_DEVICE_ATTACHED", + + /** + * The usb device detached. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_USB_DEVICE_DETACHED = + "usual.event.hardware.usb.action.USB_DEVICE_DETACHED", + + /** + * The usb accessory attached. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_USB_ACCESSORY_ATTACHED = + "usual.event.hardware.usb.action.USB_ACCESSORY_ATTACHED", + + /** + * The usb accessory detached. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_USB_ACCESSORY_DETACHED = + "usual.event.hardware.usb.action.USB_ACCESSORY_DETACHED", + + /** + * The external storage was removed. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_DISK_REMOVED = "usual.event.data.DISK_REMOVED", + + /** + * The external storage was unmounted. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_DISK_UNMOUNTED = "usual.event.data.DISK_UNMOUNTED", + + /** + * The external storage was mounted. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_DISK_MOUNTED = "usual.event.data.DISK_MOUNTED", + + /** + * The external storage was bad removal. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_DISK_BAD_REMOVAL = "usual.event.data.DISK_BAD_REMOVAL", + + /** + * The external storage was unmountable. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_DISK_UNMOUNTABLE = "usual.event.data.DISK_UNMOUNTABLE", + + /** + * The external storage was eject. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_DISK_EJECT = "usual.event.data.DISK_EJECT", + + /** + * The external storage was removed. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_VOLUME_REMOVED = "usual.event.data.VOLUME_REMOVED", + + /** + * The external storage was unmounted. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_VOLUME_UNMOUNTED = "usual.event.data.VOLUME_UNMOUNTED", + + /** + * The external storage was mounted. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_VOLUME_MOUNTED = "usual.event.data.VOLUME_MOUNTED", + + /** + * The external storage was bad removal. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_VOLUME_BAD_REMOVAL = "usual.event.data.VOLUME_BAD_REMOVAL", + + /** + * The external storage was eject. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_VOLUME_EJECT = "usual.event.data.VOLUME_EJECT", + + /** + * The visible of account was updated. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_VISIBLE_ACCOUNTS_UPDATED = + "usual.event.data.VISIBLE_ACCOUNTS_UPDATED", + + /** + * Account was deleted. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_ACCOUNT_DELETED = "usual.event.data.ACCOUNT_DELETED", + + /** + * Foundation was ready. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_FOUNDATION_READY = "common.event.FOUNDATION_READY", + + /** + * Indicates the common event Action indicating that the airplane mode status of the device changes. + * Users can register this event to listen to the change of the airplane mode status of the device. + */ + COMMON_EVENT_AIRPLANE_MODE_CHANGED = "usual.event.AIRPLANE_MODE", + + /** + * sent by the window manager service when the window mode is split. + */ + COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN", + + /** + * The notification slot has been updated. + * This is a protected common event that can only be sent by system. + */ + COMMON_EVENT_SLOT_CHANGE = "usual.event.SLOT_CHANGE", + + /** + * Indicate the action of a common event that the spn display information has been updated. + * This common event can be triggered only by system. + */ + COMMON_EVENT_SPN_INFO_CHANGED = "usual.event.SPN_INFO_CHANGED", + + /** + * Indicate the result of quick fix apply. + * This common event can be triggered only by system. + */ + COMMON_EVENT_QUICK_FIX_APPLY_RESULT = "usual.event.QUICK_FIX_APPLY_RESULT" + } +} + +export default commonEventManager; diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index b89772c2bb..8df1b51e8b 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -49,6 +49,8 @@ import { NotificationUserInput as _NotificationUserInput } from './notification/ * @syscap SystemCapability.Notification.Notification * @import import notification from '@ohos.notification'; * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager */ declare namespace notification { /** @@ -59,6 +61,8 @@ declare namespace notification { * * @param request notification request * @param callback callback function + * @deprecated since 9 + * @useinstead notificationManager.publish */ function publish(request: NotificationRequest, callback: AsyncCallback): void; function publish(request: NotificationRequest): Promise; @@ -71,6 +75,8 @@ declare namespace notification { * @param userId of subscriber receiving the notification * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.publish * */ function publish(request: NotificationRequest, userId: number, callback: AsyncCallback): void; @@ -85,6 +91,8 @@ declare namespace notification { * @param userId userid of the representative * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.publishAsBundle * */ function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number, callback: AsyncCallback): void; @@ -95,6 +103,8 @@ declare namespace notification { * * @param id of the notification to cancel, which must be unique in the application. * @param callback callback function + * @deprecated since 9 + * @useinstead notificationManager.cancel */ function cancel(id: number, callback: AsyncCallback): void; @@ -104,6 +114,8 @@ declare namespace notification { * @param id ID of the notification to cancel, which must be unique in the application. * @param label Label of the notification to cancel. * @param callback callback function + * @deprecated since 9 + * @useinstead notificationManager.cancel */ function cancel(id: number, label: string, callback: AsyncCallback): void; function cancel(id: number, label?: string): Promise; @@ -118,12 +130,16 @@ declare namespace notification { * @param callback callback function * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.cancelAsBundle */ function cancelAsBundle(id: number, representativeBundle: string, userId: number, callback: AsyncCallback): void; function cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise; /** * Cancels all notifications of the current application. + * @deprecated since 9 + * @useinstead notificationManager.cancelAll */ function cancelAll(callback: AsyncCallback): void; function cancelAll(): Promise; @@ -136,6 +152,8 @@ declare namespace notification { * @param callback callback function * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.addSlot */ function addSlot(slot: NotificationSlot, callback: AsyncCallback): void; @@ -147,6 +165,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.addSlot */ function addSlot(slot: NotificationSlot): Promise; @@ -155,6 +175,8 @@ declare namespace notification { * * @param type Slot type to add. * @param callback callback function + * @deprecated since 9 + * @useinstead notificationManager.addSlot */ function addSlot(type: SlotType, callback: AsyncCallback): void; function addSlot(type: SlotType): Promise; @@ -167,6 +189,8 @@ declare namespace notification { * @param callback callback function * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.addSlots */ function addSlots(slots: Array, callback: AsyncCallback): void; @@ -178,6 +202,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.addSlots */ function addSlots(slots: Array): Promise; @@ -187,6 +213,8 @@ declare namespace notification { * @param slotType Type of the notification slot to obtain. * @param callback callback function * @return Returns the created {@link NotificationSlot}. + * @deprecated since 9 + * @useinstead notificationManager.getSlot */ function getSlot(slotType: SlotType, callback: AsyncCallback): void; function getSlot(slotType: SlotType): Promise; @@ -195,6 +223,8 @@ declare namespace notification { * Obtains all NotificationSlot objects created by the current application. * * @return Returns all notification slots of this application. + * @deprecated since 9 + * @useinstead notificationManager.getSlots */ function getSlots(callback: AsyncCallback>): void; function getSlots(): Promise>; @@ -204,18 +234,24 @@ declare namespace notification { * * @param slotType Type of the NotificationSlot to remove. * @param callback callback function + * @deprecated since 9 + * @useinstead notificationManager.removeSlot */ function removeSlot(slotType: SlotType, callback: AsyncCallback): void; function removeSlot(slotType: SlotType): Promise; /** * Removes all NotificationSlot objects created by the current application. + * @deprecated since 9 + * @useinstead notificationManager.removeAllSlots */ function removeAllSlots(callback: AsyncCallback): void; function removeAllSlots(): Promise; /** * Describes NotificationSlot types. + * @deprecated since 9 + * @useinstead notificationManager.SlotType */ export enum SlotType { /** @@ -251,6 +287,8 @@ declare namespace notification { * @since 7 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.ContentType */ export enum ContentType { /** @@ -281,6 +319,9 @@ declare namespace notification { /** * Indicates the level of the slot + * + * @deprecated since 9 + * @useinstead notificationManager.SlotLevel */ export enum SlotLevel { /** @@ -318,6 +359,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.subscribe */ function subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; @@ -326,6 +369,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.subscribe */ function subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback): void; @@ -334,6 +379,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.subscribe */ function subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise; @@ -342,6 +389,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.unsubscribe */ function unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; @@ -350,6 +399,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.unsubscribe */ function unsubscribe(subscriber: NotificationSubscriber): Promise; @@ -358,6 +409,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.enableNotification */ function enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void; @@ -366,6 +419,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.enableNotification */ function enableNotification(bundle: BundleOption, enable: boolean): Promise; @@ -374,6 +429,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isNotificationEnabled */ function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback): void; @@ -382,6 +439,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isNotificationEnabled */ function isNotificationEnabled(bundle: BundleOption): Promise; @@ -390,6 +449,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isNotificationEnabled */ function isNotificationEnabled(callback: AsyncCallback): void; @@ -398,6 +459,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isNotificationEnabled */ function isNotificationEnabled(): Promise; @@ -407,6 +470,8 @@ declare namespace notification { * since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isNotificationEnabled */ function isNotificationEnabled(userId: number, callback: AsyncCallback): void; function isNotificationEnabled(userId: number): Promise; @@ -416,6 +481,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.displayBadge */ function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void; @@ -424,6 +491,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.displayBadge */ function displayBadge(bundle: BundleOption, enable: boolean): Promise; @@ -432,6 +501,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isBadgeDisplayed */ function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback): void; @@ -440,6 +511,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isBadgeDisplayed */ function isBadgeDisplayed(bundle: BundleOption): Promise; @@ -448,6 +521,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.setSlotByBundle */ function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback): void; @@ -456,6 +531,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.setSlotByBundle */ function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; @@ -464,6 +541,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getSlotsByBundle */ function getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback>): void; @@ -472,6 +551,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getSlotsByBundle */ function getSlotsByBundle(bundle: BundleOption): Promise>; @@ -480,6 +561,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getSlotNumByBundle */ function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback): void; @@ -488,6 +571,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getSlotNumByBundle */ function getSlotNumByBundle(bundle: BundleOption): Promise; @@ -496,6 +581,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.remove */ function remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, callback: AsyncCallback): void; @@ -504,6 +591,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.remove */ function remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason): Promise; @@ -512,6 +601,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.remove */ function remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; @@ -520,6 +611,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.remove */ function remove(hashCode: string, reason: RemoveReason): Promise; @@ -528,6 +621,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.removeAll */ function removeAll(bundle: BundleOption, callback: AsyncCallback): void; @@ -536,6 +631,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.removeAll */ function removeAll(callback: AsyncCallback): void; @@ -545,6 +642,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.removeAll */ function removeAll(userId: number, callback: AsyncCallback): void; function removeAll(userId: number): Promise; @@ -554,6 +653,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.removeAll */ function removeAll(bundle?: BundleOption): Promise; @@ -563,6 +664,8 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getAllActiveNotifications */ function getAllActiveNotifications(callback: AsyncCallback>): void; @@ -572,17 +675,25 @@ declare namespace notification { * * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getAllActiveNotifications */ function getAllActiveNotifications(): Promise>; /** * Obtains the number of all active notifications. + * + * @deprecated since 9 + * @useinstead notificationManager.getActiveNotificationCount */ function getActiveNotificationCount(callback: AsyncCallback): void; function getActiveNotificationCount(): Promise; /** * Obtains an array of active notifications. + * + * @deprecated since 9 + * @useinstead notificationManager.cancelGroup */ function getActiveNotifications(callback: AsyncCallback>): void; function getActiveNotifications(): Promise>; @@ -591,6 +702,8 @@ declare namespace notification { * Cancel the notification of a specified group for this application. * * @since 8 + * @deprecated since 9 + * @useinstead notificationManager.cancelGroup */ function cancelGroup(groupName: string, callback: AsyncCallback): void; function cancelGroup(groupName: string): Promise; @@ -601,6 +714,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.removeGroupByBundle */ function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise; @@ -611,6 +726,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.setDoNotDisturbDate */ function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback): void; function setDoNotDisturbDate(date: DoNotDisturbDate): Promise; @@ -621,6 +738,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.setDoNotDisturbDate */ function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallback): void; function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise; @@ -631,6 +750,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getDoNotDisturbDate */ function getDoNotDisturbDate(callback: AsyncCallback): void; function getDoNotDisturbDate(): Promise; @@ -641,6 +762,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use under the specified user. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getDoNotDisturbDate */ function getDoNotDisturbDate(userId: number, callback: AsyncCallback): void; function getDoNotDisturbDate(userId: number): Promise; @@ -651,6 +774,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.supportDoNotDisturbMode */ function supportDoNotDisturbMode(callback: AsyncCallback): void; function supportDoNotDisturbMode(): Promise; @@ -661,6 +786,8 @@ declare namespace notification { * @since 8 * @param templateName Name of template to be Obtained * @param callback callback function + * @deprecated since 9 + * @useinstead notificationManager.isSupportTemplate */ function isSupportTemplate(templateName: string, callback: AsyncCallback): void; function isSupportTemplate(templateName: string): Promise; @@ -669,6 +796,8 @@ declare namespace notification { * Request permission to send notification. * * @since 8 + * @deprecated since 9 + * @useinstead notificationManager.requestEnableNotification */ function requestEnableNotification(callback: AsyncCallback): void; function requestEnableNotification(): Promise; @@ -679,6 +808,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.enableDistributed */ function enableDistributed(enable: boolean, callback: AsyncCallback): void; function enableDistributed(enable: boolean): Promise; @@ -687,6 +818,8 @@ declare namespace notification { * Obtains whether the device supports distributed notification. * * @since 8 + * @deprecated since 9 + * @useinstead notificationManager.isDistributedEnabled */ function isDistributedEnabled(callback: AsyncCallback): void; function isDistributedEnabled(): Promise; @@ -697,6 +830,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.enableDistributedByBundle */ function enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void; function enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise; @@ -707,6 +842,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isDistributedEnabledByBundle */ function isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback): void; function isDistributedEnabledByBundle(bundle: BundleOption): Promise; @@ -717,6 +854,8 @@ declare namespace notification { * @since 8 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getDeviceRemindType */ function getDeviceRemindType(callback: AsyncCallback): void; function getDeviceRemindType(): Promise; @@ -727,6 +866,8 @@ declare namespace notification { * @since 9 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.enableNotificationSlot */ function enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean, callback: AsyncCallback): void; function enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean): Promise; @@ -737,6 +878,8 @@ declare namespace notification { * @since 9 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.isNotificationSlotEnabled */ function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback): void; function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise; @@ -747,6 +890,8 @@ declare namespace notification { * @since 9 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.setSyncNotificationEnabledWithoutApp */ function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean, callback: AsyncCallback): void; function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean): Promise; @@ -757,12 +902,17 @@ declare namespace notification { * @since 9 * @systemapi Hide this for inner system use. * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @deprecated since 9 + * @useinstead notificationManager.getSyncNotificationEnabledWithoutApp */ function getSyncNotificationEnabledWithoutApp(userId: number, callback: AsyncCallback): void; function getSyncNotificationEnabledWithoutApp(userId: number): Promise; - /** + /** * Describes a BundleOption. + * + * @deprecated since 9 + * @useinstead notificationManager.BundleOption */ export interface BundleOption { bundle: string; @@ -771,6 +921,9 @@ declare namespace notification { /** * Describes a NotificationKey, which can be used to identify a notification. + * + * @deprecated since 9 + * @useinstead notificationManager.NotificationKey */ export interface NotificationKey { id: number; @@ -782,6 +935,8 @@ declare namespace notification { * * @since 8 * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.DoNotDisturbType */ export enum DoNotDisturbType { /** @@ -809,6 +964,8 @@ declare namespace notification { * Describes a DoNotDisturbDate instance. * * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.DoNotDisturbDate */ export interface DoNotDisturbDate { /** @@ -838,6 +995,8 @@ declare namespace notification { * * @since 8 * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.DeviceRemindType */ export enum DeviceRemindType { /** @@ -866,6 +1025,8 @@ declare namespace notification { * * @since 8 * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.SourceType */ export enum SourceType { /** @@ -889,6 +1050,8 @@ declare namespace notification { * * @since 9 * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.RemoveReason */ export enum RemoveReason { /** @@ -908,6 +1071,8 @@ declare namespace notification { * @since 9 * @permission N/A * @syscap SystemCapability.Notification.Notification + * @deprecated since 9 + * @useinstead notificationManager.NotificationActionButton */ export type NotificationActionButton = _NotificationActionButton @@ -917,6 +1082,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.NotificationBasicContent */ export type NotificationBasicContent = _NotificationBasicContent @@ -926,6 +1093,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.NotificationContent */ export type NotificationContent = _NotificationContent @@ -935,6 +1104,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.NotificationLongTextContent */ export type NotificationLongTextContent = _NotificationLongTextContent @@ -944,6 +1115,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.NotificationMultiLineContent */ export type NotificationMultiLineContent = _NotificationMultiLineContent @@ -953,6 +1126,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.NotificationPictureContent */ export type NotificationPictureContent = _NotificationPictureContent @@ -962,6 +1137,8 @@ declare namespace notification { * @since 9 * @permission N/A * @syscap SystemCapability.Notification.Notification + * @deprecated since 9 + * @useinstead notificationManager.NotificationFlags */ export type NotificationFlags = _NotificationFlags @@ -971,6 +1148,8 @@ declare namespace notification { * @since 9 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Notification.Notification + * @deprecated since 9 + * @useinstead notificationManager.NotificationFlagStatus */ export type NotificationFlagStatus = _NotificationFlagStatus @@ -980,6 +1159,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.NotificationRequest */ export type NotificationRequest = _NotificationRequest @@ -989,6 +1170,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.DistributedOptions */ export type DistributedOptions = _DistributedOptions @@ -998,6 +1181,8 @@ declare namespace notification { * @since 9 * @permission N/A * @syscap SystemCapability.Notification.Notification + * @deprecated since 9 + * @useinstead notificationManager.NotificationSlot */ export type NotificationSlot = _NotificationSlot @@ -1008,6 +1193,8 @@ declare namespace notification { * @syscap SystemCapability.Notification.Notification * @permission N/A * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.NotificationSorting */ export type NotificationSorting = _NotificationSorting @@ -1018,6 +1205,8 @@ declare namespace notification { * @syscap SystemCapability.Notification.Notification * @permission N/A * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.NotificationSubscribeInfo */ export type NotificationSubscribeInfo = _NotificationSubscribeInfo @@ -1029,6 +1218,8 @@ declare namespace notification { * @syscap SystemCapability.Notification.Notification * @permission N/A * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.NotificationSubscriber */ export type NotificationSubscriber = _NotificationSubscriber @@ -1040,6 +1231,8 @@ declare namespace notification { * @syscap SystemCapability.Notification.Notification * @permission N/A * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.SubscribeCallbackData */ export type SubscribeCallbackData = _SubscribeCallbackData @@ -1049,6 +1242,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead notificationManager.EnabledNotificationCallbackData */ export type EnabledNotificationCallbackData = _EnabledNotificationCallbackData @@ -1058,6 +1253,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.NotificationTemplate */ export type NotificationTemplate = _NotificationTemplate @@ -1067,6 +1264,8 @@ declare namespace notification { * @since 9 * @syscap SystemCapability.Notification.Notification * @permission N/A + * @deprecated since 9 + * @useinstead notificationManager.NotificationUserInput */ export type NotificationUserInput = _NotificationUserInput } diff --git a/api/@ohos.notificationManager.d.ts b/api/@ohos.notificationManager.d.ts new file mode 100644 index 0000000000..d6f036be0e --- /dev/null +++ b/api/@ohos.notificationManager.d.ts @@ -0,0 +1,1122 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +import { NotificationActionButton as _NotificationActionButton } from './notification/notificationActionButton'; +import { NotificationBasicContent as _NotificationBasicContent } from './notification/notificationContent'; +import { NotificationContent as _NotificationContent } from './notification/notificationContent'; +import { NotificationLongTextContent as _NotificationLongTextContent } from './notification/notificationContent'; +import { NotificationMultiLineContent as _NotificationMultiLineContent } from './notification/notificationContent'; +import { NotificationPictureContent as _NotificationPictureContent } from './notification/notificationContent'; +import { NotificationFlags as _NotificationFlags} from './notification/notificationFlags'; +import { NotificationFlagStatus as _NotificationFlagStatus } from './notification/notificationFlags'; +import { NotificationRequest as _NotificationRequest } from './notification/notificationRequest'; +import { DistributedOptions as _DistributedOptions } from './notification/notificationRequest'; +import { NotificationSlot as _NotificationSlot } from './notification/notificationSlot'; +import { NotificationSorting as _NotificationSorting } from './notification/notificationSorting'; +import { NotificationSubscribeInfo as _NotificationSubscribeInfo } from './notification/notificationSubscribeInfo'; +import { NotificationSubscriber as _NotificationSubscriber } from './notification/notificationSubscriber'; +import { SubscribeCallbackData as _SubscribeCallbackData } from './notification/notificationSubscriber'; +import { EnabledNotificationCallbackData as _EnabledNotificationCallbackData } from './notification/notificationSubscriber'; +import { NotificationTemplate as _NotificationTemplate } from './notification/notificationTemplate'; +import { NotificationUserInput as _NotificationUserInput } from './notification/notificationUserInput'; + +/** + * Manages notifications. + * + *

Generally, only system applications have permissions on notification subscription and unsubscription. + * You can specify the content of a notification to be published and the content is carried by + * {@link NotificationRequest}. A notification ID is unique in an application and must be specified + * when using {@link NotificationRequest} to carry the notification content. If a notification + * with this ID has been published and you need to use this ID to publish another notification, + * the original notification will be updated. In addition, the notification ID can be used to cancel + * a notification by calling the {@link #cancel(int)} method. + * + * @name notificationManager + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @import import notification from '@ohos.notification'; + * @permission N/A + */ +declare namespace notificationManager { + /** + * Publishes a notification. + * + *

If a notification with the same ID has been published by the current application and has not been deleted, + * this method will update the notification. + * + * @param request notification request + * @param callback callback function + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function publish(request: NotificationRequest, callback: AsyncCallback): void; + function publish(request: NotificationRequest): Promise; + + /** + * Publishes a notification to the specified user. + * + * @param Publishes a notification. + * @param userId of subscriber receiving the notification + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + * + */ + function publish(request: NotificationRequest, userId: number, callback: AsyncCallback): void; + function publish(request: NotificationRequest, userId: number): Promise; + + /** + * Publishes a representative notification. + * + * @param request a notification. + * @param representativeBundle bundle name of the representative + * @param userId userid of the representative + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + * + */ + function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number, callback: AsyncCallback): void; + function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise; + + /** + * Cancels a notification with the specified ID. + * + * @param id of the notification to cancel, which must be unique in the application. + * @param callback callback function + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function cancel(id: number, callback: AsyncCallback): void; + + /** + * Cancels a notification with the specified label and ID. + * + * @param id ID of the notification to cancel, which must be unique in the application. + * @param label Label of the notification to cancel. + * @param callback callback function + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function cancel(id: number, label: string, callback: AsyncCallback): void; + function cancel(id: number, label?: string): Promise; + + /** + * Cancels a representative notification. + * + * @param id ID of the notification to cancel, which must be unique in the application. + * @param representativeBundle bundle name of the representative + * @param userId userid of the representative + * @param callback callback function + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function cancelAsBundle(id: number, representativeBundle: string, userId: number, callback: AsyncCallback): void; + function cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise; + + /** + * Cancels all notifications of the current application. + * + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function cancelAll(callback: AsyncCallback): void; + function cancelAll(): Promise; + + /** + * Creates a notification slot. + * + * @param slot Indicates the notification slot to be created, which is set by {@link NotificationSlot}. + * This parameter must be specified. + * @param callback callback function + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function addSlot(slot: NotificationSlot, callback: AsyncCallback): void; + + /** + * Creates a notification slot. + * + * @param slot Indicates the notification slot to be created, which is set by {@link NotificationSlot}. + * This parameter must be specified. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function addSlot(slot: NotificationSlot): Promise; + + /** + * Adds a slot type. + * + * @param type Slot type to add. + * @param callback callback function + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function addSlot(type: SlotType, callback: AsyncCallback): void; + function addSlot(type: SlotType): Promise; + + /** + * Creates a notification slot. + * + * @param slots Indicates the notification slots to be created, which is set by {@link NotificationSlot}. + * This parameter must be specified. + * @param callback callback function + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function addSlots(slots: Array, callback: AsyncCallback): void; + + /** + * Creates a notification slot. + * + * @param slots Indicates the notification slots to be created, which is set by {@link NotificationSlot}. + * This parameter must be specified. + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function addSlots(slots: Array): Promise; + + /** + * Obtains a notification slot of the specified slot type. + * + * @param slotType Type of the notification slot to obtain. + * @param callback callback function + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the created {@link NotificationSlot}. + */ + function getSlot(slotType: SlotType, callback: AsyncCallback): void; + function getSlot(slotType: SlotType): Promise; + + /** + * Obtains all NotificationSlot objects created by the current application. + * + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns all notification slots of this application. + */ + function getSlots(callback: AsyncCallback>): void; + function getSlots(): Promise>; + + /** + * Removes a NotificationSlot of the specified SlotType created by the current application. + * + * @param slotType Type of the NotificationSlot to remove. + * @param callback callback function + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function removeSlot(slotType: SlotType, callback: AsyncCallback): void; + function removeSlot(slotType: SlotType): Promise; + + /** + * Removes all NotificationSlot objects created by the current application. + * + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function removeAllSlots(callback: AsyncCallback): void; + function removeAllSlots(): Promise; + + /** + * Describes NotificationSlot types. + * + * @since 9 + */ + export enum SlotType { + /** + * NotificationSlot of an unknown type. + */ + UNKNOWN_TYPE = 0, + + /** + * NotificationSlot for social communication. + */ + SOCIAL_COMMUNICATION = 1, + + /** + * NotificationSlot for service information. + */ + SERVICE_INFORMATION = 2, + + /** + * NotificationSlot for service information. + */ + CONTENT_INFORMATION = 3, + + /** + * NotificationSlot for other purposes. + */ + OTHER_TYPES = 0xFFFF, + } + + /** + * Describes notification content types. + * + * @name ContentType + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export enum ContentType { + /** + * Normal text notification. + */ + NOTIFICATION_CONTENT_BASIC_TEXT, + + /** + * Long text notification. + */ + NOTIFICATION_CONTENT_LONG_TEXT, + + /** + * Picture-attached notification. + */ + NOTIFICATION_CONTENT_PICTURE, + + /** + * Conversation notification. + */ + NOTIFICATION_CONTENT_CONVERSATION, + + /** + * Multi-line text notification. + */ + NOTIFICATION_CONTENT_MULTILINE, + } + + /** + * Indicates the level of the slot + */ + export enum SlotLevel { + /** + * Indicates that the notification function is disabled. + */ + LEVEL_NONE = 0, + + /** + * Indicates that the notification function is enabled but notification + * icons are not displayed in the status bar, with no banner or prompt tone. + */ + LEVEL_MIN = 1, + + /** + * Indicates that the notification function is enabled and notification + * icons are displayed in the status bar, with no banner or prompt tone. + */ + LEVEL_LOW = 2, + + /** + * Indicates that the notification function is enabled and notification + * icons are displayed in the status bar, with no banner but with a prompt tone. + */ + LEVEL_DEFAULT = 3, + + /** + * Indicates that the notification function is enabled and notification + * icons are displayed in the status bar, with a banner and a prompt tone. + */ + LEVEL_HIGH = 4, + } + + /** + * subscribe + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; + + /** + * subscribe + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback): void; + + /** + * subscribe + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function subscribe(subscriber: NotificationSubscriber, info?: NotificationSubscribeInfo): Promise; + + /** + * unsubscribe + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; + + /** + * unsubscribe + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function unsubscribe(subscriber: NotificationSubscriber): Promise; + + /** + * enableNotification + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void; + + /** + * enableNotification + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function enableNotification(bundle: BundleOption, enable: boolean): Promise; + + /** + * isNotificationEnabled + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback): void; + + /** + * isNotificationEnabled + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isNotificationEnabled(bundle: BundleOption): Promise; + + /** + * isNotificationEnabled + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isNotificationEnabled(callback: AsyncCallback): void; + + /** + * isNotificationEnabled + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + */ + function isNotificationEnabled(): Promise; + + /** + * Checks whether this application has permission to publish notifications under the user. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isNotificationEnabled(userId: number, callback: AsyncCallback): void; + function isNotificationEnabled(userId: number): Promise; + + /** + * displayBadge + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void; + + /** + * displayBadge + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function displayBadge(bundle: BundleOption, enable: boolean): Promise; + + /** + * isBadgeDisplayed + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback): void; + + /** + * isBadgeDisplayed + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isBadgeDisplayed(bundle: BundleOption): Promise; + + /** + * setSlotByBundle + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback): void; + + /** + * setSlotByBundle + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; + + /** + * getSlotsByBundle + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback>): void; + + /** + * getSlotsByBundle + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getSlotsByBundle(bundle: BundleOption): Promise>; + + /** + * getSlotNumByBundle + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback): void; + + /** + * getSlotNumByBundle + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getSlotNumByBundle(bundle: BundleOption): Promise; + + /** + * remove + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, callback: AsyncCallback): void; + + /** + * remove + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason): Promise; + + /** + * remove + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; + + /** + * remove + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function remove(hashCode: string, reason: RemoveReason): Promise; + + /** + * removeAll + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function removeAll(bundle: BundleOption, callback: AsyncCallback): void; + + /** + * removeAll + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function removeAll(callback: AsyncCallback): void; + + /** + * Remove all notifications under the specified user. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function removeAll(userId: number, callback: AsyncCallback): void; + function removeAll(userId: number): Promise; + + /** + * removeAll + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function removeAll(bundle?: BundleOption): Promise; + + /** + * Obtains all active notifications in the current system. The caller must have system permissions to + * call this method. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getAllActiveNotifications(callback: AsyncCallback>): void; + + /** + * Obtains all active notifications in the current system. The caller must have system permissions to + * call this method. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getAllActiveNotifications(): Promise>; + + /** + * Obtains the number of all active notifications. + * + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getActiveNotificationCount(callback: AsyncCallback): void; + function getActiveNotificationCount(): Promise; + + /** + * Obtains an array of active notifications. + * + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getActiveNotifications(callback: AsyncCallback>): void; + function getActiveNotifications(): Promise>; + + /** + * Cancel the notification of a specified group for this application. + * + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function cancelGroup(groupName: string, callback: AsyncCallback): void; + function cancelGroup(groupName: string): Promise; + + /** + * Delete the notification of a specified group for this application. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; + function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise; + + /** + * Set the Do Not Disturb date. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback): void; + function setDoNotDisturbDate(date: DoNotDisturbDate): Promise; + + /** + * Set the Do Not Disturb date under the specified user. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallback): void; + function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise; + + /** + * Obtains the Do Not Disturb date. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getDoNotDisturbDate(callback: AsyncCallback): void; + function getDoNotDisturbDate(): Promise; + + /** + * Obtains the Do Not Disturb date. + * + * @systemapi Hide this for inner system use under the specified user. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getDoNotDisturbDate(userId: number, callback: AsyncCallback): void; + function getDoNotDisturbDate(userId: number): Promise; + + /** + * Obtains whether to support the Do Not Disturb mode. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function supportDoNotDisturbMode(callback: AsyncCallback): void; + function supportDoNotDisturbMode(): Promise; + + /** + * Obtains whether the template is supported by the system. + * + * @param templateName Name of template to be Obtained + * @param callback callback function + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isSupportTemplate(templateName: string, callback: AsyncCallback): void; + function isSupportTemplate(templateName: string): Promise; + + /** + * Request permission to send notification. + * + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function requestEnableNotification(callback: AsyncCallback): void; + function requestEnableNotification(): Promise; + + /** + * Sets whether the device supports distributed notification. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function enableDistributed(enable: boolean, callback: AsyncCallback): void; + function enableDistributed(enable: boolean): Promise; + + /** + * Obtains whether the device supports distributed notification. + * + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isDistributedEnabled(callback: AsyncCallback): void; + function isDistributedEnabled(): Promise; + + /** + * Sets whether an application supports distributed notification. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback): void; + function enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise; + + /** + * Obtains whether an application supports distributed notification. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback): void; + function isDistributedEnabledByBundle(bundle: BundleOption): Promise; + + /** + * Obtains the remind modes of the notification. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getDeviceRemindType(callback: AsyncCallback): void; + function getDeviceRemindType(): Promise; + + /** + * Set whether the application slot is enabled. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean, callback: AsyncCallback): void; + function enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean): Promise; + + /** + * Obtains whether the application slot is enabled. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback): void; + function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise; + + /** + * Set whether to sync notifications to devices that do not have the app installed. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean, callback: AsyncCallback): void; + function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean): Promise; + + /** + * Obtains whether to sync notifications to devices that do not have the app installed. + * + * @systemapi Hide this for inner system use. + * @permission ohos.permission.NOTIFICATION_CONTROLLER + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getSyncNotificationEnabledWithoutApp(userId: number, callback: AsyncCallback): void; + function getSyncNotificationEnabledWithoutApp(userId: number): Promise; + + /** + * Describes a BundleOption. + * + * @since 9 + */ + export interface BundleOption { + bundle: string; + uid?: number; + } + + /** + * Describes a NotificationKey, which can be used to identify a notification. + * + * @since 9 + */ + export interface NotificationKey { + id: number; + label?: string; + } + + /** + * The type of the Do Not Disturb. + * + * @since 9 + * @systemapi Hide this for inner system use. + */ + export enum DoNotDisturbType { + /** + * Non do not disturb type notification + */ + TYPE_NONE = 0, + + /** + * Execute do not disturb once in the set time period (only watch hours and minutes) + */ + TYPE_ONCE = 1, + + /** + * Execute do not disturb every day with a set time period (only watch hours and minutes) + */ + TYPE_DAILY = 2, + + /** + * Execute in the set time period (specify the time, month, day and hour) + */ + TYPE_CLEARLY = 3, + } + + /** + * Describes a DoNotDisturbDate instance. + * + * @since 9 + * @systemapi Hide this for inner system use. + */ + export interface DoNotDisturbDate { + /** + * the type of the Do Not Disturb. + */ + type: DoNotDisturbType; + + /** + * the start time of the Do Not Disturb. + */ + begin: Date; + + /** + * the end time of the Do Not Disturb. + */ + end: Date; + } + + /** + * The remind type of the nofication. + * + * @since 9 + * @systemapi Hide this for inner system use. + */ + export enum DeviceRemindType { + /** + * The device is not in use, no reminder + */ + IDLE_DONOT_REMIND = 0, + + /** + * The device is not in use, remind + */ + IDLE_REMIND = 1, + + /** + * The device is in use, no reminder + */ + ACTIVE_DONOT_REMIND = 2, + + /** + * The device is in use, reminder + */ + ACTIVE_REMIND = 3, + } + + /** + * Notification source type + * + * @since 9 + * @systemapi Hide this for inner system use. + */ + export enum SourceType { + /** + * General notification + */ + TYPE_NORMAL = 0, + + /** + * Continuous notification + */ + TYPE_CONTINUOUS = 1, + + /** + * Scheduled notification + */ + TYPE_TIMER = 2, + } + + /** + * Reason for remove a notification + * + * @since 9 + * @systemapi Hide this for inner system use. + */ + export enum RemoveReason { + /** + * Notification clicked notification on the status bar + */ + CLICK_REASON_REMOVE = 1, + + /** + * User dismissal notification on the status bar + */ + CANCEL_REASON_REMOVE = 2, + } + + /** + * Describes an action button displayed in a notification. + * + * @since 9 + * @permission N/A + * @syscap SystemCapability.Notification.Notification + */ + export type NotificationActionButton = _NotificationActionButton + + /** + * Describes a normal text notification. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type NotificationBasicContent = _NotificationBasicContent + + /** + * Describes notification types. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type NotificationContent = _NotificationContent + + /** + * Describes a long text notification. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type NotificationLongTextContent = _NotificationLongTextContent + + /** + * Describes a multi-line text notification. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type NotificationMultiLineContent = _NotificationMultiLineContent + + /** + * Describes a picture-attached notification. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type NotificationPictureContent = _NotificationPictureContent + + /** + * Describes a NotificationFlags instance. + * + * @since 9 + * @permission N/A + * @syscap SystemCapability.Notification.Notification + */ + export type NotificationFlags = _NotificationFlags + + /** + * The status of the notification flag. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Notification.Notification + */ + export type NotificationFlagStatus = _NotificationFlagStatus + + /** + * Defines a NotificationRequest instance. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type NotificationRequest = _NotificationRequest + + /** + * Describes distributed options. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type DistributedOptions = _DistributedOptions + + /** + * Describes a NotificationSlot instance. + * + * @since 9 + * @permission N/A + * @syscap SystemCapability.Notification.Notification + */ + export type NotificationSlot = _NotificationSlot + + /** + * Provides sorting information about an active notification. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + * @systemapi Hide this for inner system use. + */ + export type NotificationSorting = _NotificationSorting + + /** + * Sets filter criteria of publishers for subscribing to desired notifications. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + * @systemapi Hide this for inner system use. + */ + export type NotificationSubscribeInfo = _NotificationSubscribeInfo + + /** + * Provides methods that will be called back when the subscriber receives a new notification or + * a notification is canceled. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + * @systemapi Hide this for inner system use. + */ + export type NotificationSubscriber = _NotificationSubscriber + + /** + * Provides methods that will be called back when the subscriber receives a new notification or + * a notification is canceled. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + * @systemapi Hide this for inner system use. + */ + export type SubscribeCallbackData = _SubscribeCallbackData + + /** + * Describes the properties of the application that the permission to send notifications has changed. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @systemapi Hide this for inner system use. + */ + export type EnabledNotificationCallbackData = _EnabledNotificationCallbackData + + /** + * Describes a NotificationTemplate instance. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type NotificationTemplate = _NotificationTemplate + + /** + * Describes a NotificationUserInput instance. + * + * @since 9 + * @syscap SystemCapability.Notification.Notification + * @permission N/A + */ + export type NotificationUserInput = _NotificationUserInput +} + +export default notificationManager; -- Gitee