1/* 2 * Copyright (c) 2022-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"), 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit NotificationKit 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22import { BundleOption as _BundleOption } from './notification/NotificationCommonDef'; 23import { NotificationActionButton as _NotificationActionButton } from './notification/notificationActionButton'; 24import { NotificationBasicContent as _NotificationBasicContent } from './notification/notificationContent'; 25import { NotificationContent as _NotificationContent } from './notification/notificationContent'; 26import { NotificationLongTextContent as _NotificationLongTextContent } from './notification/notificationContent'; 27import type { NotificationLiveViewContent as _NotificationLiveViewContent } from './notification/notificationContent'; 28import { NotificationMultiLineContent as _NotificationMultiLineContent } from './notification/notificationContent'; 29import { NotificationPictureContent as _NotificationPictureContent } from './notification/notificationContent'; 30import type { LiveViewStatus as _LiveViewStatus } from './notification/notificationContent'; 31import type { LiveViewTypes as _LiveViewTypes } from './notification/notificationContent'; 32import { NotificationSystemLiveViewContent as _NotificationSystemLiveViewContent } from './notification/notificationContent'; 33import { NotificationCapsule as _NotificationCapsule } from './notification/notificationContent'; 34import { NotificationButton as _NotificationButton } from './notification/notificationContent'; 35import { NotificationTime as _NotificationTime } from './notification/notificationContent'; 36import { NotificationProgress as _NotificationProgress } from './notification/notificationContent'; 37import { NotificationFlags as _NotificationFlags } from './notification/notificationFlags'; 38import { NotificationFlagStatus as _NotificationFlagStatus } from './notification/notificationFlags'; 39import { NotificationRequest as _NotificationRequest } from './notification/notificationRequest'; 40import { UnifiedGroupInfo as _UnifiedGroupInfo } from './notification/notificationRequest'; 41import { DistributedOptions as _DistributedOptions } from './notification/notificationRequest'; 42import type { NotificationFilter as _NotificationFilter } from './notification/notificationRequest'; 43import type { NotificationCheckRequest as _NotificationCheckRequest } from './notification/notificationRequest'; 44import { NotificationSlot as _NotificationSlot } from './notification/notificationSlot'; 45import { NotificationSorting as _NotificationSorting } from './notification/notificationSorting'; 46import { NotificationTemplate as _NotificationTemplate } from './notification/notificationTemplate'; 47import { NotificationUserInput as _NotificationUserInput } from './notification/notificationUserInput'; 48import type UIAbilityContext from './application/UIAbilityContext'; 49 50/** 51 * Manages notifications. 52 * <p>Generally, only system applications have permissions on notification subscription and unsubscribe. 53 * You can specify the content of a notification to be published and the content is carried by 54 * {@link NotificationRequest}. A notification ID is unique in an application and must be specified 55 * when using {@link NotificationRequest} to carry the notification content. If a notification 56 * with this ID has been published and you need to use this ID to publish another notification, 57 * the original notification will be updated. In addition, the notification ID can be used to cancel 58 * a notification by calling the {@link #cancel(int)} method. 59 * 60 * @namespace notificationManager 61 * @syscap SystemCapability.Notification.Notification 62 * @since 9 63 */ 64/** 65 * Manages notifications. 66 * <p>Generally, only system applications have permissions on notification subscription and unsubscribe. 67 * You can specify the content of a notification to be published and the content is carried by 68 * {@link NotificationRequest}. A notification ID is unique in an application and must be specified 69 * when using {@link NotificationRequest} to carry the notification content. If a notification 70 * with this ID has been published and you need to use this ID to publish another notification, 71 * the original notification will be updated. In addition, the notification ID can be used to cancel 72 * a notification by calling the {@link #cancel(int)} method. 73 * 74 * @namespace notificationManager 75 * @syscap SystemCapability.Notification.Notification 76 * @crossplatform 77 * @atomicservice 78 * @since 12 79 */ 80declare namespace notificationManager { 81 /** 82 * Publishes a notification. 83 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 84 * this method will update the notification. 85 * 86 * @param { NotificationRequest } request - notification request 87 * @param { AsyncCallback<void> } callback - The callback of publish. 88 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 89 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 90 * @throws { BusinessError } 1600001 - Internal error. 91 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 92 * @throws { BusinessError } 1600003 - Failed to connect to the service. 93 * @throws { BusinessError } 1600004 - Notification disabled. 94 * @throws { BusinessError } 1600005 - Notification slot disabled. 95 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 96 * @throws { BusinessError } 1600012 - No memory space. 97 * @syscap SystemCapability.Notification.Notification 98 * @since 9 99 */ 100 /** 101 * Publishes a notification. 102 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 103 * this method will update the notification. 104 * 105 * @param { NotificationRequest } request - notification request 106 * @param { AsyncCallback<void> } callback - The callback of publish. 107 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 108 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 109 * @throws { BusinessError } 1600001 - Internal error. 110 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 111 * @throws { BusinessError } 1600003 - Failed to connect to the service. 112 * @throws { BusinessError } 1600004 - Notification disabled. 113 * @throws { BusinessError } 1600005 - Notification slot disabled. 114 * @throws { BusinessError } 1600007 - The notification does not exist. 115 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 116 * @throws { BusinessError } 1600012 - No memory space. 117 * @throws { BusinessError } 1600014 - No permission. 118 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 119 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 120 * @throws { BusinessError } 2300007 - Network unreachable. 121 * @syscap SystemCapability.Notification.Notification 122 * @since 11 123 */ 124 /** 125 * Publishes a notification. 126 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 127 * this method will update the notification. 128 * 129 * @param { NotificationRequest } request - notification request 130 * @param { AsyncCallback<void> } callback - The callback of publish. 131 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 132 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 133 * @throws { BusinessError } 1600001 - Internal error. 134 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 135 * @throws { BusinessError } 1600003 - Failed to connect to the service. 136 * @throws { BusinessError } 1600004 - Notification disabled. 137 * @throws { BusinessError } 1600005 - Notification slot disabled. 138 * @throws { BusinessError } 1600007 - The notification does not exist. 139 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 140 * @throws { BusinessError } 1600012 - No memory space. 141 * @throws { BusinessError } 1600014 - No permission. 142 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 143 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 144 * @throws { BusinessError } 2300007 - Network unreachable. 145 * @syscap SystemCapability.Notification.Notification 146 * @crossplatform 147 * @since 12 148 */ 149 function publish(request: NotificationRequest, callback: AsyncCallback<void>): void; 150 151 /** 152 * Publishes a notification. 153 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 154 * this method will update the notification. 155 * 156 * @param { NotificationRequest } request - notification request 157 * @returns { Promise<void> } The promise returned by the function. 158 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 159 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 160 * @throws { BusinessError } 1600001 - Internal error. 161 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 162 * @throws { BusinessError } 1600003 - Failed to connect to the service. 163 * @throws { BusinessError } 1600004 - Notification disabled. 164 * @throws { BusinessError } 1600005 - Notification slot disabled. 165 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 166 * @throws { BusinessError } 1600012 - No memory space. 167 * @syscap SystemCapability.Notification.Notification 168 * @since 9 169 */ 170 /** 171 * Publishes a notification. 172 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 173 * this method will update the notification. 174 * 175 * @param { NotificationRequest } request - notification request 176 * @returns { Promise<void> } The promise returned by the function. 177 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 178 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 179 * @throws { BusinessError } 1600001 - Internal error. 180 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 181 * @throws { BusinessError } 1600003 - Failed to connect to the service. 182 * @throws { BusinessError } 1600004 - Notification disabled. 183 * @throws { BusinessError } 1600005 - Notification slot disabled. 184 * @throws { BusinessError } 1600007 - The notification does not exist. 185 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 186 * @throws { BusinessError } 1600012 - No memory space. 187 * @throws { BusinessError } 1600014 - No permission. 188 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 189 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 190 * @throws { BusinessError } 2300007 - Network unreachable. 191 * @syscap SystemCapability.Notification.Notification 192 * @since 11 193 */ 194 /** 195 * Publishes a notification. 196 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 197 * this method will update the notification. 198 * 199 * @param { NotificationRequest } request - notification request 200 * @returns { Promise<void> } The promise returned by the function. 201 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 202 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 203 * @throws { BusinessError } 1600001 - Internal error. 204 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 205 * @throws { BusinessError } 1600003 - Failed to connect to the service. 206 * @throws { BusinessError } 1600004 - Notification disabled. 207 * @throws { BusinessError } 1600005 - Notification slot disabled. 208 * @throws { BusinessError } 1600007 - The notification does not exist. 209 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 210 * @throws { BusinessError } 1600012 - No memory space. 211 * @throws { BusinessError } 1600014 - No permission. 212 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 213 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 214 * @throws { BusinessError } 2300007 - Network unreachable. 215 * @syscap SystemCapability.Notification.Notification 216 * @crossplatform 217 * @since 12 218 */ 219 function publish(request: NotificationRequest): Promise<void>; 220 221 /** 222 * Publishes a notification to the specified user. 223 * 224 * @permission ohos.permission.NOTIFICATION_CONTROLLER 225 * @param { NotificationRequest } request - a notification. 226 * @param { number } userId - of subscriber receiving the notification. 227 * @param { AsyncCallback<void> } callback - The callback of publish. 228 * @throws { BusinessError } 201 - Permission denied. 229 * @throws { BusinessError } 202 - Not system application to call the interface. 230 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 231 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 232 * @throws { BusinessError } 1600001 - Internal error. 233 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 234 * @throws { BusinessError } 1600003 - Failed to connect to the service. 235 * @throws { BusinessError } 1600004 - Notification disabled. 236 * @throws { BusinessError } 1600005 - Notification slot disabled. 237 * @throws { BusinessError } 1600008 - The user does not exist. 238 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 239 * @throws { BusinessError } 1600012 - No memory space. 240 * @syscap SystemCapability.Notification.Notification 241 * @systemapi 242 * @since 9 243 */ 244 /** 245 * Publishes a notification to the specified user. 246 * 247 * @permission ohos.permission.NOTIFICATION_CONTROLLER 248 * @param { NotificationRequest } request - a notification. 249 * @param { number } userId - of subscriber receiving the notification. 250 * @param { AsyncCallback<void> } callback - The callback of publish. 251 * @throws { BusinessError } 201 - Permission denied. 252 * @throws { BusinessError } 202 - Not system application to call the interface. 253 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 254 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 255 * @throws { BusinessError } 1600001 - Internal error. 256 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 257 * @throws { BusinessError } 1600003 - Failed to connect to the service. 258 * @throws { BusinessError } 1600004 - Notification disabled. 259 * @throws { BusinessError } 1600005 - Notification slot disabled. 260 * @throws { BusinessError } 1600007 - The notification does not exist. 261 * @throws { BusinessError } 1600008 - The user does not exist. 262 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 263 * @throws { BusinessError } 1600012 - No memory space. 264 * @throws { BusinessError } 1600014 - No permission. 265 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 266 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 267 * @throws { BusinessError } 2300007 - Network unreachable. 268 * @syscap SystemCapability.Notification.Notification 269 * @systemapi 270 * @since 11 271 */ 272 /** 273 * Publishes a notification to the specified user. 274 * 275 * @permission ohos.permission.NOTIFICATION_CONTROLLER or ohos.permission.SEND_NOTIFICATION_CROSS_USER 276 * @param { NotificationRequest } request - a notification. 277 * @param { number } userId - of subscriber receiving the notification. 278 * @param { AsyncCallback<void> } callback - The callback of publish. 279 * @throws { BusinessError } 201 - Permission denied. 280 * @throws { BusinessError } 202 - Not system application to call the interface. 281 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 282 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 283 * @throws { BusinessError } 1600001 - Internal error. 284 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 285 * @throws { BusinessError } 1600003 - Failed to connect to the service. 286 * @throws { BusinessError } 1600004 - Notification disabled. 287 * @throws { BusinessError } 1600005 - Notification slot disabled. 288 * @throws { BusinessError } 1600007 - The notification does not exist. 289 * @throws { BusinessError } 1600008 - The user does not exist. 290 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 291 * @throws { BusinessError } 1600012 - No memory space. 292 * @throws { BusinessError } 1600014 - No permission. 293 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 294 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 295 * @throws { BusinessError } 2300007 - Network unreachable. 296 * @syscap SystemCapability.Notification.Notification 297 * @systemapi 298 * @since 18 299 */ 300 function publish(request: NotificationRequest, userId: number, callback: AsyncCallback<void>): void; 301 302 /** 303 * Publishes a notification to the specified user. 304 * 305 * @permission ohos.permission.NOTIFICATION_CONTROLLER 306 * @param { NotificationRequest } request - a notification. 307 * @param { number } userId - of subscriber receiving the notification. 308 * @returns { Promise<void> } The promise returned by the function. 309 * @throws { BusinessError } 201 - Permission denied. 310 * @throws { BusinessError } 202 - Not system application to call the interface. 311 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 312 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 313 * @throws { BusinessError } 1600001 - Internal error. 314 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 315 * @throws { BusinessError } 1600003 - Failed to connect to the service. 316 * @throws { BusinessError } 1600004 - Notification disabled. 317 * @throws { BusinessError } 1600005 - Notification slot disabled. 318 * @throws { BusinessError } 1600008 - The user does not exist. 319 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 320 * @throws { BusinessError } 1600012 - No memory space. 321 * @syscap SystemCapability.Notification.Notification 322 * @systemapi 323 * @since 9 324 */ 325 /** 326 * Publishes a notification to the specified user. 327 * 328 * @permission ohos.permission.NOTIFICATION_CONTROLLER 329 * @param { NotificationRequest } request - a notification. 330 * @param { number } userId - of subscriber receiving the notification. 331 * @returns { Promise<void> } The promise returned by the function. 332 * @throws { BusinessError } 201 - Permission denied. 333 * @throws { BusinessError } 202 - Not system application to call the interface. 334 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 335 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 336 * @throws { BusinessError } 1600001 - Internal error. 337 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 338 * @throws { BusinessError } 1600003 - Failed to connect to the service. 339 * @throws { BusinessError } 1600004 - Notification disabled. 340 * @throws { BusinessError } 1600005 - Notification slot disabled. 341 * @throws { BusinessError } 1600007 - The notification does not exist. 342 * @throws { BusinessError } 1600008 - The user does not exist. 343 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 344 * @throws { BusinessError } 1600012 - No memory space. 345 * @throws { BusinessError } 1600014 - No permission. 346 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 347 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 348 * @throws { BusinessError } 2300007 - Network unreachable. 349 * @syscap SystemCapability.Notification.Notification 350 * @systemapi 351 * @since 11 352 */ 353 /** 354 * Publishes a notification to the specified user. 355 * 356 * @permission ohos.permission.NOTIFICATION_CONTROLLER or ohos.permission.SEND_NOTIFICATION_CROSS_USER 357 * @param { NotificationRequest } request - a notification. 358 * @param { number } userId - of subscriber receiving the notification. 359 * @returns { Promise<void> } The promise returned by the function. 360 * @throws { BusinessError } 201 - Permission denied. 361 * @throws { BusinessError } 202 - Not system application to call the interface. 362 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 363 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 364 * @throws { BusinessError } 1600001 - Internal error. 365 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 366 * @throws { BusinessError } 1600003 - Failed to connect to the service. 367 * @throws { BusinessError } 1600004 - Notification disabled. 368 * @throws { BusinessError } 1600005 - Notification slot disabled. 369 * @throws { BusinessError } 1600007 - The notification does not exist. 370 * @throws { BusinessError } 1600008 - The user does not exist. 371 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 372 * @throws { BusinessError } 1600012 - No memory space. 373 * @throws { BusinessError } 1600014 - No permission. 374 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 375 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 376 * @throws { BusinessError } 2300007 - Network unreachable. 377 * @syscap SystemCapability.Notification.Notification 378 * @systemapi 379 * @since 18 380 */ 381 function publish(request: NotificationRequest, userId: number): Promise<void>; 382 383 /** 384 * Publishes a representative notification. 385 * 386 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 387 * @param { NotificationRequest } request - a notification. 388 * @param { string } representativeBundle - bundle name of the representative 389 * @param { number } userId - userid of the representative 390 * @param { AsyncCallback<void> } callback - The callback of publishAsBundle. 391 * @throws { BusinessError } 201 - Permission denied. 392 * @throws { BusinessError } 202 - Not system application to call the interface. 393 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 394 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 395 * @throws { BusinessError } 1600001 - Internal error. 396 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 397 * @throws { BusinessError } 1600003 - Failed to connect to the service. 398 * @throws { BusinessError } 1600004 - Notification disabled. 399 * @throws { BusinessError } 1600005 - Notification slot disabled. 400 * @throws { BusinessError } 1600007 - The notification does not exist. 401 * @throws { BusinessError } 1600008 - The user does not exist. 402 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 403 * @throws { BusinessError } 1600012 - No memory space. 404 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 405 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 406 * @throws { BusinessError } 2300007 - Network unreachable. 407 * @syscap SystemCapability.Notification.Notification 408 * @systemapi 409 * @since 9 410 */ 411 function publishAsBundle( 412 request: NotificationRequest, 413 representativeBundle: string, 414 userId: number, 415 callback: AsyncCallback<void> 416 ): void; 417 418 /** 419 * Publishes a representative notification. 420 * 421 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 422 * @param { NotificationRequest } request - a notification. 423 * @param { string } representativeBundle - bundle name of the representative 424 * @param { number } userId - userid of the representative 425 * @returns { Promise<void> } The promise returned by the function. 426 * @throws { BusinessError } 201 - Permission denied. 427 * @throws { BusinessError } 202 - Not system application to call the interface. 428 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 429 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 430 * @throws { BusinessError } 1600001 - Internal error. 431 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 432 * @throws { BusinessError } 1600003 - Failed to connect to the service. 433 * @throws { BusinessError } 1600004 - Notification disabled. 434 * @throws { BusinessError } 1600005 - Notification slot disabled. 435 * @throws { BusinessError } 1600007 - The notification does not exist. 436 * @throws { BusinessError } 1600008 - The user does not exist. 437 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 438 * @throws { BusinessError } 1600012 - No memory space. 439 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 440 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 441 * @throws { BusinessError } 2300007 - Network unreachable. 442 * @syscap SystemCapability.Notification.Notification 443 * @systemapi 444 * @since 9 445 */ 446 function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise<void>; 447 448 /** 449 * Publishes a representative notification. 450 * 451 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 452 * @param { BundleOption } representativeBundle - bundle option of the representative. 453 * @param { NotificationRequest } request - a notification. 454 * @returns { Promise<void> } The promise returned by the function. 455 * @throws { BusinessError } 201 - Permission denied. 456 * @throws { BusinessError } 202 - Not system application to call the interface. 457 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 458 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 459 * @throws { BusinessError } 1600001 - Internal error. 460 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 461 * @throws { BusinessError } 1600003 - Failed to connect to the service. 462 * @throws { BusinessError } 1600004 - Notification disabled. 463 * @throws { BusinessError } 1600005 - Notification slot disabled. 464 * @throws { BusinessError } 1600007 - The notification does not exist. 465 * @throws { BusinessError } 1600008 - The user does not exist. 466 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 467 * @throws { BusinessError } 1600012 - No memory space. 468 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 469 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 470 * @throws { BusinessError } 2300007 - Network unreachable. 471 * @syscap SystemCapability.Notification.Notification 472 * @systemapi 473 * @since 12 474 */ 475 function publishAsBundle(representativeBundle: BundleOption, request: NotificationRequest): Promise<void>; 476 477 /** 478 * Cancel a notification with the specified ID. 479 * 480 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 481 * @param { AsyncCallback<void> } callback - The callback of cancel. 482 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 483 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 484 * @throws { BusinessError } 1600001 - Internal error. 485 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 486 * @throws { BusinessError } 1600003 - Failed to connect to the service. 487 * @throws { BusinessError } 1600007 - The notification does not exist. 488 * @syscap SystemCapability.Notification.Notification 489 * @since 9 490 */ 491 /** 492 * Cancel a notification with the specified ID. 493 * 494 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 495 * @param { AsyncCallback<void> } callback - The callback of cancel. 496 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 497 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 498 * @throws { BusinessError } 1600001 - Internal error. 499 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 500 * @throws { BusinessError } 1600003 - Failed to connect to the service. 501 * @throws { BusinessError } 1600007 - The notification does not exist. 502 * @syscap SystemCapability.Notification.Notification 503 * @crossplatform 504 * @since 12 505 */ 506 function cancel(id: number, callback: AsyncCallback<void>): void; 507 508 /** 509 * Cancel a notification with the specified label and ID. 510 * 511 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 512 * @param { string } label - Label of the notification to cancel. 513 * @param { AsyncCallback<void> } callback - The callback of cancel. 514 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 515 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 516 * @throws { BusinessError } 1600001 - Internal error. 517 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 518 * @throws { BusinessError } 1600003 - Failed to connect to the service. 519 * @throws { BusinessError } 1600007 - The notification does not exist. 520 * @syscap SystemCapability.Notification.Notification 521 * @since 9 522 */ 523 function cancel(id: number, label: string, callback: AsyncCallback<void>): void; 524 525 /** 526 * Cancel a notification with the specified label and ID. 527 * 528 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 529 * @param { string } [label] - Label of the notification to cancel. 530 * @returns { Promise<void> } The promise returned by the function. 531 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 532 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 533 * @throws { BusinessError } 1600001 - Internal error. 534 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 535 * @throws { BusinessError } 1600003 - Failed to connect to the service. 536 * @throws { BusinessError } 1600007 - The notification does not exist. 537 * @syscap SystemCapability.Notification.Notification 538 * @since 9 539 */ 540 function cancel(id: number, label?: string): Promise<void>; 541 542 /** 543 * Cancel a notification with the representative and ID. 544 * 545 * @param { BundleOption } representativeBundle - bundle option of the representative. 546 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 547 * @returns { Promise<void> } The promise returned by the function. 548 * @throws { BusinessError } 202 - Not system application to call the interface. 549 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 550 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 551 * @throws { BusinessError } 1600001 - Internal error. 552 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 553 * @throws { BusinessError } 1600003 - Failed to connect to the service. 554 * @throws { BusinessError } 1600007 - The notification does not exist. 555 * @throws { BusinessError } 1600012 - No memory space. 556 * @throws { BusinessError } 1600017 - There is no corresponding agent relationship configuration. 557 * @syscap SystemCapability.Notification.Notification 558 * @systemapi 559 * @since 12 560 */ 561 function cancel(representativeBundle: BundleOption, id: number): Promise<void>; 562 563 /** 564 * Cancel a representative notification. 565 * 566 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 567 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 568 * @param { string } representativeBundle - bundle name of the representative. 569 * @param { number } userId - userid of the representative. 570 * @param { AsyncCallback<void> } callback - The callback of cancelAsBundle. 571 * @throws { BusinessError } 201 - Permission denied. 572 * @throws { BusinessError } 202 - Not system application to call the interface. 573 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 574 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 575 * @throws { BusinessError } 1600001 - Internal error. 576 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 577 * @throws { BusinessError } 1600003 - Failed to connect to the service. 578 * @throws { BusinessError } 1600007 - The notification does not exist. 579 * @throws { BusinessError } 1600008 - The user does not exist. 580 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 581 * @syscap SystemCapability.Notification.Notification 582 * @systemapi 583 * @since 9 584 */ 585 function cancelAsBundle( 586 id: number, 587 representativeBundle: string, 588 userId: number, 589 callback: AsyncCallback<void> 590 ): void; 591 592 /** 593 * Cancel a representative notification. 594 * 595 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 596 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 597 * @param { string } representativeBundle - bundle name of the representative. 598 * @param { number } userId - userid of the representative. 599 * @returns { Promise<void> } The promise returned by the function. 600 * @throws { BusinessError } 201 - Permission denied. 601 * @throws { BusinessError } 202 - Not system application to call the interface. 602 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 603 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 604 * @throws { BusinessError } 1600001 - Internal error. 605 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 606 * @throws { BusinessError } 1600003 - Failed to connect to the service. 607 * @throws { BusinessError } 1600007 - The notification does not exist. 608 * @throws { BusinessError } 1600008 - The user does not exist. 609 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 610 * @syscap SystemCapability.Notification.Notification 611 * @systemapi 612 * @since 9 613 */ 614 function cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise<void>; 615 616 /** 617 * Cancel a representative notification. 618 * 619 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 620 * @param { BundleOption } representativeBundle - bundle option of the representative. 621 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 622 * @returns { Promise<void> } The promise returned by the function. 623 * @throws { BusinessError } 201 - Permission denied. 624 * @throws { BusinessError } 202 - Not system application to call the interface. 625 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 626 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 627 * @throws { BusinessError } 1600001 - Internal error. 628 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 629 * @throws { BusinessError } 1600003 - Failed to connect to the service. 630 * @throws { BusinessError } 1600007 - The notification does not exist. 631 * @throws { BusinessError } 1600008 - The user does not exist. 632 * @throws { BusinessError } 1600012 - No memory space. 633 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 634 * @syscap SystemCapability.Notification.Notification 635 * @systemapi 636 * @since 12 637 */ 638 function cancelAsBundle(representativeBundle: BundleOption, id: number): Promise<void>; 639 640 /** 641 * Cancel all notifications of the current application. 642 * 643 * @param { AsyncCallback<void> } callback - The callback of cancelAll. 644 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 645 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 646 * @throws { BusinessError } 1600001 - Internal error. 647 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 648 * @throws { BusinessError } 1600003 - Failed to connect to the service. 649 * @syscap SystemCapability.Notification.Notification 650 * @since 9 651 */ 652 /** 653 * Cancel all notifications of the current application. 654 * 655 * @param { AsyncCallback<void> } callback - The callback of cancelAll. 656 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 657 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 658 * @throws { BusinessError } 1600001 - Internal error. 659 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 660 * @throws { BusinessError } 1600003 - Failed to connect to the service. 661 * @syscap SystemCapability.Notification.Notification 662 * @crossplatform 663 * @since 12 664 */ 665 function cancelAll(callback: AsyncCallback<void>): void; 666 667 /** 668 * Cancel all notifications of the current application. 669 * 670 * @returns { Promise<void> } The promise returned by the function. 671 * @throws { BusinessError } 1600001 - Internal error. 672 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 673 * @throws { BusinessError } 1600003 - Failed to connect to the service. 674 * @syscap SystemCapability.Notification.Notification 675 * @since 9 676 */ 677 /** 678 * Cancel all notifications of the current application. 679 * 680 * @returns { Promise<void> } The promise returned by the function. 681 * @throws { BusinessError } 1600001 - Internal error. 682 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 683 * @throws { BusinessError } 1600003 - Failed to connect to the service. 684 * @syscap SystemCapability.Notification.Notification 685 * @crossplatform 686 * @since 12 687 */ 688 function cancelAll(): Promise<void>; 689 690 /** 691 * Creates a notification slot. 692 * 693 * @permission ohos.permission.NOTIFICATION_CONTROLLER 694 * @param { NotificationSlot } slot - Indicates the notification slot to be created, which is set by {@link NotificationSlot}. 695 * @param { AsyncCallback<void> } callback - The callback of addSlot. 696 * @throws { BusinessError } 201 - Permission denied. 697 * @throws { BusinessError } 202 - Not system application to call the interface. 698 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 699 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 700 * @throws { BusinessError } 1600001 - Internal error. 701 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 702 * @throws { BusinessError } 1600003 - Failed to connect to the service. 703 * @throws { BusinessError } 1600012 - No memory space. 704 * @syscap SystemCapability.Notification.Notification 705 * @systemapi 706 * @since 9 707 */ 708 function addSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; 709 710 /** 711 * Creates a notification slot. 712 * 713 * @permission ohos.permission.NOTIFICATION_CONTROLLER 714 * @param { NotificationSlot } slot - Indicates the notification slot to be created, which is set by {@link NotificationSlot}. 715 * @returns { Promise<void> } The promise returned by the function. 716 * @throws { BusinessError } 201 - Permission denied. 717 * @throws { BusinessError } 202 - Not system application to call the interface. 718 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 719 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 720 * @throws { BusinessError } 1600001 - Internal error. 721 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 722 * @throws { BusinessError } 1600003 - Failed to connect to the service. 723 * @throws { BusinessError } 1600012 - No memory space. 724 * @syscap SystemCapability.Notification.Notification 725 * @systemapi 726 * @since 9 727 */ 728 function addSlot(slot: NotificationSlot): Promise<void>; 729 730 /** 731 * Adds a slot type. 732 * 733 * @param { SlotType } type - Slot type to add. 734 * @param { AsyncCallback<void> } callback - The callback of addSlot. 735 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 736 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 737 * @throws { BusinessError } 1600001 - Internal error. 738 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 739 * @throws { BusinessError } 1600003 - Failed to connect to the service. 740 * @throws { BusinessError } 1600012 - No memory space. 741 * @syscap SystemCapability.Notification.Notification 742 * @since 9 743 */ 744 function addSlot(type: SlotType, callback: AsyncCallback<void>): void; 745 746 /** 747 * Adds a slot type. 748 * 749 * @param { SlotType } type - Slot type to add. 750 * @returns { Promise<void> } The promise returned by the function. 751 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 752 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 753 * @throws { BusinessError } 1600001 - Internal error. 754 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 755 * @throws { BusinessError } 1600003 - Failed to connect to the service. 756 * @throws { BusinessError } 1600012 - No memory space. 757 * @syscap SystemCapability.Notification.Notification 758 * @since 9 759 */ 760 function addSlot(type: SlotType): Promise<void>; 761 762 /** 763 * Creates notification slots. 764 * 765 * @permission ohos.permission.NOTIFICATION_CONTROLLER 766 * @param { Array<NotificationSlot> } slots - Indicates the notification slots to be created, which is set by {@link NotificationSlot}. 767 * @param { AsyncCallback<void> } callback - The callback of addSlots. 768 * @throws { BusinessError } 201 - Permission denied. 769 * @throws { BusinessError } 202 - Not system application to call the interface. 770 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 771 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 772 * @throws { BusinessError } 1600001 - Internal error. 773 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 774 * @throws { BusinessError } 1600003 - Failed to connect to the service. 775 * @throws { BusinessError } 1600012 - No memory space. 776 * @syscap SystemCapability.Notification.Notification 777 * @systemapi 778 * @since 9 779 */ 780 function addSlots(slots: Array<NotificationSlot>, callback: AsyncCallback<void>): void; 781 782 /** 783 * Creates notification slots. 784 * 785 * @permission ohos.permission.NOTIFICATION_CONTROLLER 786 * @param { Array<NotificationSlot> } slots - Indicates the notification slots to be created, which is set by {@link NotificationSlot}. 787 * @returns { Promise<void> } The promise returned by the function. 788 * @throws { BusinessError } 201 - Permission denied. 789 * @throws { BusinessError } 202 - Not system application to call the interface. 790 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 791 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 792 * @throws { BusinessError } 1600001 - Internal error. 793 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 794 * @throws { BusinessError } 1600003 - Failed to connect to the service. 795 * @throws { BusinessError } 1600012 - No memory space. 796 * @syscap SystemCapability.Notification.Notification 797 * @systemapi 798 * @since 9 799 */ 800 function addSlots(slots: Array<NotificationSlot>): Promise<void>; 801 802 /** 803 * Obtains a notification slot of the specified slot type. 804 * 805 * @param { SlotType } slotType - Type of the notification slot to obtain. 806 * @param { AsyncCallback<NotificationSlot> } callback - The callback is used to return the NotificationSlot. 807 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 808 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 809 * @throws { BusinessError } 1600001 - Internal error. 810 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 811 * @throws { BusinessError } 1600003 - Failed to connect to the service. 812 * @syscap SystemCapability.Notification.Notification 813 * @since 9 814 */ 815 function getSlot(slotType: SlotType, callback: AsyncCallback<NotificationSlot>): void; 816 817 /** 818 * Obtains a notification slot of the specified slot type. 819 * 820 * @param { SlotType } slotType - Type of the notification slot to obtain. 821 * @returns { Promise<NotificationSlot> } Returns the NotificationSlot. 822 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 823 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 824 * @throws { BusinessError } 1600001 - Internal error. 825 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 826 * @throws { BusinessError } 1600003 - Failed to connect to the service. 827 * @syscap SystemCapability.Notification.Notification 828 * @since 9 829 */ 830 function getSlot(slotType: SlotType): Promise<NotificationSlot>; 831 832 /** 833 * Obtains all NotificationSlot objects created by the current application. 834 * 835 * @param { AsyncCallback<Array<NotificationSlot>> } callback - The callback is used to return all notification slots 836 * of this application. 837 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 838 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 839 * @throws { BusinessError } 1600001 - Internal error. 840 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 841 * @throws { BusinessError } 1600003 - Failed to connect to the service. 842 * @syscap SystemCapability.Notification.Notification 843 * @since 9 844 */ 845 function getSlots(callback: AsyncCallback<Array<NotificationSlot>>): void; 846 847 /** 848 * Obtains all NotificationSlot objects created by the current application. 849 * 850 * @returns { Promise<Array<NotificationSlot>> } Returns all notification slots of this application. 851 * @throws { BusinessError } 1600001 - Internal error. 852 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 853 * @throws { BusinessError } 1600003 - Failed to connect to the service. 854 * @syscap SystemCapability.Notification.Notification 855 * @since 9 856 */ 857 function getSlots(): Promise<Array<NotificationSlot>>; 858 859 /** 860 * Obtains allow notification application list. 861 * 862 * @permission ohos.permission.NOTIFICATION_CONTROLLER 863 * @returns { Promise<Array<BundleOption>> } Returns all enable notification applications. 864 * @throws { BusinessError } 201 - Permission denied. 865 * @throws { BusinessError } 202 - Not system application to call the interface. 866 * @throws { BusinessError } 1600001 - Internal error. 867 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 868 * @throws { BusinessError } 1600003 - Failed to connect to the service. 869 * @syscap SystemCapability.Notification.Notification 870 * @systemapi 871 * @since 12 872 */ 873 function getAllNotificationEnabledBundles(): Promise<Array<BundleOption>>; 874 875 /** 876 * Removes a NotificationSlot of the specified SlotType created by the current application. 877 * 878 * @param { SlotType } slotType - Type of the NotificationSlot to remove. 879 * @param { AsyncCallback<void> } callback - The callback of removeSlot. 880 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 881 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 882 * @throws { BusinessError } 1600001 - Internal error. 883 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 884 * @throws { BusinessError } 1600003 - Failed to connect to the service. 885 * @syscap SystemCapability.Notification.Notification 886 * @since 9 887 */ 888 function removeSlot(slotType: SlotType, callback: AsyncCallback<void>): void; 889 890 /** 891 * Removes a NotificationSlot of the specified SlotType created by the current application. 892 * 893 * @param { SlotType } slotType - Type of the NotificationSlot to remove. 894 * @returns { Promise<void> } The promise returned by the function. 895 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 896 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 897 * @throws { BusinessError } 1600001 - Internal error. 898 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 899 * @throws { BusinessError } 1600003 - Failed to connect to the service. 900 * @syscap SystemCapability.Notification.Notification 901 * @since 9 902 */ 903 function removeSlot(slotType: SlotType): Promise<void>; 904 905 /** 906 * Removes all NotificationSlot objects created by the current application. 907 * 908 * @param { AsyncCallback<void> } callback - The callback of removeAllSlots. 909 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 910 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 911 * @throws { BusinessError } 1600001 - Internal error. 912 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 913 * @throws { BusinessError } 1600003 - Failed to connect to the service. 914 * @syscap SystemCapability.Notification.Notification 915 * @since 9 916 */ 917 function removeAllSlots(callback: AsyncCallback<void>): void; 918 919 /** 920 * Removes all NotificationSlot objects created by the current application. 921 * 922 * @returns { Promise<void> } The promise returned by the function. 923 * @throws { BusinessError } 1600001 - Internal error. 924 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 925 * @throws { BusinessError } 1600003 - Failed to connect to the service. 926 * @syscap SystemCapability.Notification.Notification 927 * @since 9 928 */ 929 function removeAllSlots(): Promise<void>; 930 931 /** 932 * Set whether the application can send notifications. 933 * 934 * @permission ohos.permission.NOTIFICATION_CONTROLLER 935 * @param { BundleOption } bundle - The bundle option. 936 * @param { boolean } enable - Set enable or not. 937 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnable. 938 * @throws { BusinessError } 201 - Permission denied. 939 * @throws { BusinessError } 202 - Not system application to call the interface. 940 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 941 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 942 * @throws { BusinessError } 1600001 - Internal error. 943 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 944 * @throws { BusinessError } 1600003 - Failed to connect to the service. 945 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 946 * @syscap SystemCapability.Notification.Notification 947 * @systemapi 948 * @since 9 949 */ 950 function setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 951 952 /** 953 * Set whether the application can send notifications. 954 * 955 * @permission ohos.permission.NOTIFICATION_CONTROLLER 956 * @param { BundleOption } bundle - The bundle option. 957 * @param { boolean } enable - Set enable or not. 958 * @returns { Promise<void> } The promise returned by the function. 959 * @throws { BusinessError } 201 - Permission denied. 960 * @throws { BusinessError } 202 - Not system application to call the interface. 961 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 962 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 963 * @throws { BusinessError } 1600001 - Internal error. 964 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 965 * @throws { BusinessError } 1600003 - Failed to connect to the service. 966 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 967 * @syscap SystemCapability.Notification.Notification 968 * @systemapi 969 * @since 9 970 */ 971 function setNotificationEnable(bundle: BundleOption, enable: boolean): Promise<void>; 972 973 /** 974 * Checks whether this application allows to publish notifications. 975 * 976 * @permission ohos.permission.NOTIFICATION_CONTROLLER 977 * @param { BundleOption } bundle - The bundle option. 978 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 979 * @throws { BusinessError } 201 - Permission denied. 980 * @throws { BusinessError } 202 - Not system application to call the interface. 981 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 982 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 983 * @throws { BusinessError } 1600001 - Internal error. 984 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 985 * @throws { BusinessError } 1600003 - Failed to connect to the service. 986 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 987 * @syscap SystemCapability.Notification.Notification 988 * @systemapi 989 * @since 9 990 */ 991 function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 992 993 /** 994 * Checks whether this application allows to publish notifications. 995 * 996 * @permission ohos.permission.NOTIFICATION_CONTROLLER 997 * @param { BundleOption } bundle - The bundle option. 998 * @returns { Promise<boolean> } The promise returned by the function. 999 * @throws { BusinessError } 201 - Permission denied. 1000 * @throws { BusinessError } 202 - Not system application to call the interface. 1001 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1002 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1003 * @throws { BusinessError } 1600001 - Internal error. 1004 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1005 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1006 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1007 * @syscap SystemCapability.Notification.Notification 1008 * @systemapi 1009 * @since 9 1010 */ 1011 function isNotificationEnabled(bundle: BundleOption): Promise<boolean>; 1012 1013 /** 1014 * Checks whether this application allows to publish notifications. 1015 * 1016 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1017 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 1018 * @throws { BusinessError } 201 - Permission denied. 1019 * @throws { BusinessError } 202 - Not system application to call the interface. 1020 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1021 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1022 * @throws { BusinessError } 1600001 - Internal error. 1023 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1024 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1025 * @syscap SystemCapability.Notification.Notification 1026 * @systemapi 1027 * @since 9 1028 */ 1029 /** 1030 * Checks whether this application allows to publish notifications. 1031 * 1032 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 1033 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1034 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1035 * @throws { BusinessError } 1600001 - Internal error. 1036 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1037 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1038 * @throws { BusinessError } 1600008 - The user does not exist. 1039 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1040 * @syscap SystemCapability.Notification.Notification 1041 * @since 11 1042 */ 1043 /** 1044 * Checks whether this application allows to publish notifications. 1045 * 1046 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 1047 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1048 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1049 * @throws { BusinessError } 1600001 - Internal error. 1050 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1051 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1052 * @throws { BusinessError } 1600008 - The user does not exist. 1053 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1054 * @syscap SystemCapability.Notification.Notification 1055 * @crossplatform 1056 * @since 12 1057 */ 1058 function isNotificationEnabled(callback: AsyncCallback<boolean>): void; 1059 1060 /** 1061 * Checks whether this application allows to publish notifications. 1062 * 1063 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1064 * @returns { Promise<boolean> } The promise returned by the function. 1065 * @throws { BusinessError } 201 - Permission denied. 1066 * @throws { BusinessError } 202 - Not system application to call the interface. 1067 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1068 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1069 * @throws { BusinessError } 1600001 - Internal error. 1070 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1071 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1072 * @syscap SystemCapability.Notification.Notification 1073 * @systemapi 1074 * @since 9 1075 */ 1076 /** 1077 * Checks whether this application allows to publish notifications. 1078 * 1079 * @returns { Promise<boolean> } The promise returned by the function. 1080 * @throws { BusinessError } 1600001 - Internal error. 1081 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1082 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1083 * @throws { BusinessError } 1600008 - The user does not exist. 1084 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1085 * @syscap SystemCapability.Notification.Notification 1086 * @since 11 1087 */ 1088 /** 1089 * Checks whether this application allows to publish notifications. 1090 * 1091 * @returns { Promise<boolean> } The promise returned by the function. 1092 * @throws { BusinessError } 1600001 - Internal error. 1093 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1094 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1095 * @throws { BusinessError } 1600008 - The user does not exist. 1096 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1097 * @syscap SystemCapability.Notification.Notification 1098 * @crossplatform 1099 * @since 12 1100 */ 1101 function isNotificationEnabled(): Promise<boolean>; 1102 1103 /** 1104 * Checks whether this application allows to publish notifications. 1105 * 1106 * @returns { boolean } Returned by the function. 1107 * @throws { BusinessError } 1600001 - Internal error. 1108 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1109 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1110 * @syscap SystemCapability.Notification.Notification 1111 * @since 12 1112 */ 1113 function isNotificationEnabledSync(): boolean; 1114 1115 /** 1116 * Checks whether this application allows to publish notifications under the user. 1117 * 1118 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1119 * @param { number } userId - The userid of the representative. 1120 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 1121 * @throws { BusinessError } 201 - Permission denied. 1122 * @throws { BusinessError } 202 - Not system application to call the interface. 1123 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1124 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1125 * @throws { BusinessError } 1600001 - Internal error. 1126 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1127 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1128 * @throws { BusinessError } 1600008 - The user does not exist. 1129 * @syscap SystemCapability.Notification.Notification 1130 * @systemapi 1131 * @since 9 1132 */ 1133 function isNotificationEnabled(userId: number, callback: AsyncCallback<boolean>): void; 1134 1135 /** 1136 * Checks whether this application allows to publish notifications under the user. 1137 * 1138 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1139 * @param { number } userId - The userid of the representative. 1140 * @returns { Promise<boolean> } The promise returned by the function. 1141 * @throws { BusinessError } 201 - Permission denied. 1142 * @throws { BusinessError } 202 - Not system application to call the interface. 1143 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1144 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1145 * @throws { BusinessError } 1600001 - Internal error. 1146 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1147 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1148 * @throws { BusinessError } 1600008 - The user does not exist. 1149 * @syscap SystemCapability.Notification.Notification 1150 * @systemapi 1151 * @since 9 1152 */ 1153 function isNotificationEnabled(userId: number): Promise<boolean>; 1154 1155 /** 1156 * Sets whether to allow the specified application to show badge. 1157 * 1158 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1159 * @param { BundleOption } bundle - The bundle option. 1160 * @param { boolean } enable - Set enable or not. 1161 * @param { AsyncCallback<void> } callback - The callback of displayBadge. 1162 * @throws { BusinessError } 201 - Permission denied. 1163 * @throws { BusinessError } 202 - Not system application to call the interface. 1164 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1165 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1166 * @throws { BusinessError } 1600001 - Internal error. 1167 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1168 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1169 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1170 * @syscap SystemCapability.Notification.Notification 1171 * @systemapi 1172 * @since 9 1173 */ 1174 /** 1175 * Sets whether to allow the specified application to show badge. 1176 * 1177 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1178 * @param { BundleOption } bundle - The bundle option. 1179 * @param { boolean } enable - Set enable or not. 1180 * @param { AsyncCallback<void> } callback - The callback of displayBadge. 1181 * @throws { BusinessError } 201 - Permission denied. 1182 * @throws { BusinessError } 202 - Not system application to call the interface. 1183 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1184 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1185 * @throws { BusinessError } 801 - Capability not supported. 1186 * @throws { BusinessError } 1600001 - Internal error. 1187 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1188 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1189 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1190 * @syscap SystemCapability.Notification.Notification 1191 * @systemapi 1192 * @since 18 1193 */ 1194 function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 1195 1196 /** 1197 * Sets whether to allow the specified application to show badge. 1198 * 1199 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1200 * @param { BundleOption } bundle - The bundle option. 1201 * @param { boolean } enable - Set enable or not. 1202 * @returns { Promise<void> } The promise returned by the function. 1203 * @throws { BusinessError } 201 - Permission denied. 1204 * @throws { BusinessError } 202 - Not system application to call the interface. 1205 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1206 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1207 * @throws { BusinessError } 1600001 - Internal error. 1208 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1209 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1210 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1211 * @syscap SystemCapability.Notification.Notification 1212 * @systemapi 1213 * @since 9 1214 */ 1215 /** 1216 * Sets whether to allow the specified application to show badge. 1217 * 1218 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1219 * @param { BundleOption } bundle - The bundle option. 1220 * @param { boolean } enable - Set enable or not. 1221 * @returns { Promise<void> } The promise returned by the function. 1222 * @throws { BusinessError } 201 - Permission denied. 1223 * @throws { BusinessError } 202 - Not system application to call the interface. 1224 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1225 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1226 * @throws { BusinessError } 801 - Capability not supported. 1227 * @throws { BusinessError } 1600001 - Internal error. 1228 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1229 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1230 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1231 * @syscap SystemCapability.Notification.Notification 1232 * @systemapi 1233 * @since 18 1234 */ 1235 function displayBadge(bundle: BundleOption, enable: boolean): Promise<void>; 1236 1237 /** 1238 * Obtains the flag that whether to allow the application to show badge. 1239 * 1240 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1241 * @param { BundleOption } bundle - The bundle option. 1242 * @param { AsyncCallback<boolean> } callback - The callback of isBadgeDisplayed. 1243 * @throws { BusinessError } 201 - Permission denied. 1244 * @throws { BusinessError } 202 - Not system application to call the interface. 1245 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1246 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1247 * @throws { BusinessError } 1600001 - Internal error. 1248 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1249 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1250 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1251 * @syscap SystemCapability.Notification.Notification 1252 * @systemapi 1253 * @since 9 1254 */ 1255 /** 1256 * Obtains the flag that whether to allow the application to show badge. 1257 * 1258 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1259 * @param { BundleOption } bundle - The bundle option. 1260 * @param { AsyncCallback<boolean> } callback - The callback of isBadgeDisplayed. 1261 * @throws { BusinessError } 201 - Permission denied. 1262 * @throws { BusinessError } 202 - Not system application to call the interface. 1263 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1264 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1265 * @throws { BusinessError } 801 - Capability not supported. 1266 * @throws { BusinessError } 1600001 - Internal error. 1267 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1268 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1269 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1270 * @syscap SystemCapability.Notification.Notification 1271 * @systemapi 1272 * @since 18 1273 */ 1274 function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 1275 1276 /** 1277 * Obtains the flag that whether to allow the application to show badge. 1278 * 1279 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1280 * @param { BundleOption } bundle - The bundle option. 1281 * @returns { Promise<boolean> } The promise returned by the function. 1282 * @throws { BusinessError } 201 - Permission denied. 1283 * @throws { BusinessError } 202 - Not system application to call the interface. 1284 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1285 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1286 * @throws { BusinessError } 1600001 - Internal error. 1287 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1288 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1289 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1290 * @syscap SystemCapability.Notification.Notification 1291 * @systemapi 1292 * @since 9 1293 */ 1294 /** 1295 * Obtains the flag that whether to allow the application to show badge. 1296 * 1297 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1298 * @param { BundleOption } bundle - The bundle option. 1299 * @returns { Promise<boolean> } The promise returned by the function. 1300 * @throws { BusinessError } 201 - Permission denied. 1301 * @throws { BusinessError } 202 - Not system application to call the interface. 1302 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1303 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1304 * @throws { BusinessError } 801 - Capability not supported. 1305 * @throws { BusinessError } 1600001 - Internal error. 1306 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1307 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1308 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1309 * @syscap SystemCapability.Notification.Notification 1310 * @systemapi 1311 * @since 18 1312 */ 1313 function isBadgeDisplayed(bundle: BundleOption): Promise<boolean>; 1314 1315 /** 1316 * Update all notification slots for the specified bundle. 1317 * 1318 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1319 * @param { BundleOption } bundle - The bundle option. 1320 * @param { NotificationSlot } slot - Indicates the notification slot. 1321 * @param { AsyncCallback<void> } callback - The callback of setSlotByBundle. 1322 * @throws { BusinessError } 201 - Permission denied. 1323 * @throws { BusinessError } 202 - Not system application to call the interface. 1324 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1325 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1326 * @throws { BusinessError } 1600001 - Internal error. 1327 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1328 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1329 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1330 * @syscap SystemCapability.Notification.Notification 1331 * @systemapi 1332 * @since 9 1333 */ 1334 /** 1335 * Update all notification slots for the specified bundle. 1336 * 1337 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1338 * @param { BundleOption } bundle - The bundle option. 1339 * @param { NotificationSlot } slot - Indicates the notification slot. 1340 * @param { AsyncCallback<void> } callback - The callback of setSlotByBundle. 1341 * @throws { BusinessError } 201 - Permission denied. 1342 * @throws { BusinessError } 202 - Not system application to call the interface. 1343 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1344 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1345 * @throws { BusinessError } 801 - Capability not supported. 1346 * @throws { BusinessError } 1600001 - Internal error. 1347 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1348 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1349 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1350 * @syscap SystemCapability.Notification.Notification 1351 * @systemapi 1352 * @since 18 1353 */ 1354 function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback<void>): void; 1355 1356 /** 1357 * Update all notification slots for the specified bundle. 1358 * 1359 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1360 * @param { BundleOption } bundle - The bundle option. 1361 * @param { NotificationSlot } slot - Indicates the notification slot. 1362 * @returns { Promise<void> } The promise returned by the function. 1363 * @throws { BusinessError } 201 - Permission denied. 1364 * @throws { BusinessError } 202 - Not system application to call the interface. 1365 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1366 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1367 * @throws { BusinessError } 1600001 - Internal error. 1368 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1369 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1370 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1371 * @syscap SystemCapability.Notification.Notification 1372 * @systemapi 1373 * @since 9 1374 */ 1375 /** 1376 * Update all notification slots for the specified bundle. 1377 * 1378 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1379 * @param { BundleOption } bundle - The bundle option. 1380 * @param { NotificationSlot } slot - Indicates the notification slot. 1381 * @returns { Promise<void> } The promise returned by the function. 1382 * @throws { BusinessError } 201 - Permission denied. 1383 * @throws { BusinessError } 202 - Not system application to call the interface. 1384 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1385 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1386 * @throws { BusinessError } 801 - Capability not supported. 1387 * @throws { BusinessError } 1600001 - Internal error. 1388 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1389 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1390 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1391 * @syscap SystemCapability.Notification.Notification 1392 * @systemapi 1393 * @since 18 1394 */ 1395 function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise<void>; 1396 1397 /** 1398 * Obtains all notification slots belonging to the specified bundle. 1399 * 1400 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1401 * @param { BundleOption } bundle - The bundle option. 1402 * @param { AsyncCallback<Array<NotificationSlot>> } callback - The callback of getSlotsByBundle. 1403 * @throws { BusinessError } 201 - Permission denied. 1404 * @throws { BusinessError } 202 - Not system application to call the interface. 1405 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1406 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1407 * @throws { BusinessError } 1600001 - Internal error. 1408 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1409 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1410 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1411 * @syscap SystemCapability.Notification.Notification 1412 * @systemapi 1413 * @since 9 1414 */ 1415 /** 1416 * Obtains all notification slots belonging to the specified bundle. 1417 * 1418 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1419 * @param { BundleOption } bundle - The bundle option. 1420 * @param { AsyncCallback<Array<NotificationSlot>> } callback - The callback of getSlotsByBundle. 1421 * @throws { BusinessError } 201 - Permission denied. 1422 * @throws { BusinessError } 202 - Not system application to call the interface. 1423 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1424 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1425 * @throws { BusinessError } 801 - Capability not supported. 1426 * @throws { BusinessError } 1600001 - Internal error. 1427 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1428 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1429 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1430 * @syscap SystemCapability.Notification.Notification 1431 * @systemapi 1432 * @since 18 1433 */ 1434 function getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array<NotificationSlot>>): void; 1435 1436 /** 1437 * Get notification slot for the specified bundle. 1438 * 1439 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1440 * @param { BundleOption } bundle - The bundle option. 1441 * @param { SlotType } slotType - Indicates the notification slot. 1442 * @returns { Promise<NotificationSlot> } Returns the NotificationSlot. 1443 * @throws { BusinessError } 201 - Permission denied. 1444 * @throws { BusinessError } 202 - Not system application to call the interface. 1445 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1446 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1447 * @throws { BusinessError } 1600001 - Internal error. 1448 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1449 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1450 * @throws { BusinessError } 1600012 - No memory space. 1451 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1452 * @syscap SystemCapability.Notification.Notification 1453 * @systemapi 1454 * @since 12 1455 */ 1456 /** 1457 * Get notification slot for the specified bundle. 1458 * 1459 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1460 * @param { BundleOption } bundle - The bundle option. 1461 * @param { SlotType } slotType - Indicates the notification slot. 1462 * @returns { Promise<NotificationSlot> } Returns the NotificationSlot. 1463 * @throws { BusinessError } 201 - Permission denied. 1464 * @throws { BusinessError } 202 - Not system application to call the interface. 1465 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1466 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1467 * @throws { BusinessError } 801 - Capability not supported. 1468 * @throws { BusinessError } 1600001 - Internal error. 1469 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1470 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1471 * @throws { BusinessError } 1600012 - No memory space. 1472 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1473 * @syscap SystemCapability.Notification.Notification 1474 * @systemapi 1475 * @since 18 1476 */ 1477 function getSlotByBundle(bundle: BundleOption, slotType: SlotType): Promise<NotificationSlot>; 1478 1479 /** 1480 * Obtains all notification slots belonging to the specified bundle. 1481 * 1482 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1483 * @param { BundleOption } bundle - The bundle option. 1484 * @returns { Promise<Array<NotificationSlot>> } The promise returned by the function. 1485 * @throws { BusinessError } 201 - Permission denied. 1486 * @throws { BusinessError } 202 - Not system application to call the interface. 1487 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1488 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1489 * @throws { BusinessError } 1600001 - Internal error. 1490 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1491 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1492 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1493 * @syscap SystemCapability.Notification.Notification 1494 * @systemapi 1495 * @since 9 1496 */ 1497 /** 1498 * Obtains all notification slots belonging to the specified bundle. 1499 * 1500 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1501 * @param { BundleOption } bundle - The bundle option. 1502 * @returns { Promise<Array<NotificationSlot>> } The promise returned by the function. 1503 * @throws { BusinessError } 201 - Permission denied. 1504 * @throws { BusinessError } 202 - Not system application to call the interface. 1505 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1506 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1507 * @throws { BusinessError } 801 - Capability not supported. 1508 * @throws { BusinessError } 1600001 - Internal error. 1509 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1510 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1511 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1512 * @syscap SystemCapability.Notification.Notification 1513 * @systemapi 1514 * @since 18 1515 */ 1516 function getSlotsByBundle(bundle: BundleOption): Promise<Array<NotificationSlot>>; 1517 1518 /** 1519 * Obtains number of slot. 1520 * 1521 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1522 * @param { BundleOption } bundle - The bundle option. 1523 * @param { AsyncCallback<number> } callback - The callback of getSlotNumByBundle. 1524 * @throws { BusinessError } 201 - Permission denied. 1525 * @throws { BusinessError } 202 - Not system application to call the interface. 1526 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1527 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1528 * @throws { BusinessError } 1600001 - Internal error. 1529 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1530 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1531 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1532 * @syscap SystemCapability.Notification.Notification 1533 * @systemapi 1534 * @since 9 1535 */ 1536 /** 1537 * Obtains number of slot. 1538 * 1539 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1540 * @param { BundleOption } bundle - The bundle option. 1541 * @param { AsyncCallback<number> } callback - The callback of getSlotNumByBundle. 1542 * @throws { BusinessError } 201 - Permission denied. 1543 * @throws { BusinessError } 202 - Not system application to call the interface. 1544 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1545 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1546 * @throws { BusinessError } 801 - Capability not supported. 1547 * @throws { BusinessError } 1600001 - Internal error. 1548 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1549 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1550 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1551 * @syscap SystemCapability.Notification.Notification 1552 * @systemapi 1553 * @since 18 1554 */ 1555 function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback<number>): void; 1556 1557 /** 1558 * Obtains number of slot. 1559 * 1560 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1561 * @param { BundleOption } bundle - The bundle option. 1562 * @returns { Promise<number> } The promise returned by the function. 1563 * @throws { BusinessError } 201 - Permission denied. 1564 * @throws { BusinessError } 202 - Not system application to call the interface. 1565 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1566 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1567 * @throws { BusinessError } 1600001 - Internal error. 1568 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1569 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1570 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1571 * @syscap SystemCapability.Notification.Notification 1572 * @systemapi 1573 * @since 9 1574 */ 1575 /** 1576 * Obtains number of slot. 1577 * 1578 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1579 * @param { BundleOption } bundle - The bundle option. 1580 * @returns { Promise<number> } The promise returned by the function. 1581 * @throws { BusinessError } 201 - Permission denied. 1582 * @throws { BusinessError } 202 - Not system application to call the interface. 1583 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1584 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1585 * @throws { BusinessError } 801 - Capability not supported. 1586 * @throws { BusinessError } 1600001 - Internal error. 1587 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1588 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1589 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1590 * @syscap SystemCapability.Notification.Notification 1591 * @systemapi 1592 * @since 18 1593 */ 1594 function getSlotNumByBundle(bundle: BundleOption): Promise<number>; 1595 1596 /** 1597 * Obtains all active notifications in the current system. The caller must have system permissions to 1598 * call this method. 1599 * 1600 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1601 * @param { AsyncCallback<Array<NotificationRequest>> } callback - The callback of getAllActiveNotifications. 1602 * @throws { BusinessError } 201 - Permission denied. 1603 * @throws { BusinessError } 202 - Not system application to call the interface. 1604 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1605 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1606 * @throws { BusinessError } 1600001 - Internal error. 1607 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1608 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1609 * @syscap SystemCapability.Notification.Notification 1610 * @systemapi 1611 * @since 9 1612 */ 1613 function getAllActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 1614 1615 /** 1616 * Obtains all active notifications in the current system. The caller must have system permissions to 1617 * call this method. 1618 * 1619 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1620 * @returns { Promise<Array<NotificationRequest>> } The promise returned by the function. 1621 * @throws { BusinessError } 201 - Permission denied. 1622 * @throws { BusinessError } 202 - Not system application to call the interface. 1623 * @throws { BusinessError } 1600001 - Internal error. 1624 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1625 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1626 * @syscap SystemCapability.Notification.Notification 1627 * @systemapi 1628 * @since 9 1629 */ 1630 function getAllActiveNotifications(): Promise<Array<NotificationRequest>>; 1631 1632 /** 1633 * Obtains the number of all active notifications. 1634 * 1635 * @param { AsyncCallback<number> } callback - The callback of getActiveNotificationCount. 1636 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1637 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1638 * @throws { BusinessError } 1600001 - Internal error. 1639 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1640 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1641 * @syscap SystemCapability.Notification.Notification 1642 * @since 9 1643 */ 1644 function getActiveNotificationCount(callback: AsyncCallback<number>): void; 1645 1646 /** 1647 * Obtains the number of all active notifications. 1648 * 1649 * @returns { Promise<number> } The promise returned by the function. 1650 * @throws { BusinessError } 1600001 - Internal error. 1651 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1652 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1653 * @syscap SystemCapability.Notification.Notification 1654 * @since 9 1655 */ 1656 function getActiveNotificationCount(): Promise<number>; 1657 1658 /** 1659 * Obtains an array of active notifications. 1660 * 1661 * @param { AsyncCallback<Array<NotificationRequest>> } callback - The callback of getActiveNotifications. 1662 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1663 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1664 * @throws { BusinessError } 1600001 - Internal error. 1665 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1666 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1667 * @syscap SystemCapability.Notification.Notification 1668 * @since 9 1669 */ 1670 function getActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 1671 1672 /** 1673 * Obtains an array of active notifications. 1674 * 1675 * @returns { Promise<Array<NotificationRequest>> } The promise returned by the function. 1676 * @throws { BusinessError } 1600001 - Internal error. 1677 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1678 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1679 * @syscap SystemCapability.Notification.Notification 1680 * @since 9 1681 */ 1682 function getActiveNotifications(): Promise<Array<NotificationRequest>>; 1683 1684 /** 1685 * Get the live view notification by bundle option and notification key. If the extraInfoKeys is provided, 1686 * filter the additional information of the live view notification and return the filtered result. 1687 * 1688 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1689 * @param { NotificationFilter } filter - The bundle, notification key and additional information filter of the live view notification. 1690 * @param { AsyncCallback<NotificationRequest> } callback - The callback of getActiveNotificationByFilter. 1691 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1692 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1693 * @throws { BusinessError } 1600007 - The notification does not exist. 1694 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1695 * @syscap SystemCapability.Notification.Notification 1696 * @systemapi 1697 * @since 11 1698 */ 1699 function getActiveNotificationByFilter(filter: NotificationFilter, callback: AsyncCallback<NotificationRequest>): void; 1700 1701 /** 1702 * Get the live view notification by bundle option and notification key. If the extraInfoKeys is provided, 1703 * filter the additional information of the live view notification and return the filtered result. 1704 * 1705 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1706 * @param { NotificationFilter } filter - The bundle, notification key and additional information filter of the live view notification. 1707 * @returns { Promise<NotificationRequest> } The promise returned by the function. 1708 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1709 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1710 * @throws { BusinessError } 1600007 - The notification does not exist. 1711 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1712 * @syscap SystemCapability.Notification.Notification 1713 * @systemapi 1714 * @since 11 1715 */ 1716 function getActiveNotificationByFilter(filter: NotificationFilter): Promise<NotificationRequest>; 1717 1718 /** 1719 * Cancel the notification of a specified group for this application. 1720 * 1721 * @param { string } groupName - The name of the group. 1722 * @param { AsyncCallback<void> } callback - The callback of cancelGroup. 1723 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1724 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1725 * @throws { BusinessError } 1600001 - Internal error. 1726 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1727 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1728 * @syscap SystemCapability.Notification.Notification 1729 * @since 9 1730 */ 1731 function cancelGroup(groupName: string, callback: AsyncCallback<void>): void; 1732 1733 /** 1734 * Cancel the notification of a specified group for this application. 1735 * 1736 * @param { string } groupName - The name of the group. 1737 * @returns { Promise<void> } The promise returned by the function. 1738 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1739 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1740 * @throws { BusinessError } 1600001 - Internal error. 1741 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1742 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1743 * @syscap SystemCapability.Notification.Notification 1744 * @since 9 1745 */ 1746 function cancelGroup(groupName: string): Promise<void>; 1747 1748 /** 1749 * Delete the notification of a specified group for this application. 1750 * 1751 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1752 * @param { BundleOption } bundle - The bundle option. 1753 * @param { string } groupName - The name of the group. 1754 * @param { AsyncCallback<void> } callback - The callback of removeGroupByBundle. 1755 * @throws { BusinessError } 201 - Permission denied. 1756 * @throws { BusinessError } 202 - Not system application to call the interface. 1757 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1758 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1759 * @throws { BusinessError } 1600001 - Internal error. 1760 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1761 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1762 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1763 * @syscap SystemCapability.Notification.Notification 1764 * @systemapi 1765 * @since 9 1766 */ 1767 function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback<void>): void; 1768 1769 /** 1770 * Delete the notification of a specified group for this application. 1771 * 1772 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1773 * @param { BundleOption } bundle - The bundle option. 1774 * @param { string } groupName - The name of the group. 1775 * @returns { Promise<void> } The promise returned by the function. 1776 * @throws { BusinessError } 201 - Permission denied. 1777 * @throws { BusinessError } 202 - Not system application to call the interface. 1778 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1779 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1780 * @throws { BusinessError } 1600001 - Internal error. 1781 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1782 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1783 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1784 * @syscap SystemCapability.Notification.Notification 1785 * @systemapi 1786 * @since 9 1787 */ 1788 function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise<void>; 1789 1790 /** 1791 * Set the Do Not Disturb date. 1792 * 1793 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1794 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1795 * @param { AsyncCallback<void> } callback - The callback of setDoNotDisturbDate. 1796 * @throws { BusinessError } 201 - Permission denied. 1797 * @throws { BusinessError } 202 - Not system application to call the interface. 1798 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1799 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1800 * @throws { BusinessError } 1600001 - Internal error. 1801 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1802 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1803 * @throws { BusinessError } 1600012 - No memory space. 1804 * @syscap SystemCapability.Notification.Notification 1805 * @systemapi 1806 * @since 9 1807 */ 1808 /** 1809 * Set the Do Not Disturb date. 1810 * 1811 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1812 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1813 * @param { AsyncCallback<void> } callback - The callback of setDoNotDisturbDate. 1814 * @throws { BusinessError } 201 - Permission denied. 1815 * @throws { BusinessError } 202 - Not system application to call the interface. 1816 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1817 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1818 * @throws { BusinessError } 801 - Capability not supported. 1819 * @throws { BusinessError } 1600001 - Internal error. 1820 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1821 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1822 * @throws { BusinessError } 1600012 - No memory space. 1823 * @syscap SystemCapability.Notification.Notification 1824 * @systemapi 1825 * @since 18 1826 */ 1827 function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback<void>): void; 1828 1829 /** 1830 * Set the Do Not Disturb date. 1831 * 1832 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1833 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1834 * @returns { Promise<void> } The promise returned by the function. 1835 * @throws { BusinessError } 201 - Permission denied. 1836 * @throws { BusinessError } 202 - Not system application to call the interface. 1837 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1838 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1839 * @throws { BusinessError } 1600001 - Internal error. 1840 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1841 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1842 * @throws { BusinessError } 1600012 - No memory space. 1843 * @syscap SystemCapability.Notification.Notification 1844 * @systemapi 1845 * @since 9 1846 */ 1847 /** 1848 * Set the Do Not Disturb date. 1849 * 1850 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1851 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1852 * @returns { Promise<void> } The promise returned by the function. 1853 * @throws { BusinessError } 201 - Permission denied. 1854 * @throws { BusinessError } 202 - Not system application to call the interface. 1855 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1856 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1857 * @throws { BusinessError } 801 - Capability not supported. 1858 * @throws { BusinessError } 1600001 - Internal error. 1859 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1860 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1861 * @throws { BusinessError } 1600012 - No memory space. 1862 * @syscap SystemCapability.Notification.Notification 1863 * @systemapi 1864 * @since 18 1865 */ 1866 function setDoNotDisturbDate(date: DoNotDisturbDate): Promise<void>; 1867 1868 /** 1869 * Set the Do Not Disturb date under the specified user. 1870 * 1871 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1872 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1873 * @param { number } userId - The userId. 1874 * @param { AsyncCallback<void> } callback - The callback of setDoNotDisturbDate. 1875 * @throws { BusinessError } 201 - Permission denied. 1876 * @throws { BusinessError } 202 - Not system application to call the interface. 1877 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1878 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1879 * @throws { BusinessError } 1600001 - Internal error. 1880 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1881 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1882 * @throws { BusinessError } 1600008 - The user does not exist. 1883 * @throws { BusinessError } 1600012 - No memory space. 1884 * @syscap SystemCapability.Notification.Notification 1885 * @systemapi 1886 * @since 9 1887 */ 1888 /** 1889 * Set the Do Not Disturb date under the specified user. 1890 * 1891 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1892 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1893 * @param { number } userId - The userId. 1894 * @param { AsyncCallback<void> } callback - The callback of setDoNotDisturbDate. 1895 * @throws { BusinessError } 201 - Permission denied. 1896 * @throws { BusinessError } 202 - Not system application to call the interface. 1897 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1898 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1899 * @throws { BusinessError } 801 - Capability not supported. 1900 * @throws { BusinessError } 1600001 - Internal error. 1901 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1902 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1903 * @throws { BusinessError } 1600008 - The user does not exist. 1904 * @throws { BusinessError } 1600012 - No memory space. 1905 * @syscap SystemCapability.Notification.Notification 1906 * @systemapi 1907 * @since 18 1908 */ 1909 function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallback<void>): void; 1910 1911 /** 1912 * Set the Do Not Disturb date under the specified user. 1913 * 1914 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1915 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1916 * @param { number } userId - The userId. 1917 * @returns { Promise<void> } The promise returned by the function. 1918 * @throws { BusinessError } 201 - Permission denied. 1919 * @throws { BusinessError } 202 - Not system application to call the interface. 1920 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1921 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1922 * @throws { BusinessError } 1600001 - Internal error. 1923 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1924 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1925 * @throws { BusinessError } 1600008 - The user does not exist. 1926 * @throws { BusinessError } 1600012 - No memory space. 1927 * @syscap SystemCapability.Notification.Notification 1928 * @systemapi 1929 * @since 9 1930 */ 1931 /** 1932 * Set the Do Not Disturb date under the specified user. 1933 * 1934 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1935 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1936 * @param { number } userId - The userId. 1937 * @returns { Promise<void> } The promise returned by the function. 1938 * @throws { BusinessError } 201 - Permission denied. 1939 * @throws { BusinessError } 202 - Not system application to call the interface. 1940 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1941 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1942 * @throws { BusinessError } 801 - Capability not supported. 1943 * @throws { BusinessError } 1600001 - Internal error. 1944 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1945 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1946 * @throws { BusinessError } 1600008 - The user does not exist. 1947 * @throws { BusinessError } 1600012 - No memory space. 1948 * @syscap SystemCapability.Notification.Notification 1949 * @systemapi 1950 * @since 18 1951 */ 1952 function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise<void>; 1953 1954 /** 1955 * Obtains the Do Not Disturb date. 1956 * 1957 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1958 * @param { AsyncCallback<DoNotDisturbDate> } callback - The callback is used to return the Do Not Disturb date. 1959 * @throws { BusinessError } 201 - Permission denied. 1960 * @throws { BusinessError } 202 - Not system application to call the interface. 1961 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1962 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1963 * @throws { BusinessError } 1600001 - Internal error. 1964 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1965 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1966 * @throws { BusinessError } 1600012 - No memory space. 1967 * @syscap SystemCapability.Notification.Notification 1968 * @systemapi 1969 * @since 9 1970 */ 1971 /** 1972 * Obtains the Do Not Disturb date. 1973 * 1974 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1975 * @param { AsyncCallback<DoNotDisturbDate> } callback - The callback is used to return the Do Not Disturb date. 1976 * @throws { BusinessError } 201 - Permission denied. 1977 * @throws { BusinessError } 202 - Not system application to call the interface. 1978 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1979 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1980 * @throws { BusinessError } 801 - Capability not supported. 1981 * @throws { BusinessError } 1600001 - Internal error. 1982 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1983 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1984 * @throws { BusinessError } 1600012 - No memory space. 1985 * @syscap SystemCapability.Notification.Notification 1986 * @systemapi 1987 * @since 18 1988 */ 1989 function getDoNotDisturbDate(callback: AsyncCallback<DoNotDisturbDate>): void; 1990 1991 /** 1992 * Obtains the Do Not Disturb date. 1993 * 1994 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1995 * @returns { Promise<DoNotDisturbDate> } Returns the Do Not Disturb date. 1996 * @throws { BusinessError } 201 - Permission denied. 1997 * @throws { BusinessError } 202 - Not system application to call the interface. 1998 * @throws { BusinessError } 1600001 - Internal error. 1999 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2000 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2001 * @throws { BusinessError } 1600012 - No memory space. 2002 * @syscap SystemCapability.Notification.Notification 2003 * @systemapi 2004 * @since 9 2005 */ 2006 /** 2007 * Obtains the Do Not Disturb date. 2008 * 2009 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2010 * @returns { Promise<DoNotDisturbDate> } Returns the Do Not Disturb date. 2011 * @throws { BusinessError } 201 - Permission denied. 2012 * @throws { BusinessError } 202 - Not system application to call the interface. 2013 * @throws { BusinessError } 801 - Capability not supported. 2014 * @throws { BusinessError } 1600001 - Internal error. 2015 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2016 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2017 * @throws { BusinessError } 1600012 - No memory space. 2018 * @syscap SystemCapability.Notification.Notification 2019 * @systemapi 2020 * @since 18 2021 */ 2022 function getDoNotDisturbDate(): Promise<DoNotDisturbDate>; 2023 2024 /** 2025 * Obtains the Do Not Disturb date. 2026 * 2027 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2028 * @param { number } userId - The userId. 2029 * @param { AsyncCallback<DoNotDisturbDate> } callback - The callback is used to return the Do Not Disturb date. 2030 * @throws { BusinessError } 201 - Permission denied. 2031 * @throws { BusinessError } 202 - Not system application to call the interface. 2032 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2033 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2034 * @throws { BusinessError } 1600001 - Internal error. 2035 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2036 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2037 * @throws { BusinessError } 1600008 - The user does not exist. 2038 * @throws { BusinessError } 1600012 - No memory space. 2039 * @syscap SystemCapability.Notification.Notification 2040 * @systemapi 2041 * @since 9 2042 */ 2043 /** 2044 * Obtains the Do Not Disturb date. 2045 * 2046 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2047 * @param { number } userId - The userId. 2048 * @param { AsyncCallback<DoNotDisturbDate> } callback - The callback is used to return the Do Not Disturb date. 2049 * @throws { BusinessError } 201 - Permission denied. 2050 * @throws { BusinessError } 202 - Not system application to call the interface. 2051 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2052 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2053 * @throws { BusinessError } 801 - Capability not supported. 2054 * @throws { BusinessError } 1600001 - Internal error. 2055 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2056 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2057 * @throws { BusinessError } 1600008 - The user does not exist. 2058 * @throws { BusinessError } 1600012 - No memory space. 2059 * @syscap SystemCapability.Notification.Notification 2060 * @systemapi 2061 * @since 18 2062 */ 2063 function getDoNotDisturbDate(userId: number, callback: AsyncCallback<DoNotDisturbDate>): void; 2064 2065 /** 2066 * Obtains the Do Not Disturb date. 2067 * 2068 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2069 * @param { number } userId - The userId. 2070 * @returns { Promise<DoNotDisturbDate> } Returns the Do Not Disturb date. 2071 * @throws { BusinessError } 201 - Permission denied. 2072 * @throws { BusinessError } 202 - Not system application to call the interface. 2073 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2074 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2075 * @throws { BusinessError } 1600001 - Internal error. 2076 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2077 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2078 * @throws { BusinessError } 1600008 - The user does not exist. 2079 * @throws { BusinessError } 1600012 - No memory space. 2080 * @syscap SystemCapability.Notification.Notification 2081 * @systemapi 2082 * @since 9 2083 */ 2084 /** 2085 * Obtains the Do Not Disturb date. 2086 * 2087 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2088 * @param { number } userId - The userId. 2089 * @returns { Promise<DoNotDisturbDate> } Returns the Do Not Disturb date. 2090 * @throws { BusinessError } 201 - Permission denied. 2091 * @throws { BusinessError } 202 - Not system application to call the interface. 2092 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2093 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2094 * @throws { BusinessError } 801 - Capability not supported. 2095 * @throws { BusinessError } 1600001 - Internal error. 2096 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2097 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2098 * @throws { BusinessError } 1600008 - The user does not exist. 2099 * @throws { BusinessError } 1600012 - No memory space. 2100 * @syscap SystemCapability.Notification.Notification 2101 * @systemapi 2102 * @since 18 2103 */ 2104 function getDoNotDisturbDate(userId: number): Promise<DoNotDisturbDate>; 2105 2106 /** 2107 * Obtains whether to support the Do Not Disturb mode. 2108 * 2109 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2110 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether Do Not Disturb 2111 * mode is supported. 2112 * @throws { BusinessError } 201 - Permission denied. 2113 * @throws { BusinessError } 202 - Not system application to call the interface. 2114 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2115 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2116 * @throws { BusinessError } 1600001 - Internal error. 2117 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2118 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2119 * @syscap SystemCapability.Notification.Notification 2120 * @systemapi 2121 * @since 9 2122 */ 2123 function isSupportDoNotDisturbMode(callback: AsyncCallback<boolean>): void; 2124 2125 /** 2126 * Obtains whether to support the Do Not Disturb mode. 2127 * 2128 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2129 * @returns { Promise<boolean> } Returns whether Do Not Disturb mode is supported. 2130 * @throws { BusinessError } 201 - Permission denied. 2131 * @throws { BusinessError } 202 - Not system application to call the interface. 2132 * @throws { BusinessError } 1600001 - Internal error. 2133 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2134 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2135 * @syscap SystemCapability.Notification.Notification 2136 * @systemapi 2137 * @since 9 2138 */ 2139 function isSupportDoNotDisturbMode(): Promise<boolean>; 2140 2141 /** 2142 * Obtains whether the template is supported by the system. 2143 * 2144 * @param { string } templateName - Name of template to be Obtained. 2145 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the template is supported. 2146 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2147 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2148 * @throws { BusinessError } 1600001 - Internal error. 2149 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2150 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2151 * @syscap SystemCapability.Notification.Notification 2152 * @since 9 2153 */ 2154 function isSupportTemplate(templateName: string, callback: AsyncCallback<boolean>): void; 2155 2156 /** 2157 * Obtains whether the template is supported by the system. 2158 * 2159 * @param { string } templateName - Name of template to be Obtained. 2160 * @returns { Promise<boolean> } Returns whether the template is supported. 2161 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2162 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2163 * @throws { BusinessError } 1600001 - Internal error. 2164 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2165 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2166 * @syscap SystemCapability.Notification.Notification 2167 * @since 9 2168 */ 2169 function isSupportTemplate(templateName: string): Promise<boolean>; 2170 2171 /** 2172 * Request permission to send notification. 2173 * 2174 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 2175 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2176 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2177 * @throws { BusinessError } 1600001 - Internal error. 2178 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2179 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2180 * @syscap SystemCapability.Notification.Notification 2181 * @since 9 2182 */ 2183 /** 2184 * Request permission to send notification. 2185 * 2186 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 2187 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2188 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2189 * @throws { BusinessError } 1600001 - Internal error. 2190 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2191 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2192 * @throws { BusinessError } 1600004 - Notification disabled. 2193 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 2194 * @syscap SystemCapability.Notification.Notification 2195 * @since 11 2196 */ 2197 /** 2198 * Request permission to send notification. 2199 * 2200 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 2201 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2202 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2203 * @throws { BusinessError } 1600001 - Internal error. 2204 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2205 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2206 * @throws { BusinessError } 1600004 - Notification disabled. 2207 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 2208 * @syscap SystemCapability.Notification.Notification 2209 * @crossplatform 2210 * @since 12 2211 * @deprecated since 12 2212 * @useinstead requestEnableNotification 2213 */ 2214 function requestEnableNotification(callback: AsyncCallback<void>): void; 2215 2216 /** 2217 * Request permission to send notification. 2218 * 2219 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 2220 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 2221 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2222 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2223 * @throws { BusinessError } 1600001 - Internal error. 2224 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2225 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2226 * @syscap SystemCapability.Notification.Notification 2227 * @StageModelOnly 2228 * @since 10 2229 */ 2230 /** 2231 * Request permission to send notification. 2232 * 2233 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 2234 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 2235 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2236 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2237 * @throws { BusinessError } 1600001 - Internal error. 2238 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2239 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2240 * @throws { BusinessError } 1600004 - Notification disabled. 2241 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 2242 * @syscap SystemCapability.Notification.Notification 2243 * @StageModelOnly 2244 * @since 11 2245 */ 2246 /** 2247 * Request permission to send notification. 2248 * 2249 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 2250 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 2251 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2252 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2253 * @throws { BusinessError } 1600001 - Internal error. 2254 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2255 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2256 * @throws { BusinessError } 1600004 - Notification disabled. 2257 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 2258 * @syscap SystemCapability.Notification.Notification 2259 * @StageModelOnly 2260 * @crossplatform 2261 * @since 12 2262 */ 2263 function requestEnableNotification(context: UIAbilityContext, callback: AsyncCallback<void>): void; 2264 2265 /** 2266 * Request permission to send notification. 2267 * 2268 * @returns { Promise<void> } The promise returned by the function. 2269 * @throws { BusinessError } 1600001 - Internal error. 2270 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2271 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2272 * @syscap SystemCapability.Notification.Notification 2273 * @since 9 2274 */ 2275 /** 2276 * Request permission to send notification. 2277 * 2278 * @returns { Promise<void> } The promise returned by the function. 2279 * @throws { BusinessError } 1600001 - Internal error. 2280 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2281 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2282 * @throws { BusinessError } 1600004 - Notification disabled. 2283 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 2284 * @syscap SystemCapability.Notification.Notification 2285 * @since 11 2286 */ 2287 /** 2288 * Request permission to send notification. 2289 * 2290 * @returns { Promise<void> } The promise returned by the function. 2291 * @throws { BusinessError } 1600001 - Internal error. 2292 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2293 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2294 * @throws { BusinessError } 1600004 - Notification disabled. 2295 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 2296 * @syscap SystemCapability.Notification.Notification 2297 * @crossplatform 2298 * @since 12 2299 * @deprecated since 12 2300 * @useinstead requestEnableNotification 2301 */ 2302 function requestEnableNotification(): Promise<void>; 2303 2304 /** 2305 * Request permission to send notification. 2306 * 2307 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 2308 * @returns { Promise<void> } The promise returned by the function. 2309 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2310 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2311 * @throws { BusinessError } 1600001 - Internal error. 2312 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2313 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2314 * @syscap SystemCapability.Notification.Notification 2315 * @StageModelOnly 2316 * @since 10 2317 */ 2318 /** 2319 * Request permission to send notification. 2320 * 2321 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 2322 * @returns { Promise<void> } The promise returned by the function. 2323 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2324 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2325 * @throws { BusinessError } 1600001 - Internal error. 2326 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2327 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2328 * @throws { BusinessError } 1600004 - Notification disabled. 2329 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 2330 * @syscap SystemCapability.Notification.Notification 2331 * @StageModelOnly 2332 * @since 11 2333 */ 2334 /** 2335 * Request permission to send notification. 2336 * 2337 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 2338 * @returns { Promise<void> } The promise returned by the function. 2339 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2340 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2341 * @throws { BusinessError } 1600001 - Internal error. 2342 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2343 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2344 * @throws { BusinessError } 1600004 - Notification disabled. 2345 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 2346 * @syscap SystemCapability.Notification.Notification 2347 * @StageModelOnly 2348 * @crossplatform 2349 * @since 12 2350 */ 2351 function requestEnableNotification(context: UIAbilityContext): Promise<void>; 2352 2353 /** 2354 * Sets whether the device supports distributed notification. 2355 * 2356 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2357 * @param { boolean } enable - Set enable or not. 2358 * @param { AsyncCallback<void> } callback - The callback of setDistributedEnable. 2359 * @throws { BusinessError } 201 - Permission denied. 2360 * @throws { BusinessError } 202 - Not system application to call the interface. 2361 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2362 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2363 * @throws { BusinessError } 1600001 - Internal error. 2364 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2365 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2366 * @throws { BusinessError } 1600010 - Distributed operation failed. 2367 * @syscap SystemCapability.Notification.Notification 2368 * @systemapi 2369 * @since 9 2370 */ 2371 /** 2372 * Sets whether the device supports distributed notification. 2373 * 2374 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2375 * @param { boolean } enable - Set enable or not. 2376 * @param { AsyncCallback<void> } callback - The callback of setDistributedEnable. 2377 * @throws { BusinessError } 201 - Permission denied. 2378 * @throws { BusinessError } 202 - Not system application to call the interface. 2379 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2380 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2381 * @throws { BusinessError } 801 - Capability not supported. 2382 * @throws { BusinessError } 1600001 - Internal error. 2383 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2384 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2385 * @throws { BusinessError } 1600010 - Distributed operation failed. 2386 * @syscap SystemCapability.Notification.Notification 2387 * @systemapi 2388 * @since 18 2389 */ 2390 function setDistributedEnable(enable: boolean, callback: AsyncCallback<void>): void; 2391 2392 /** 2393 * Sets whether the device supports distributed notification. 2394 * 2395 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2396 * @param { boolean } enable - Set enable or not. 2397 * @returns { Promise<void> } The promise returned by the function. 2398 * @throws { BusinessError } 201 - Permission denied. 2399 * @throws { BusinessError } 202 - Not system application to call the interface. 2400 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2401 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2402 * @throws { BusinessError } 1600001 - Internal error. 2403 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2404 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2405 * @throws { BusinessError } 1600010 - Distributed operation failed. 2406 * @syscap SystemCapability.Notification.Notification 2407 * @systemapi 2408 * @since 9 2409 */ 2410 /** 2411 * Sets whether the device supports distributed notification. 2412 * 2413 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2414 * @param { boolean } enable - Set enable or not. 2415 * @returns { Promise<void> } The promise returned by the function. 2416 * @throws { BusinessError } 201 - Permission denied. 2417 * @throws { BusinessError } 202 - Not system application to call the interface. 2418 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2419 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2420 * @throws { BusinessError } 801 - Capability not supported. 2421 * @throws { BusinessError } 1600001 - Internal error. 2422 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2423 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2424 * @throws { BusinessError } 1600010 - Distributed operation failed. 2425 * @syscap SystemCapability.Notification.Notification 2426 * @systemapi 2427 * @since 18 2428 */ 2429 function setDistributedEnable(enable: boolean): Promise<void>; 2430 2431 /** 2432 * Obtains whether the device supports distributed notification. 2433 * 2434 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the distributed 2435 * notification is supported. 2436 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2437 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2438 * @throws { BusinessError } 1600001 - Internal error. 2439 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2440 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2441 * @throws { BusinessError } 1600010 - Distributed operation failed. 2442 * @syscap SystemCapability.Notification.Notification 2443 * @since 9 2444 */ 2445 function isDistributedEnabled(callback: AsyncCallback<boolean>): void; 2446 2447 /** 2448 * Obtains whether the device supports distributed notification. 2449 * 2450 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 2451 * @throws { BusinessError } 1600001 - Internal error. 2452 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2453 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2454 * @throws { BusinessError } 1600010 - Distributed operation failed. 2455 * @syscap SystemCapability.Notification.Notification 2456 * @since 9 2457 */ 2458 function isDistributedEnabled(): Promise<boolean>; 2459 2460 /** 2461 * Sets whether an application supports distributed notification. 2462 * 2463 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2464 * @param { BundleOption } bundle - The bundle option. 2465 * @param { boolean } enable - Set enable or not. 2466 * @param { AsyncCallback<void> } callback - The callback of setDistributedEnableByBundle. 2467 * @throws { BusinessError } 201 - Permission denied. 2468 * @throws { BusinessError } 202 - Not system application to call the interface. 2469 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2470 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2471 * @throws { BusinessError } 1600001 - Internal error. 2472 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2473 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2474 * @throws { BusinessError } 1600010 - Distributed operation failed. 2475 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2476 * @syscap SystemCapability.Notification.Notification 2477 * @systemapi 2478 * @since 9 2479 */ 2480 /** 2481 * Sets whether an application supports distributed notification. 2482 * 2483 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2484 * @param { BundleOption } bundle - The bundle option. 2485 * @param { boolean } enable - Set enable or not. 2486 * @param { AsyncCallback<void> } callback - The callback of setDistributedEnableByBundle. 2487 * @throws { BusinessError } 201 - Permission denied. 2488 * @throws { BusinessError } 202 - Not system application to call the interface. 2489 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2490 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2491 * @throws { BusinessError } 801 - Capability not supported. 2492 * @throws { BusinessError } 1600001 - Internal error. 2493 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2494 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2495 * @throws { BusinessError } 1600010 - Distributed operation failed. 2496 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2497 * @syscap SystemCapability.Notification.Notification 2498 * @systemapi 2499 * @since 18 2500 */ 2501 function setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 2502 2503 /** 2504 * Sets whether an application supports distributed notification. 2505 * 2506 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2507 * @param { BundleOption } bundle - The bundle option. 2508 * @param { boolean } enable - Set enable or not. 2509 * @returns { Promise<void> } The promise returned by the function. 2510 * @throws { BusinessError } 201 - Permission denied. 2511 * @throws { BusinessError } 202 - Not system application to call the interface. 2512 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2513 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2514 * @throws { BusinessError } 1600001 - Internal error. 2515 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2516 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2517 * @throws { BusinessError } 1600010 - Distributed operation failed. 2518 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2519 * @syscap SystemCapability.Notification.Notification 2520 * @systemapi 2521 * @since 9 2522 */ 2523 /** 2524 * Sets whether an application supports distributed notification. 2525 * 2526 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2527 * @param { BundleOption } bundle - The bundle option. 2528 * @param { boolean } enable - Set enable or not. 2529 * @returns { Promise<void> } The promise returned by the function. 2530 * @throws { BusinessError } 201 - Permission denied. 2531 * @throws { BusinessError } 202 - Not system application to call the interface. 2532 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2533 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2534 * @throws { BusinessError } 801 - Capability not supported. 2535 * @throws { BusinessError } 1600001 - Internal error. 2536 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2537 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2538 * @throws { BusinessError } 1600010 - Distributed operation failed. 2539 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2540 * @syscap SystemCapability.Notification.Notification 2541 * @systemapi 2542 * @since 18 2543 */ 2544 function setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise<void>; 2545 2546 /** 2547 * Sets whether an application supports distributed notification. 2548 * 2549 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2550 * @param { BundleOption } bundle - The bundle option. 2551 * @param { string } deviceType - The device type. 2552 * @param { boolean } enable - Set enable or not. 2553 * @returns { Promise<void> } The promise returned by the function. 2554 * @throws { BusinessError } 201 - Permission denied. 2555 * @throws { BusinessError } 202 - Not system application to call the interface. 2556 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2557 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2558 * @throws { BusinessError } 1600001 - Internal error. 2559 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2560 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2561 * @throws { BusinessError } 1600010 - Distributed operation failed. 2562 * @throws { BusinessError } 1600012 - No memory space. 2563 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2564 * @syscap SystemCapability.Notification.Notification 2565 * @systemapi 2566 * @since 12 2567 */ 2568 /** 2569 * Sets whether an application supports distributed notification. 2570 * 2571 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2572 * @param { BundleOption } bundle - The bundle option. 2573 * @param { string } deviceType - The device type. 2574 * @param { boolean } enable - Set enable or not. 2575 * @returns { Promise<void> } The promise returned by the function. 2576 * @throws { BusinessError } 201 - Permission denied. 2577 * @throws { BusinessError } 202 - Not system application to call the interface. 2578 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2579 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2580 * @throws { BusinessError } 801 - Capability not supported. 2581 * @throws { BusinessError } 1600001 - Internal error. 2582 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2583 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2584 * @throws { BusinessError } 1600010 - Distributed operation failed. 2585 * @throws { BusinessError } 1600012 - No memory space. 2586 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2587 * @syscap SystemCapability.Notification.Notification 2588 * @systemapi 2589 * @since 18 2590 */ 2591 function setDistributedEnabledByBundle(bundle: BundleOption, deviceType: string, enable: boolean): Promise<void>; 2592 2593 /** 2594 * Obtains whether an application supports distributed notification. 2595 * 2596 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2597 * @param { BundleOption } bundle - The bundle option. 2598 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the distributed 2599 * notification is supported. 2600 * @throws { BusinessError } 201 - Permission denied. 2601 * @throws { BusinessError } 202 - Not system application to call the interface. 2602 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2603 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2604 * @throws { BusinessError } 1600001 - Internal error. 2605 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2606 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2607 * @throws { BusinessError } 1600010 - Distributed operation failed. 2608 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2609 * @syscap SystemCapability.Notification.Notification 2610 * @systemapi 2611 * @since 9 2612 */ 2613 /** 2614 * Obtains whether an application supports distributed notification. 2615 * 2616 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2617 * @param { BundleOption } bundle - The bundle option. 2618 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the distributed 2619 * notification is supported. 2620 * @throws { BusinessError } 201 - Permission denied. 2621 * @throws { BusinessError } 202 - Not system application to call the interface. 2622 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2623 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2624 * @throws { BusinessError } 801 - Capability not supported. 2625 * @throws { BusinessError } 1600001 - Internal error. 2626 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2627 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2628 * @throws { BusinessError } 1600010 - Distributed operation failed. 2629 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2630 * @syscap SystemCapability.Notification.Notification 2631 * @systemapi 2632 * @since 18 2633 */ 2634 function isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 2635 2636 /** 2637 * Obtains whether an application supports distributed notification. 2638 * 2639 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2640 * @param { BundleOption } bundle - The bundle option. 2641 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 2642 * @throws { BusinessError } 201 - Permission denied. 2643 * @throws { BusinessError } 202 - Not system application to call the interface. 2644 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2645 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2646 * @throws { BusinessError } 1600001 - Internal error. 2647 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2648 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2649 * @throws { BusinessError } 1600010 - Distributed operation failed. 2650 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2651 * @syscap SystemCapability.Notification.Notification 2652 * @systemapi 2653 * @since 9 2654 */ 2655 /** 2656 * Obtains whether an application supports distributed notification. 2657 * 2658 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2659 * @param { BundleOption } bundle - The bundle option. 2660 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 2661 * @throws { BusinessError } 201 - Permission denied. 2662 * @throws { BusinessError } 202 - Not system application to call the interface. 2663 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2664 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2665 * @throws { BusinessError } 801 - Capability not supported. 2666 * @throws { BusinessError } 1600001 - Internal error. 2667 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2668 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2669 * @throws { BusinessError } 1600010 - Distributed operation failed. 2670 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2671 * @syscap SystemCapability.Notification.Notification 2672 * @systemapi 2673 * @since 18 2674 */ 2675 function isDistributedEnabledByBundle(bundle: BundleOption): Promise<boolean>; 2676 2677 /** 2678 * Obtains whether an application supports distributed notification. 2679 * 2680 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2681 * @param { BundleOption } bundle - The bundle option. 2682 * @param { string } deviceType - The device type. 2683 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 2684 * @throws { BusinessError } 201 - Permission denied. 2685 * @throws { BusinessError } 202 - Not system application to call the interface. 2686 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2687 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2688 * @throws { BusinessError } 1600001 - Internal error. 2689 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2690 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2691 * @throws { BusinessError } 1600010 - Distributed operation failed. 2692 * @throws { BusinessError } 1600012 - No memory space. 2693 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2694 * @syscap SystemCapability.Notification.Notification 2695 * @systemapi 2696 * @since 12 2697 */ 2698 /** 2699 * Obtains whether an application supports distributed notification. 2700 * 2701 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2702 * @param { BundleOption } bundle - The bundle option. 2703 * @param { string } deviceType - The device type. 2704 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 2705 * @throws { BusinessError } 201 - Permission denied. 2706 * @throws { BusinessError } 202 - Not system application to call the interface. 2707 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2708 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2709 * @throws { BusinessError } 801 - Capability not supported. 2710 * @throws { BusinessError } 1600001 - Internal error. 2711 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2712 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2713 * @throws { BusinessError } 1600010 - Distributed operation failed. 2714 * @throws { BusinessError } 1600012 - No memory space. 2715 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2716 * @syscap SystemCapability.Notification.Notification 2717 * @systemapi 2718 * @since 18 2719 */ 2720 function isDistributedEnabledByBundle(bundle: BundleOption, deviceType: string): Promise<boolean>; 2721 2722 /** 2723 * Sets whether an application supports smart reminders across devices. 2724 * 2725 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2726 * @param { string } deviceType - The device type. 2727 * @param { boolean } enable - Set enable or not. 2728 * @returns { Promise<void> } The promise returned by the function. 2729 * @throws { BusinessError } 201 - Permission denied. 2730 * @throws { BusinessError } 202 - Not system application to call the interface. 2731 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2732 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2733 * @throws { BusinessError } 1600001 - Internal error. 2734 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2735 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2736 * @throws { BusinessError } 1600010 - Distributed operation failed. 2737 * @throws { BusinessError } 1600012 - No memory space. 2738 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2739 * @syscap SystemCapability.Notification.Notification 2740 * @systemapi 2741 * @since 12 2742 */ 2743 /** 2744 * Sets whether an application supports smart reminders across devices. 2745 * 2746 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2747 * @param { string } deviceType - The device type. 2748 * @param { boolean } enable - Set enable or not. 2749 * @returns { Promise<void> } The promise returned by the function. 2750 * @throws { BusinessError } 201 - Permission denied. 2751 * @throws { BusinessError } 202 - Not system application to call the interface. 2752 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2753 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2754 * @throws { BusinessError } 801 - Capability not supported. 2755 * @throws { BusinessError } 1600001 - Internal error. 2756 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2757 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2758 * @throws { BusinessError } 1600010 - Distributed operation failed. 2759 * @throws { BusinessError } 1600012 - No memory space. 2760 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2761 * @syscap SystemCapability.Notification.Notification 2762 * @systemapi 2763 * @since 18 2764 */ 2765 function setSmartReminderEnabled(deviceType: string, enable: boolean): Promise<void>; 2766 2767 /** 2768 * Obtains whether an application supports smart reminders across devices. 2769 * 2770 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2771 * @param { string } deviceType - The device type. 2772 * @returns { Promise<boolean> } Returns whether the smart reminders across devices notification is supported. 2773 * @throws { BusinessError } 201 - Permission denied. 2774 * @throws { BusinessError } 202 - Not system application to call the interface. 2775 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2776 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2777 * @throws { BusinessError } 1600001 - Internal error. 2778 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2779 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2780 * @throws { BusinessError } 1600010 - Distributed operation failed. 2781 * @throws { BusinessError } 1600012 - No memory space. 2782 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2783 * @syscap SystemCapability.Notification.Notification 2784 * @systemapi 2785 * @since 12 2786 */ 2787 /** 2788 * Obtains whether an application supports smart reminders across devices. 2789 * 2790 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2791 * @param { string } deviceType - The device type. 2792 * @returns { Promise<boolean> } Returns whether the smart reminders across devices notification is supported. 2793 * @throws { BusinessError } 201 - Permission denied. 2794 * @throws { BusinessError } 202 - Not system application to call the interface. 2795 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2796 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2797 * @throws { BusinessError } 801 - Capability not supported. 2798 * @throws { BusinessError } 1600001 - Internal error. 2799 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2800 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2801 * @throws { BusinessError } 1600010 - Distributed operation failed. 2802 * @throws { BusinessError } 1600012 - No memory space. 2803 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2804 * @syscap SystemCapability.Notification.Notification 2805 * @systemapi 2806 * @since 18 2807 */ 2808 function isSmartReminderEnabled(deviceType: string): Promise<boolean>; 2809 2810 /** 2811 * Obtains the remind modes of the notification. 2812 * 2813 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2814 * @param { AsyncCallback<DeviceRemindType> } callback - The callback is used to return the RemindType. 2815 * @throws { BusinessError } 201 - Permission denied. 2816 * @throws { BusinessError } 202 - Not system application to call the interface. 2817 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2818 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2819 * @throws { BusinessError } 1600001 - Internal error. 2820 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2821 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2822 * @syscap SystemCapability.Notification.Notification 2823 * @systemapi 2824 * @since 9 2825 */ 2826 /** 2827 * Obtains the remind modes of the notification. 2828 * 2829 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2830 * @param { AsyncCallback<DeviceRemindType> } callback - The callback is used to return the RemindType. 2831 * @throws { BusinessError } 201 - Permission denied. 2832 * @throws { BusinessError } 202 - Not system application to call the interface. 2833 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2834 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2835 * @throws { BusinessError } 801 - Capability not supported. 2836 * @throws { BusinessError } 1600001 - Internal error. 2837 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2838 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2839 * @syscap SystemCapability.Notification.Notification 2840 * @systemapi 2841 * @since 18 2842 */ 2843 function getDeviceRemindType(callback: AsyncCallback<DeviceRemindType>): void; 2844 2845 /** 2846 * Obtains the remind modes of the notification. 2847 * 2848 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2849 * @returns { Promise<DeviceRemindType> } Returns the RemindType. 2850 * @throws { BusinessError } 201 - Permission denied. 2851 * @throws { BusinessError } 202 - Not system application to call the interface. 2852 * @throws { BusinessError } 1600001 - Internal error. 2853 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2854 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2855 * @syscap SystemCapability.Notification.Notification 2856 * @systemapi 2857 * @since 9 2858 */ 2859 /** 2860 * Obtains the remind modes of the notification. 2861 * 2862 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2863 * @returns { Promise<DeviceRemindType> } Returns the RemindType. 2864 * @throws { BusinessError } 201 - Permission denied. 2865 * @throws { BusinessError } 202 - Not system application to call the interface. 2866 * @throws { BusinessError } 801 - Capability not supported. 2867 * @throws { BusinessError } 1600001 - Internal error. 2868 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2869 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2870 * @syscap SystemCapability.Notification.Notification 2871 * @systemapi 2872 * @since 18 2873 */ 2874 function getDeviceRemindType(): Promise<DeviceRemindType>; 2875 2876 /** 2877 * Set whether the application slot is enabled. 2878 * 2879 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2880 * @param { BundleOption } bundle - The bundle option. 2881 * @param { SlotType } type - Type of the notification slot. 2882 * @param { boolean } enable - Set enable or not. 2883 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 2884 * @throws { BusinessError } 201 - Permission denied. 2885 * @throws { BusinessError } 202 - Not system application to call the interface. 2886 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2887 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2888 * @throws { BusinessError } 1600001 - Internal error. 2889 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2890 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2891 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2892 * @syscap SystemCapability.Notification.Notification 2893 * @systemapi 2894 * @since 9 2895 */ 2896 /** 2897 * Set whether the application slot is enabled. 2898 * 2899 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2900 * @param { BundleOption } bundle - The bundle option. 2901 * @param { SlotType } type - Type of the notification slot. 2902 * @param { boolean } enable - Set enable or not. 2903 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 2904 * @throws { BusinessError } 201 - Permission denied. 2905 * @throws { BusinessError } 202 - Not system application to call the interface. 2906 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2907 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2908 * @throws { BusinessError } 1600001 - Internal error. 2909 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2910 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2911 * @throws { BusinessError } 1600012 - No memory space. 2912 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2913 * @syscap SystemCapability.Notification.Notification 2914 * @systemapi 2915 * @since 11 2916 */ 2917 /** 2918 * Set whether the application slot is enabled. 2919 * 2920 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2921 * @param { BundleOption } bundle - The bundle option. 2922 * @param { SlotType } type - Type of the notification slot. 2923 * @param { boolean } enable - Set enable or not. 2924 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 2925 * @throws { BusinessError } 201 - Permission denied. 2926 * @throws { BusinessError } 202 - Not system application to call the interface. 2927 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2928 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2929 * @throws { BusinessError } 801 - Capability not supported. 2930 * @throws { BusinessError } 1600001 - Internal error. 2931 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2932 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2933 * @throws { BusinessError } 1600012 - No memory space. 2934 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2935 * @syscap SystemCapability.Notification.Notification 2936 * @systemapi 2937 * @since 18 2938 */ 2939 function setNotificationEnableSlot( 2940 bundle: BundleOption, 2941 type: SlotType, 2942 enable: boolean, 2943 callback: AsyncCallback<void> 2944 ): void; 2945 2946 /** 2947 * Set whether the application slot is enabled. 2948 * 2949 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2950 * @param { BundleOption } bundle - The bundle option. 2951 * @param { SlotType } type - Type of the notification slot. 2952 * @param { boolean } enable - Set enable or not. 2953 * @param { boolean } isForceControl - Is the notification slot enable affected by the application 2954 * notification enable, false means affected. 2955 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 2956 * @throws { BusinessError } 201 - Permission denied. 2957 * @throws { BusinessError } 202 - Not system application to call the interface. 2958 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2959 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2960 * @throws { BusinessError } 1600001 - Internal error. 2961 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2962 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2963 * @throws { BusinessError } 1600012 - No memory space. 2964 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2965 * @syscap SystemCapability.Notification.Notification 2966 * @systemapi 2967 * @since 11 2968 */ 2969 /** 2970 * Set whether the application slot is enabled. 2971 * 2972 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2973 * @param { BundleOption } bundle - The bundle option. 2974 * @param { SlotType } type - Type of the notification slot. 2975 * @param { boolean } enable - Set enable or not. 2976 * @param { boolean } isForceControl - Is the notification slot enable affected by the application 2977 * notification enable, false means affected. 2978 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 2979 * @throws { BusinessError } 201 - Permission denied. 2980 * @throws { BusinessError } 202 - Not system application to call the interface. 2981 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2982 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2983 * @throws { BusinessError } 801 - Capability not supported. 2984 * @throws { BusinessError } 1600001 - Internal error. 2985 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2986 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2987 * @throws { BusinessError } 1600012 - No memory space. 2988 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2989 * @syscap SystemCapability.Notification.Notification 2990 * @systemapi 2991 * @since 18 2992 */ 2993 function setNotificationEnableSlot( 2994 bundle: BundleOption, 2995 type: SlotType, 2996 enable: boolean, 2997 isForceControl: boolean, 2998 callback: AsyncCallback<void>, 2999 ): void; 3000 3001 /** 3002 * Set whether the application slot is enabled. 3003 * 3004 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3005 * @param { BundleOption } bundle - The bundle option. 3006 * @param { SlotType } type - Type of the notification slot. 3007 * @param { boolean } enable - Set enable or not. 3008 * @returns { Promise<void> } The promise returned by the function. 3009 * @throws { BusinessError } 201 - Permission denied. 3010 * @throws { BusinessError } 202 - Not system application to call the interface. 3011 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3012 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3013 * @throws { BusinessError } 1600001 - Internal error. 3014 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3015 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3016 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3017 * @syscap SystemCapability.Notification.Notification 3018 * @systemapi 3019 * @since 9 3020 */ 3021 /** 3022 * Set whether the application slot is enabled. 3023 * 3024 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3025 * @param { BundleOption } bundle - The bundle option. 3026 * @param { SlotType } type - Type of the notification slot. 3027 * @param { boolean } enable - Set enable or not. 3028 * @param { boolean } isForceControl - Is the notification slot enable affected by the application 3029 * notification enable, false means affected. 3030 * @returns { Promise<void> } The promise returned by the function. 3031 * @throws { BusinessError } 201 - Permission denied. 3032 * @throws { BusinessError } 202 - Not system application to call the interface. 3033 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3034 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3035 * @throws { BusinessError } 1600001 - Internal error. 3036 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3037 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3038 * @throws { BusinessError } 1600012 - No memory space. 3039 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3040 * @syscap SystemCapability.Notification.Notification 3041 * @systemapi 3042 * @since 11 3043 */ 3044 /** 3045 * Set whether the application slot is enabled. 3046 * 3047 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3048 * @param { BundleOption } bundle - The bundle option. 3049 * @param { SlotType } type - Type of the notification slot. 3050 * @param { boolean } enable - Set enable or not. 3051 * @param { boolean } isForceControl - Is the notification slot enable affected by the application 3052 * notification enable, false means affected. 3053 * @returns { Promise<void> } The promise returned by the function. 3054 * @throws { BusinessError } 201 - Permission denied. 3055 * @throws { BusinessError } 202 - Not system application to call the interface. 3056 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3057 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3058 * @throws { BusinessError } 801 - Capability not supported. 3059 * @throws { BusinessError } 1600001 - Internal error. 3060 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3061 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3062 * @throws { BusinessError } 1600012 - No memory space. 3063 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3064 * @syscap SystemCapability.Notification.Notification 3065 * @systemapi 3066 * @since 18 3067 */ 3068 function setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean, isForceControl?: boolean): Promise<void>; 3069 3070 /** 3071 * Obtains whether the application slot is enabled. 3072 * 3073 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3074 * @param { BundleOption } bundle - The bundle option. 3075 * @param { SlotType } type - Type of the notification slot. 3076 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the application slot is enabled. 3077 * @throws { BusinessError } 201 - Permission denied. 3078 * @throws { BusinessError } 202 - Not system application to call the interface. 3079 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3080 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3081 * @throws { BusinessError } 1600001 - Internal error. 3082 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3083 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3084 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3085 * @syscap SystemCapability.Notification.Notification 3086 * @systemapi 3087 * @since 9 3088 */ 3089 /** 3090 * Obtains whether the application slot is enabled. 3091 * 3092 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3093 * @param { BundleOption } bundle - The bundle option. 3094 * @param { SlotType } type - Type of the notification slot. 3095 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the application slot is enabled. 3096 * @throws { BusinessError } 201 - Permission denied. 3097 * @throws { BusinessError } 202 - Not system application to call the interface. 3098 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3099 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3100 * @throws { BusinessError } 801 - Capability not supported. 3101 * @throws { BusinessError } 1600001 - Internal error. 3102 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3103 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3104 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3105 * @syscap SystemCapability.Notification.Notification 3106 * @systemapi 3107 * @since 18 3108 */ 3109 function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback<boolean>): void; 3110 3111 /** 3112 * Obtains whether the application slot is enabled. 3113 * 3114 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3115 * @param { BundleOption } bundle - The bundle option. 3116 * @param { SlotType } type - Type of the notification slot. 3117 * @returns { Promise<boolean> } Returns whether the application slot is enabled. 3118 * @throws { BusinessError } 201 - Permission denied. 3119 * @throws { BusinessError } 202 - Not system application to call the interface. 3120 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3121 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3122 * @throws { BusinessError } 1600001 - Internal error. 3123 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3124 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3125 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3126 * @syscap SystemCapability.Notification.Notification 3127 * @systemapi 3128 * @since 9 3129 */ 3130 /** 3131 * Obtains whether the application slot is enabled. 3132 * 3133 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3134 * @param { BundleOption } bundle - The bundle option. 3135 * @param { SlotType } type - Type of the notification slot. 3136 * @returns { Promise<boolean> } Returns whether the application slot is enabled. 3137 * @throws { BusinessError } 201 - Permission denied. 3138 * @throws { BusinessError } 202 - Not system application to call the interface. 3139 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3140 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3141 * @throws { BusinessError } 801 - Capability not supported. 3142 * @throws { BusinessError } 1600001 - Internal error. 3143 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3144 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3145 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3146 * @syscap SystemCapability.Notification.Notification 3147 * @systemapi 3148 * @since 18 3149 */ 3150 function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise<boolean>; 3151 3152 /** 3153 * Set whether to sync notifications to devices that do not have the app installed. 3154 * 3155 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3156 * @param { number } userId - The userId. 3157 * @param { boolean } enable - Set enable or not. 3158 * @param { AsyncCallback<void> } callback - The callback of setSyncNotificationEnabledWithoutApp. 3159 * @throws { BusinessError } 201 - Permission denied. 3160 * @throws { BusinessError } 202 - Not system application to call the interface. 3161 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3162 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3163 * @throws { BusinessError } 1600001 - Internal error. 3164 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3165 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3166 * @throws { BusinessError } 1600008 - The user does not exist. 3167 * @syscap SystemCapability.Notification.Notification 3168 * @systemapi 3169 * @since 9 3170 */ 3171 /** 3172 * Set whether to sync notifications to devices that do not have the app installed. 3173 * 3174 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3175 * @param { number } userId - The userId. 3176 * @param { boolean } enable - Set enable or not. 3177 * @param { AsyncCallback<void> } callback - The callback of setSyncNotificationEnabledWithoutApp. 3178 * @throws { BusinessError } 201 - Permission denied. 3179 * @throws { BusinessError } 202 - Not system application to call the interface. 3180 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3181 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3182 * @throws { BusinessError } 801 - Capability not supported. 3183 * @throws { BusinessError } 1600001 - Internal error. 3184 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3185 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3186 * @throws { BusinessError } 1600008 - The user does not exist. 3187 * @syscap SystemCapability.Notification.Notification 3188 * @systemapi 3189 * @since 18 3190 */ 3191 function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean, callback: AsyncCallback<void>): void; 3192 3193 /** 3194 * Set whether to sync notifications to devices that do not have the app installed. 3195 * 3196 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3197 * @param { number } userId - The userId. 3198 * @param { boolean } enable - Set enable or not. 3199 * @returns { Promise<void> } The promise returned by the function. 3200 * @throws { BusinessError } 201 - Permission denied. 3201 * @throws { BusinessError } 202 - Not system application to call the interface. 3202 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3203 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3204 * @throws { BusinessError } 1600001 - Internal error. 3205 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3206 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3207 * @throws { BusinessError } 1600008 - The user does not exist. 3208 * @syscap SystemCapability.Notification.Notification 3209 * @systemapi 3210 * @since 9 3211 */ 3212 /** 3213 * Set whether to sync notifications to devices that do not have the app installed. 3214 * 3215 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3216 * @param { number } userId - The userId. 3217 * @param { boolean } enable - Set enable or not. 3218 * @returns { Promise<void> } The promise returned by the function. 3219 * @throws { BusinessError } 201 - Permission denied. 3220 * @throws { BusinessError } 202 - Not system application to call the interface. 3221 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3222 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3223 * @throws { BusinessError } 801 - Capability not supported. 3224 * @throws { BusinessError } 1600001 - Internal error. 3225 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3226 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3227 * @throws { BusinessError } 1600008 - The user does not exist. 3228 * @syscap SystemCapability.Notification.Notification 3229 * @systemapi 3230 * @since 18 3231 */ 3232 function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean): Promise<void>; 3233 3234 /** 3235 * Obtains whether to sync notifications to devices that do not have the app installed. 3236 * 3237 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3238 * @param { number } userId - The userId. 3239 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether to sync notifications to devices. 3240 * @throws { BusinessError } 201 - Permission denied. 3241 * @throws { BusinessError } 202 - Not system application to call the interface. 3242 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3243 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3244 * @throws { BusinessError } 1600001 - Internal error. 3245 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3246 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3247 * @throws { BusinessError } 1600008 - The user does not exist. 3248 * @syscap SystemCapability.Notification.Notification 3249 * @systemapi 3250 * @since 9 3251 */ 3252 function getSyncNotificationEnabledWithoutApp(userId: number, callback: AsyncCallback<boolean>): void; 3253 3254 /** 3255 * Obtains whether to sync notifications to devices that do not have the app installed. 3256 * 3257 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3258 * @param { number } userId - The userId. 3259 * @returns { Promise<boolean> } Returns whether to sync notifications to devices. 3260 * @throws { BusinessError } 201 - Permission denied. 3261 * @throws { BusinessError } 202 - Not system application to call the interface. 3262 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3263 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3264 * @throws { BusinessError } 1600001 - Internal error. 3265 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3266 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3267 * @throws { BusinessError } 1600008 - The user does not exist. 3268 * @syscap SystemCapability.Notification.Notification 3269 * @systemapi 3270 * @since 9 3271 */ 3272 function getSyncNotificationEnabledWithoutApp(userId: number): Promise<boolean>; 3273 3274 /** 3275 * Set badge number. 3276 * 3277 * @param { number } badgeNumber - Badge number. 3278 * @param { AsyncCallback<void> } callback - callback - The callback of setBadgeNumber.. 3279 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3280 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3281 * @throws { BusinessError } 1600001 - Internal error. 3282 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3283 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3284 * @throws { BusinessError } 1600012 - No memory space. 3285 * @syscap SystemCapability.Notification.Notification 3286 * @since 10 3287 */ 3288 /** 3289 * Set badge number. 3290 * 3291 * @param { number } badgeNumber - Badge number. 3292 * @param { AsyncCallback<void> } callback - callback - The callback of setBadgeNumber.. 3293 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3294 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3295 * @throws { BusinessError } 1600001 - Internal error. 3296 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3297 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3298 * @throws { BusinessError } 1600012 - No memory space. 3299 * @syscap SystemCapability.Notification.Notification 3300 * @crossplatform 3301 * @since 12 3302 */ 3303 /** 3304 * Set badge number. 3305 * 3306 * @param { number } badgeNumber - Badge number. 3307 * @param { AsyncCallback<void> } callback - callback - The callback of setBadgeNumber.. 3308 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3309 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3310 * @throws { BusinessError } 801 - Capability not supported. 3311 * @throws { BusinessError } 1600001 - Internal error. 3312 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3313 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3314 * @throws { BusinessError } 1600012 - No memory space. 3315 * @syscap SystemCapability.Notification.Notification 3316 * @crossplatform 3317 * @since 18 3318 */ 3319 function setBadgeNumber(badgeNumber: number, callback: AsyncCallback<void>): void; 3320 3321 /** 3322 * Set badge number. 3323 * 3324 * @param { number } badgeNumber - Badge number. 3325 * @returns { Promise<void> } The promise returned by the function. 3326 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3327 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3328 * @throws { BusinessError } 1600001 - Internal error. 3329 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3330 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3331 * @throws { BusinessError } 1600012 - No memory space. 3332 * @syscap SystemCapability.Notification.Notification 3333 * @since 10 3334 */ 3335 /** 3336 * Set badge number. 3337 * 3338 * @param { number } badgeNumber - Badge number. 3339 * @returns { Promise<void> } The promise returned by the function. 3340 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3341 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3342 * @throws { BusinessError } 1600001 - Internal error. 3343 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3344 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3345 * @throws { BusinessError } 1600012 - No memory space. 3346 * @syscap SystemCapability.Notification.Notification 3347 * @crossplatform 3348 * @since 12 3349 */ 3350 /** 3351 * Set badge number. 3352 * 3353 * @param { number } badgeNumber - Badge number. 3354 * @returns { Promise<void> } The promise returned by the function. 3355 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3356 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3357 * @throws { BusinessError } 801 - Capability not supported. 3358 * @throws { BusinessError } 1600001 - Internal error. 3359 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3360 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3361 * @throws { BusinessError } 1600012 - No memory space. 3362 * @syscap SystemCapability.Notification.Notification 3363 * @crossplatform 3364 * @since 18 3365 */ 3366 function setBadgeNumber(badgeNumber: number): Promise<void>; 3367 3368 /** 3369 * Set badge number by bundle. 3370 * 3371 * @param { BundleOption } bundle - Use the bundleOption to carry bundleName and uid of the application. 3372 * @param { number } badgeNumber - Badge number. 3373 * @returns { Promise<void> } The promise returned by the function. 3374 * @throws { BusinessError } 202 - Not system application to call the interface. 3375 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3376 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3377 * @throws { BusinessError } 1600001 - Internal error. 3378 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3379 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3380 * @throws { BusinessError } 1600012 - No memory space. 3381 * @throws { BusinessError } 1600017 - There is no corresponding agent relationship configuration. 3382 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3383 * @syscap SystemCapability.Notification.Notification 3384 * @systemapi 3385 * @since 12 3386 */ 3387 /** 3388 * Set badge number by bundle. 3389 * 3390 * @param { BundleOption } bundle - Use the bundleOption to carry bundleName and uid of the application. 3391 * @param { number } badgeNumber - Badge number. 3392 * @returns { Promise<void> } The promise returned by the function. 3393 * @throws { BusinessError } 202 - Not system application to call the interface. 3394 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3395 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3396 * @throws { BusinessError } 801 - Capability not supported. 3397 * @throws { BusinessError } 1600001 - Internal error. 3398 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3399 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3400 * @throws { BusinessError } 1600012 - No memory space. 3401 * @throws { BusinessError } 1600017 - There is no corresponding agent relationship configuration. 3402 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3403 * @syscap SystemCapability.Notification.Notification 3404 * @systemapi 3405 * @since 18 3406 */ 3407 function setBadgeNumberByBundle(bundle: BundleOption, badgeNumber: number): Promise<void>; 3408 3409 /** 3410 * Subscribe the callback for check notifications. 3411 * 3412 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3413 * @param { 'checkNotification' } type - Type of the callback to listen for. 3414 * @param { function } callback - callback - The callback of check notifications. 3415 * @throws { BusinessError } 202 - Not system application. 3416 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3417 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3418 * @throws { BusinessError } 1600001 - Internal error. 3419 * @syscap SystemCapability.Notification.Notification 3420 * @systemapi 3421 * @since 10 3422 */ 3423 /** 3424 * Subscribe the callback for check notifications. 3425 * 3426 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3427 * @param { 'checkNotification' } type - Type of the callback to listen for. 3428 * @param { function } callback - callback - The callback of check notifications. 3429 * @throws { BusinessError } 202 - Not system application. 3430 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3431 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3432 * @throws { BusinessError } 801 - Capability not supported. 3433 * @throws { BusinessError } 1600001 - Internal error. 3434 * @syscap SystemCapability.Notification.Notification 3435 * @systemapi 3436 * @since 18 3437 */ 3438 function on(type: 'checkNotification', callback: (checkInfo: NotificationCheckInfo) => NotificationCheckResult): void; 3439 3440 /** 3441 * Subscribe the callback for check notifications. 3442 * 3443 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3444 * @param { 'checkNotification' } type - Type of the callback to listen for. 3445 * @param { NotificationCheckRequest } checkRequest - Check Request for filter notification request. 3446 * @param { function } callback - callback - The callback of check notifications. 3447 * @throws { BusinessError } 201 - Permission denied. 3448 * @throws { BusinessError } 202 - Not system application. 3449 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3450 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3451 * @throws { BusinessError } 1600001 - Internal error. 3452 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3453 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3454 * @syscap SystemCapability.Notification.Notification 3455 * @systemapi 3456 * @since 11 3457 */ 3458 /** 3459 * Subscribe the callback for check notifications. 3460 * 3461 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3462 * @param { 'checkNotification' } type - Type of the callback to listen for. 3463 * @param { NotificationCheckRequest } checkRequest - Check Request for filter notification request. 3464 * @param { function } callback - callback - The callback of check notifications. 3465 * @throws { BusinessError } 201 - Permission denied. 3466 * @throws { BusinessError } 202 - Not system application. 3467 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3468 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3469 * @throws { BusinessError } 801 - Capability not supported. 3470 * @throws { BusinessError } 1600001 - Internal error. 3471 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3472 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3473 * @syscap SystemCapability.Notification.Notification 3474 * @systemapi 3475 * @since 18 3476 */ 3477 function on(type: 'checkNotification', checkRequest: NotificationCheckRequest, 3478 callback: (checkInfo: NotificationCheckInfo) => Promise<NotificationCheckResult>): void; 3479 3480 /** 3481 * Unsubscribe the callback for check notifications. 3482 * 3483 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3484 * @param { 'checkNotification' } type - Type of the callback to listen for. 3485 * @param { function } [callback] - callback - The callback of check notifications. 3486 * @throws { BusinessError } 202 - Not system application. 3487 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3488 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3489 * @throws { BusinessError } 1600001 - Internal error. 3490 * @syscap SystemCapability.Notification.Notification 3491 * @systemapi 3492 * @since 10 3493 */ 3494 /** 3495 * Unsubscribe the callback for check notifications. 3496 * 3497 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3498 * @param { 'checkNotification' } type - Type of the callback to listen for. 3499 * @param { function } [callback] - callback - The callback of check notifications. 3500 * @throws { BusinessError } 202 - Not system application. 3501 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3502 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3503 * @throws { BusinessError } 801 - Capability not supported. 3504 * @throws { BusinessError } 1600001 - Internal error. 3505 * @syscap SystemCapability.Notification.Notification 3506 * @systemapi 3507 * @since 18 3508 */ 3509 function off( 3510 type: 'checkNotification', 3511 callback?: (checkInfo: NotificationCheckInfo) => NotificationCheckResult 3512 ): void; 3513 3514 /** 3515 * Trigger system live view notification. 3516 * 3517 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3518 * @param { BundleOption } bundle - The bundle option. 3519 * @param { number } notificationId - The notification id. 3520 * @param { ButtonOptions } buttonOptions - The button option. 3521 * @returns { Promise<void> } The promise returned by the function. 3522 * @throws { BusinessError } 201 - Permission denied. 3523 * @throws { BusinessError } 202 - Not system application to call the interface. 3524 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3525 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3526 * @throws { BusinessError } 1600001 - Internal error. 3527 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3528 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3529 * @throws { BusinessError } 1600007 - The notification does not exist. 3530 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3531 * @syscap SystemCapability.Notification.Notification 3532 * @systemapi 3533 * @since 11 3534 */ 3535 /** 3536 * Trigger system live view notification. 3537 * 3538 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3539 * @param { BundleOption } bundle - The bundle option. 3540 * @param { number } notificationId - The notification id. 3541 * @param { ButtonOptions } buttonOptions - The button option. 3542 * @returns { Promise<void> } The promise returned by the function. 3543 * @throws { BusinessError } 201 - Permission denied. 3544 * @throws { BusinessError } 202 - Not system application to call the interface. 3545 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3546 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3547 * @throws { BusinessError } 801 - Capability not supported. 3548 * @throws { BusinessError } 1600001 - Internal error. 3549 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3550 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3551 * @throws { BusinessError } 1600007 - The notification does not exist. 3552 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3553 * @syscap SystemCapability.Notification.Notification 3554 * @systemapi 3555 * @since 18 3556 */ 3557 function triggerSystemLiveView(bundle: BundleOption, notificationId: number, buttonOptions: ButtonOptions): Promise<void>; 3558 3559 /** 3560 * Subscribe to system live view notifications 3561 * 3562 * @param { SystemLiveViewSubscriber } subscriber - The system live vie notification subscriber. 3563 * @returns { Promise<void> } The promise returned by the function. 3564 * @throws { BusinessError } 202 - Not system application to call the interface. 3565 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3566 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3567 * @throws { BusinessError } 1600001 - Internal error. 3568 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3569 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3570 * @throws { BusinessError } 1600012 - No memory space. 3571 * @syscap SystemCapability.Notification.Notification 3572 * @systemapi 3573 * @since 11 3574 */ 3575 /** 3576 * Subscribe to system live view notifications 3577 * 3578 * @param { SystemLiveViewSubscriber } subscriber - The system live vie notification subscriber. 3579 * @returns { Promise<void> } The promise returned by the function. 3580 * @throws { BusinessError } 202 - Not system application to call the interface. 3581 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3582 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3583 * @throws { BusinessError } 801 - Capability not supported. 3584 * @throws { BusinessError } 1600001 - Internal error. 3585 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3586 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3587 * @throws { BusinessError } 1600012 - No memory space. 3588 * @syscap SystemCapability.Notification.Notification 3589 * @systemapi 3590 * @since 18 3591 */ 3592 function subscribeSystemLiveView(subscriber: SystemLiveViewSubscriber): Promise<void>; 3593 3594 /** 3595 * Set basic configurations of application-level notification channels. 3596 * 3597 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3598 * @param { BundleOption } bundle - The bundle option. 3599 * @param { number } slotFlags - Indicates the slotFlags. 3600 * @returns { Promise<void> } The promise returned by the function. 3601 * @throws { BusinessError } 201 - Permission denied. 3602 * @throws { BusinessError } 202 - Not system application to call the interface. 3603 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3604 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3605 * @throws { BusinessError } 1600001 - Internal error. 3606 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3607 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3608 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3609 * @syscap SystemCapability.Notification.Notification 3610 * @systemapi 3611 * @since 11 3612 */ 3613 /** 3614 * Set basic configurations of application-level notification channels. 3615 * 3616 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3617 * @param { BundleOption } bundle - The bundle option. 3618 * @param { number } slotFlags - Indicates the slotFlags. 3619 * @returns { Promise<void> } The promise returned by the function. 3620 * @throws { BusinessError } 201 - Permission denied. 3621 * @throws { BusinessError } 202 - Not system application to call the interface. 3622 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3623 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3624 * @throws { BusinessError } 801 - Capability not supported. 3625 * @throws { BusinessError } 1600001 - Internal error. 3626 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3627 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3628 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3629 * @syscap SystemCapability.Notification.Notification 3630 * @systemapi 3631 * @since 18 3632 */ 3633 function setSlotFlagsByBundle(bundle: BundleOption, slotFlags: number): Promise<void>; 3634 3635 /** 3636 * Obtains basic configurations of application-level notification channels. 3637 * 3638 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3639 * @param { BundleOption } bundle - The bundle option. 3640 * @returns { Promise<number> } The promise returned by the function. 3641 * @throws { BusinessError } 201 - Permission denied. 3642 * @throws { BusinessError } 202 - Not system application to call the interface. 3643 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3644 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3645 * @throws { BusinessError } 1600001 - Internal error. 3646 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3647 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3648 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3649 * @syscap SystemCapability.Notification.Notification 3650 * @systemapi 3651 * @since 11 3652 */ 3653 /** 3654 * Obtains basic configurations of application-level notification channels. 3655 * 3656 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3657 * @param { BundleOption } bundle - The bundle option. 3658 * @returns { Promise<number> } The promise returned by the function. 3659 * @throws { BusinessError } 201 - Permission denied. 3660 * @throws { BusinessError } 202 - Not system application to call the interface. 3661 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3662 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3663 * @throws { BusinessError } 801 - Capability not supported. 3664 * @throws { BusinessError } 1600001 - Internal error. 3665 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3666 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3667 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 3668 * @syscap SystemCapability.Notification.Notification 3669 * @systemapi 3670 * @since 18 3671 */ 3672 function getSlotFlagsByBundle(bundle: BundleOption): Promise<number>; 3673 3674 /** 3675 * Add do not disturb notification templates. 3676 * 3677 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3678 * @param { Array<DoNotDisturbProfile> } templates - The array of Notification templates. 3679 * @returns { Promise<void> } The promise returned by the function. 3680 * @throws { BusinessError } 201 - Permission denied. 3681 * @throws { BusinessError } 202 - Not system application to call the interface. 3682 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3683 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3684 * @throws { BusinessError } 1600001 - Internal error. 3685 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3686 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3687 * @throws { BusinessError } 1600012 - No memory space. 3688 * @syscap SystemCapability.Notification.Notification 3689 * @systemapi 3690 * @since 12 3691 */ 3692 /** 3693 * Add do not disturb notification templates. 3694 * 3695 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3696 * @param { Array<DoNotDisturbProfile> } templates - The array of Notification templates. 3697 * @returns { Promise<void> } The promise returned by the function. 3698 * @throws { BusinessError } 201 - Permission denied. 3699 * @throws { BusinessError } 202 - Not system application to call the interface. 3700 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3701 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3702 * @throws { BusinessError } 801 - Capability not supported. 3703 * @throws { BusinessError } 1600001 - Internal error. 3704 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3705 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3706 * @throws { BusinessError } 1600012 - No memory space. 3707 * @syscap SystemCapability.Notification.Notification 3708 * @systemapi 3709 * @since 18 3710 */ 3711 function addDoNotDisturbProfile(templates: Array<DoNotDisturbProfile>): Promise<void>; 3712 3713 /** 3714 * Remove do not disturb notification templates. 3715 * 3716 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3717 * @param { Array<DoNotDisturbProfile> } templates - The array of Notification templates. 3718 * @returns { Promise<void> } The promise returned by the function. 3719 * @throws { BusinessError } 201 - Permission denied. 3720 * @throws { BusinessError } 202 - Not system application to call the interface. 3721 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3722 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3723 * @throws { BusinessError } 1600001 - Internal error. 3724 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3725 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3726 * @throws { BusinessError } 1600012 - No memory space. 3727 * @syscap SystemCapability.Notification.Notification 3728 * @systemapi 3729 * @since 12 3730 */ 3731 /** 3732 * Remove do not disturb notification templates. 3733 * 3734 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3735 * @param { Array<DoNotDisturbProfile> } templates - The array of Notification templates. 3736 * @returns { Promise<void> } The promise returned by the function. 3737 * @throws { BusinessError } 201 - Permission denied. 3738 * @throws { BusinessError } 202 - Not system application to call the interface. 3739 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3740 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3741 * @throws { BusinessError } 801 - Capability not supported. 3742 * @throws { BusinessError } 1600001 - Internal error. 3743 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3744 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3745 * @throws { BusinessError } 1600012 - No memory space. 3746 * @syscap SystemCapability.Notification.Notification 3747 * @systemapi 3748 * @since 18 3749 */ 3750 function removeDoNotDisturbProfile(templates: Array<DoNotDisturbProfile>): Promise<void>; 3751 3752 /** 3753 * Set system additional config information of notification 3754 * 3755 * @permission ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3756 * @param { string } key - addition config key. 3757 * @param { string } value - addition config value. 3758 * @returns { Promise<number> } The promise returned by the function. 3759 * @throws { BusinessError } 201 - Permission denied. 3760 * @throws { BusinessError } 202 - Not system application to call the interface. 3761 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3762 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3763 * @throws { BusinessError } 1600001 - Internal error. 3764 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3765 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3766 * @syscap SystemCapability.Notification.Notification 3767 * @systemapi 3768 * @since 12 3769 */ 3770 /** 3771 * Set system additional config information of notification 3772 * 3773 * @permission ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3774 * @param { string } key - addition config key. 3775 * @param { string } value - addition config value. 3776 * @returns { Promise<number> } The promise returned by the function. 3777 * @throws { BusinessError } 201 - Permission denied. 3778 * @throws { BusinessError } 202 - Not system application to call the interface. 3779 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3780 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3781 * @throws { BusinessError } 801 - Capability not supported. 3782 * @throws { BusinessError } 1600001 - Internal error. 3783 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3784 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3785 * @syscap SystemCapability.Notification.Notification 3786 * @systemapi 3787 * @since 18 3788 */ 3789 function setAdditionalConfig(key: string, value: string): Promise<number>; 3790 3791 /** 3792 * Request open the notification settings pop-up window. 3793 * 3794 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 3795 * @returns { Promise<void> } The promise returned by the function. 3796 * @throws { BusinessError } 1600001 - Internal error. 3797 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3798 * @throws { BusinessError } 1600018 - the notification settings window is already displayed. 3799 * @syscap SystemCapability.Notification.NotificationSettings 3800 * @stagemodelonly 3801 * @since 13 3802 */ 3803 /** 3804 * Request open the notification settings pop-up window. 3805 * 3806 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 3807 * @returns { Promise<void> } The promise returned by the function. 3808 * @throws { BusinessError } 801 - Capability not supported. 3809 * @throws { BusinessError } 1600001 - Internal error. 3810 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3811 * @throws { BusinessError } 1600018 - the notification settings window is already displayed. 3812 * @syscap SystemCapability.Notification.NotificationSettings 3813 * @stagemodelonly 3814 * @since 18 3815 */ 3816 function openNotificationSettings(context: UIAbilityContext): Promise<void>; 3817 3818 /** 3819 * Get do not disturb profile by id. 3820 * 3821 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3822 * @param { number } id - The id of profile. 3823 * @returns { Promise<DoNotDisturbProfile> } The promise returned by the function. 3824 * @throws { BusinessError } 201 - Permission denied. 3825 * @throws { BusinessError } 202 - Not system application to call the interface. 3826 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3827 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3828 * @throws { BusinessError } 1600001 - Internal error. 3829 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3830 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3831 * @throws { BusinessError } 1600019 - The do-not-disturb profile does not exist. 3832 * @syscap SystemCapability.Notification.Notification 3833 * @systemapi 3834 * @since 13 3835 */ 3836 /** 3837 * Get do not disturb profile by id. 3838 * 3839 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3840 * @param { number } id - The id of profile. 3841 * @returns { Promise<DoNotDisturbProfile> } The promise returned by the function. 3842 * @throws { BusinessError } 201 - Permission denied. 3843 * @throws { BusinessError } 202 - Not system application to call the interface. 3844 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3845 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3846 * @throws { BusinessError } 801 - Capability not supported. 3847 * @throws { BusinessError } 1600001 - Internal error. 3848 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3849 * @throws { BusinessError } 1600003 - Failed to connect to the service. 3850 * @throws { BusinessError } 1600019 - The do-not-disturb profile does not exist. 3851 * @syscap SystemCapability.Notification.Notification 3852 * @systemapi 3853 * @since 18 3854 */ 3855 function getDoNotDisturbProfile(id: number): Promise<DoNotDisturbProfile>; 3856 3857 /** 3858 * Disabling notifications based on the application list. 3859 * 3860 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3861 * @param { boolean } disabled - The switch of disableNotification. 3862 * @param { Array<string> } bundleList - The bundles of disableNotification. 3863 * @returns { Promise<void> } The promise returned by the function. 3864 * @throws { BusinessError } 201 - Permission denied. 3865 * @throws { BusinessError } 202 - Not system application to call the interface. 3866 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3867 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3868 * @throws { BusinessError } 1600001 - Internal error. 3869 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 3870 * @syscap SystemCapability.Notification.Notification 3871 * @systemapi 3872 * @since 18 3873 */ 3874 function disableNotificationFeature(disabled:boolean, bundleList: Array<string>): Promise<void>; 3875 3876 /** 3877 * Set target device status. 3878 * 3879 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3880 * @param { string } deviceType - The device. 3881 * @param { number } status - The device status. 3882 * @returns { Promise<void> } The promise returned by the function. 3883 * @throws { BusinessError } 201 - Permission denied. 3884 * @throws { BusinessError } 202 - Not system application to call the interface. 3885 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3886 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3887 * @syscap SystemCapability.Notification.Notification 3888 * @systemapi 3889 * @since 18 3890 */ 3891 function setTargetDeviceStatus(deviceType: string, status: number): Promise<void>; 3892 3893 /** 3894 * Set notification slot synchronization switch. 3895 * 3896 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3897 * @param { SlotType } slot - The slot type. 3898 * @param { string } deviceType - The device type. 3899 * @param { boolean } enabled - The switch state. 3900 * @returns { Promise<void> } The promise returned by the function. 3901 * @throws { BusinessError } 201 - Permission denied. 3902 * @throws { BusinessError } 202 - Not system application to call the interface. 3903 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3904 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3905 * @syscap SystemCapability.Notification.Notification 3906 * @systemapi 3907 * @since 18 3908 */ 3909 function setDistributedEnabledBySlot(slot: SlotType, deviceType: string, enabled: boolean): Promise<void>; 3910 3911 /** 3912 * Get notification slot synchronization switch. 3913 * 3914 * @permission ohos.permission.NOTIFICATION_CONTROLLER 3915 * @param { SlotType } slot - The slot type. 3916 * @param { string } deviceType - The device type. 3917 * @returns { Promise<boolean> } The promise returned by the function. 3918 * @throws { BusinessError } 201 - Permission denied. 3919 * @throws { BusinessError } 202 - Not system application to call the interface. 3920 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 3921 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 3922 * @syscap SystemCapability.Notification.Notification 3923 * @systemapi 3924 * @since 18 3925 */ 3926 function isDistributedEnabledBySlot(slot: SlotType, deviceType: string): Promise<boolean>; 3927 3928 /** 3929 * Describes a button option for a triggering. 3930 * 3931 * @typedef ButtonOptions 3932 * @syscap SystemCapability.Notification.Notification 3933 * @systemapi 3934 * @since 11 3935 */ 3936 export interface ButtonOptions { 3937 /** 3938 * The button name for a triggering. 3939 * 3940 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3941 * @type { string } 3942 * @syscap SystemCapability.Notification.Notification 3943 * @systemapi 3944 * @since 11 3945 */ 3946 buttonName: string; 3947 } 3948 3949 /** 3950 * Describes a subscriber for system live view. 3951 * 3952 * @typedef SystemLiveViewSubscriber 3953 * @syscap SystemCapability.Notification.Notification 3954 * @systemapi 3955 * @since 11 3956 */ 3957 export interface SystemLiveViewSubscriber { 3958 /** 3959 * The callback function that receives a new button option of a notification. 3960 * 3961 * @type { ?function } 3962 * @syscap SystemCapability.Notification.Notification 3963 * @systemapi 3964 * @since 11 3965 */ 3966 onResponse?: (notificationId: number, buttonOptions: ButtonOptions) => void; 3967 } 3968 3969 /** 3970 * Describes the parameters of check notifications. 3971 * 3972 * @typedef NotificationCheckInfo 3973 * @syscap SystemCapability.Notification.Notification 3974 * @systemapi 3975 * @since 10 3976 */ 3977 export interface NotificationCheckInfo { 3978 /** 3979 * The application bundle name for publishing notification. 3980 * 3981 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3982 * @type { string } 3983 * @syscap SystemCapability.Notification.Notification 3984 * @systemapi 3985 * @since 10 3986 */ 3987 bundleName: string; 3988 3989 /** 3990 * The notification id. 3991 * 3992 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 3993 * @type { number } 3994 * @syscap SystemCapability.Notification.Notification 3995 * @systemapi 3996 * @since 10 3997 */ 3998 notificationId: number; 3999 4000 /** 4001 * Label of the notification. 4002 * 4003 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 4004 * @type { ?string } 4005 * @syscap SystemCapability.Notification.Notification 4006 * @systemapi 4007 * @since 11 4008 */ 4009 label?: string; 4010 4011 /** 4012 * The notification content type. 4013 * 4014 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 4015 * @type { ContentType } 4016 * @syscap SystemCapability.Notification.Notification 4017 * @systemapi 4018 * @since 10 4019 */ 4020 contentType: ContentType; 4021 4022 /** 4023 * UserId of the notification creator. 4024 * 4025 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 4026 * @type { number } 4027 * @syscap SystemCapability.Notification.Notification 4028 * @systemapi 4029 * @since 11 4030 */ 4031 creatorUserId: number; 4032 4033 /** 4034 * Type of the notification slot. 4035 * 4036 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 4037 * @type { SlotType } 4038 * @syscap SystemCapability.Notification.Notification 4039 * @systemapi 4040 * @since 11 4041 */ 4042 slotType: SlotType; 4043 4044 /** 4045 * Additional information of the live view notification. 4046 * 4047 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 4048 * @type { ?Record<string, Object> } 4049 * @syscap SystemCapability.Notification.Notification 4050 * @systemapi 4051 * @since 11 4052 */ 4053 extraInfos?: Record<string, Object>; 4054 } 4055 4056 /** 4057 * Describes the result of check notifications. 4058 * 4059 * @typedef NotificationCheckResult 4060 * @syscap SystemCapability.Notification.Notification 4061 * @systemapi 4062 * @since 10 4063 */ 4064 export interface NotificationCheckResult { 4065 /** 4066 * The result code. 0-display, 1-no display 4067 * 4068 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 4069 * @type { number } 4070 * @syscap SystemCapability.Notification.Notification 4071 * @systemapi 4072 * @since 10 4073 */ 4074 code: number; 4075 4076 /** 4077 * The result message. 4078 * 4079 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 4080 * @type { string } 4081 * @syscap SystemCapability.Notification.Notification 4082 * @systemapi 4083 * @since 10 4084 */ 4085 message: string; 4086 } 4087 4088 /** 4089 * Describes NotificationSlot types. 4090 * 4091 * @enum { number } 4092 * @syscap SystemCapability.Notification.Notification 4093 * @since 9 4094 */ 4095 /** 4096 * Describes NotificationSlot types. 4097 * 4098 * @enum { number } 4099 * @syscap SystemCapability.Notification.Notification 4100 * @atomicservice 4101 * @since 12 4102 */ 4103 export enum SlotType { 4104 /** 4105 * NotificationSlot of an unknown type. 4106 * 4107 * @syscap SystemCapability.Notification.Notification 4108 * @since 9 4109 */ 4110 /** 4111 * NotificationSlot of an unknown type. 4112 * 4113 * @syscap SystemCapability.Notification.Notification 4114 * @atomicservice 4115 * @since 12 4116 */ 4117 UNKNOWN_TYPE = 0, 4118 4119 /** 4120 * NotificationSlot for social communication. 4121 * 4122 * @syscap SystemCapability.Notification.Notification 4123 * @since 9 4124 */ 4125 /** 4126 * NotificationSlot for social communication. 4127 * 4128 * @syscap SystemCapability.Notification.Notification 4129 * @atomicservice 4130 * @since 12 4131 */ 4132 SOCIAL_COMMUNICATION = 1, 4133 4134 /** 4135 * NotificationSlot for service information. 4136 * 4137 * @syscap SystemCapability.Notification.Notification 4138 * @since 9 4139 */ 4140 /** 4141 * NotificationSlot for service information. 4142 * 4143 * @syscap SystemCapability.Notification.Notification 4144 * @atomicservice 4145 * @since 12 4146 */ 4147 SERVICE_INFORMATION = 2, 4148 4149 /** 4150 * NotificationSlot for content information. 4151 * 4152 * @syscap SystemCapability.Notification.Notification 4153 * @since 9 4154 */ 4155 /** 4156 * NotificationSlot for content information. 4157 * 4158 * @syscap SystemCapability.Notification.Notification 4159 * @atomicservice 4160 * @since 12 4161 */ 4162 CONTENT_INFORMATION = 3, 4163 4164 /** 4165 * NotificationSlot for live view. 4166 * 4167 * @syscap SystemCapability.Notification.Notification 4168 * @since 11 4169 */ 4170 /** 4171 * NotificationSlot for live view. 4172 * 4173 * @syscap SystemCapability.Notification.Notification 4174 * @atomicservice 4175 * @since 12 4176 */ 4177 LIVE_VIEW = 4, 4178 4179 /** 4180 * NotificationSlot for customer service. 4181 * 4182 * @syscap SystemCapability.Notification.Notification 4183 * @since 11 4184 */ 4185 /** 4186 * NotificationSlot for customer service. 4187 * 4188 * @syscap SystemCapability.Notification.Notification 4189 * @atomicservice 4190 * @since 12 4191 */ 4192 CUSTOMER_SERVICE = 5, 4193 4194 /** 4195 * NotificationSlot for emergency information. 4196 * 4197 * @syscap SystemCapability.Notification.Notification 4198 * @systemapi 4199 * @since 12 4200 */ 4201 EMERGENCY_INFORMATION = 10, 4202 4203 /** 4204 * NotificationSlot for other purposes. 4205 * 4206 * @syscap SystemCapability.Notification.Notification 4207 * @since 9 4208 */ 4209 /** 4210 * NotificationSlot for other purposes. 4211 * 4212 * @syscap SystemCapability.Notification.Notification 4213 * @atomicservice 4214 * @since 12 4215 */ 4216 OTHER_TYPES = 0xFFFF 4217 } 4218 4219 /** 4220 * Describes notification content types. 4221 * 4222 * @enum { number } 4223 * @syscap SystemCapability.Notification.Notification 4224 * @since 9 4225 */ 4226 /** 4227 * Describes notification content types. 4228 * 4229 * @enum { number } 4230 * @syscap SystemCapability.Notification.Notification 4231 * @crossplatform 4232 * @atomicservice 4233 * @since 12 4234 */ 4235 export enum ContentType { 4236 /** 4237 * Normal text notification. 4238 * 4239 * @syscap SystemCapability.Notification.Notification 4240 * @since 9 4241 */ 4242 /** 4243 * Normal text notification. 4244 * 4245 * @syscap SystemCapability.Notification.Notification 4246 * @crossplatform 4247 * @atomicservice 4248 * @since 12 4249 */ 4250 NOTIFICATION_CONTENT_BASIC_TEXT, 4251 4252 /** 4253 * Long text notification. 4254 * 4255 * @syscap SystemCapability.Notification.Notification 4256 * @since 9 4257 */ 4258 /** 4259 * Long text notification. 4260 * 4261 * @syscap SystemCapability.Notification.Notification 4262 * @crossplatform 4263 * @atomicservice 4264 * @since 12 4265 */ 4266 NOTIFICATION_CONTENT_LONG_TEXT, 4267 4268 /** 4269 * Picture-attached notification. 4270 * 4271 * @syscap SystemCapability.Notification.Notification 4272 * @since 9 4273 */ 4274 /** 4275 * Picture-attached notification. 4276 * 4277 * @syscap SystemCapability.Notification.Notification 4278 * @atomicservice 4279 * @since 12 4280 */ 4281 NOTIFICATION_CONTENT_PICTURE, 4282 4283 /** 4284 * Conversation notification. 4285 * 4286 * @syscap SystemCapability.Notification.Notification 4287 * @since 9 4288 */ 4289 /** 4290 * Conversation notification. 4291 * 4292 * @syscap SystemCapability.Notification.Notification 4293 * @atomicservice 4294 * @since 12 4295 */ 4296 NOTIFICATION_CONTENT_CONVERSATION, 4297 4298 /** 4299 * Multi-line text notification. 4300 * 4301 * @syscap SystemCapability.Notification.Notification 4302 * @since 9 4303 */ 4304 /** 4305 * Multi-line text notification. 4306 * 4307 * @syscap SystemCapability.Notification.Notification 4308 * @crossplatform 4309 * @atomicservice 4310 * @since 12 4311 */ 4312 NOTIFICATION_CONTENT_MULTILINE, 4313 4314 /** 4315 * System local live view notification. 4316 * 4317 * @syscap SystemCapability.Notification.Notification 4318 * @since 11 4319 */ 4320 /** 4321 * System local live view notification. 4322 * 4323 * @syscap SystemCapability.Notification.Notification 4324 * @atomicservice 4325 * @since 12 4326 */ 4327 NOTIFICATION_CONTENT_SYSTEM_LIVE_VIEW, 4328 4329 /** 4330 * Common live view notification. 4331 * 4332 * @syscap SystemCapability.Notification.Notification 4333 * @since 11 4334 */ 4335 /** 4336 * Common live view notification. 4337 * 4338 * @syscap SystemCapability.Notification.Notification 4339 * @atomicservice 4340 * @since 12 4341 */ 4342 NOTIFICATION_CONTENT_LIVE_VIEW, 4343 } 4344 4345 /** 4346 * Indicates the level of the slot 4347 * 4348 * @enum { number } 4349 * @syscap SystemCapability.Notification.Notification 4350 * @since 9 4351 */ 4352 export enum SlotLevel { 4353 /** 4354 * Indicates that the notification function is disabled. 4355 * 4356 * @syscap SystemCapability.Notification.Notification 4357 * @since 9 4358 */ 4359 LEVEL_NONE = 0, 4360 4361 /** 4362 * Indicates that the notification function is enabled but notification 4363 * icons are not displayed in the status bar, with no banner or prompt tone. 4364 * 4365 * @syscap SystemCapability.Notification.Notification 4366 * @since 9 4367 */ 4368 LEVEL_MIN = 1, 4369 4370 /** 4371 * Indicates that the notification function is enabled and notification 4372 * icons are displayed in the status bar, with no banner or prompt tone. 4373 * 4374 * @syscap SystemCapability.Notification.Notification 4375 * @since 9 4376 */ 4377 LEVEL_LOW = 2, 4378 4379 /** 4380 * Indicates that the notification function is enabled and notification 4381 * icons are displayed in the status bar, with no banner but with a prompt tone. 4382 * 4383 * @syscap SystemCapability.Notification.Notification 4384 * @since 9 4385 */ 4386 LEVEL_DEFAULT = 3, 4387 4388 /** 4389 * Indicates that the notification function is enabled and notification 4390 * icons are displayed in the status bar, with a banner and a prompt tone. 4391 * 4392 * @syscap SystemCapability.Notification.Notification 4393 * @since 9 4394 */ 4395 LEVEL_HIGH = 4 4396 } 4397 4398 /** 4399 * The type of the Do Not Disturb. 4400 * 4401 * @enum { number } 4402 * @syscap SystemCapability.Notification.Notification 4403 * @systemapi 4404 * @since 9 4405 */ 4406 export enum DoNotDisturbType { 4407 /** 4408 * Non do not disturb type notification 4409 * 4410 * @syscap SystemCapability.Notification.Notification 4411 * @systemapi 4412 * @since 9 4413 */ 4414 TYPE_NONE = 0, 4415 4416 /** 4417 * Execute do not disturb once in the set time period (only watch hours and minutes) 4418 * 4419 * @syscap SystemCapability.Notification.Notification 4420 * @systemapi 4421 * @since 9 4422 */ 4423 TYPE_ONCE = 1, 4424 4425 /** 4426 * Execute do not disturb every day with a set time period (only watch hours and minutes) 4427 * 4428 * @syscap SystemCapability.Notification.Notification 4429 * @systemapi 4430 * @since 9 4431 */ 4432 TYPE_DAILY = 2, 4433 4434 /** 4435 * Execute in the set time period (specify the time, month, day and hour) 4436 * 4437 * @syscap SystemCapability.Notification.Notification 4438 * @systemapi 4439 * @since 9 4440 */ 4441 TYPE_CLEARLY = 3 4442 } 4443 4444 /** 4445 * Describes a DoNotDisturbDate instance. 4446 * 4447 * @typedef DoNotDisturbDate 4448 * @syscap SystemCapability.Notification.Notification 4449 * @systemapi 4450 * @since 9 4451 */ 4452 export interface DoNotDisturbDate { 4453 /** 4454 * the type of the Do Not Disturb. 4455 * 4456 * @type { DoNotDisturbType } 4457 * @syscap SystemCapability.Notification.Notification 4458 * @systemapi 4459 * @since 9 4460 */ 4461 type: DoNotDisturbType; 4462 4463 /** 4464 * The start time of the Do Not Disturb. 4465 * 4466 * @type { Date } 4467 * @syscap SystemCapability.Notification.Notification 4468 * @systemapi 4469 * @since 9 4470 */ 4471 begin: Date; 4472 4473 /** 4474 * The end time of the Do Not Disturb. 4475 * 4476 * @type { Date } 4477 * @syscap SystemCapability.Notification.Notification 4478 * @systemapi 4479 * @since 9 4480 */ 4481 end: Date; 4482 } 4483 4484 /** 4485 * Describes a DoNotDisturbProfile instance. 4486 * 4487 * @typedef DoNotDisturbProfile 4488 * @syscap SystemCapability.Notification.Notification 4489 * @systemapi 4490 * @since 12 4491 */ 4492 export interface DoNotDisturbProfile { 4493 /** 4494 * The profile id of the Do Not disturb. 4495 * 4496 * @type { number } 4497 * @syscap SystemCapability.Notification.Notification 4498 * @systemapi 4499 * @since 12 4500 */ 4501 id: number; 4502 4503 /** 4504 * The profile name of the Do Not disturb. 4505 * 4506 * @type { string } 4507 * @syscap SystemCapability.Notification.Notification 4508 * @systemapi 4509 * @since 12 4510 */ 4511 name: string; 4512 4513 /** 4514 * The trustlist of application. 4515 * 4516 * @type { ?Array<BundleOption> } 4517 * @syscap SystemCapability.Notification.Notification 4518 * @systemapi 4519 * @since 12 4520 */ 4521 trustlist?: Array<BundleOption>; 4522 } 4523 4524 /** 4525 * The remind type of the notification. 4526 * 4527 * @enum { number } 4528 * @syscap SystemCapability.Notification.Notification 4529 * @systemapi 4530 * @since 9 4531 */ 4532 export enum DeviceRemindType { 4533 /** 4534 * The device is not in use, no reminder 4535 * 4536 * @syscap SystemCapability.Notification.Notification 4537 * @systemapi 4538 * @since 9 4539 */ 4540 IDLE_DONOT_REMIND = 0, 4541 4542 /** 4543 * The device is not in use, remind 4544 * 4545 * @syscap SystemCapability.Notification.Notification 4546 * @systemapi 4547 * @since 9 4548 */ 4549 IDLE_REMIND = 1, 4550 4551 /** 4552 * The device is in use, no reminder 4553 * 4554 * @syscap SystemCapability.Notification.Notification 4555 * @systemapi 4556 * @since 9 4557 */ 4558 ACTIVE_DONOT_REMIND = 2, 4559 4560 /** 4561 * The device is in use, reminder 4562 * 4563 * @syscap SystemCapability.Notification.Notification 4564 * @systemapi 4565 * @since 9 4566 */ 4567 ACTIVE_REMIND = 3 4568 } 4569 4570 /** 4571 * Notification source type 4572 * 4573 * @enum { number } 4574 * @syscap SystemCapability.Notification.Notification 4575 * @systemapi 4576 * @since 9 4577 */ 4578 export enum SourceType { 4579 /** 4580 * General notification 4581 * 4582 * @syscap SystemCapability.Notification.Notification 4583 * @systemapi 4584 * @since 9 4585 */ 4586 TYPE_NORMAL = 0, 4587 4588 /** 4589 * Continuous notification 4590 * 4591 * @syscap SystemCapability.Notification.Notification 4592 * @systemapi 4593 * @since 9 4594 */ 4595 TYPE_CONTINUOUS = 1, 4596 4597 /** 4598 * Scheduled notification 4599 * 4600 * @syscap SystemCapability.Notification.Notification 4601 * @systemapi 4602 * @since 9 4603 */ 4604 TYPE_TIMER = 2 4605 } 4606 4607 /** 4608 * Enum for notification control flag status. 4609 * 4610 * @enum { number } 4611 * @syscap SystemCapability.Notification.Notification 4612 * @systemapi 4613 * @since 12 4614 */ 4615 export enum NotificationControlFlagStatus { 4616 /** 4617 * Manipulating of the enumeration by bitwise-or operation represents the closing of ringtone. 4618 * @syscap SystemCapability.Notification.Notification 4619 * @systemapi 4620 * @since 12 4621 */ 4622 NOTIFICATION_STATUS_CLOSE_SOUND = 1 << 0, 4623 4624 /** 4625 * Manipulating of the enumeration by bitwise-or operation represents the closing of lock screen. 4626 * @syscap SystemCapability.Notification.Notification 4627 * @systemapi 4628 * @since 12 4629 */ 4630 NOTIFICATION_STATUS_CLOSE_LOCKSCREEN = 1 << 1, 4631 4632 /** 4633 * Manipulating of the enumeration by bitwise-or operation represents the closing of banner. 4634 * @syscap SystemCapability.Notification.Notification 4635 * @systemapi 4636 * @since 12 4637 */ 4638 NOTIFICATION_STATUS_CLOSE_BANNER = 1 << 2, 4639 4640 /** 4641 * Manipulating of the enumeration by bitwise-or operation represents the closing of light screen. 4642 * @syscap SystemCapability.Notification.Notification 4643 * @systemapi 4644 * @since 12 4645 */ 4646 NOTIFICATION_STATUS_CLOSE_LIGHT_SCREEN = 1 << 3, 4647 4648 /** 4649 * Manipulating of the enumeration by bitwise-or operation represents the closing of vibration. 4650 * @syscap SystemCapability.Notification.Notification 4651 * @systemapi 4652 * @since 12 4653 */ 4654 NOTIFICATION_STATUS_CLOSE_VIBRATION = 1 << 4, 4655 4656 /** 4657 * Manipulating of the enumeration by bitwise-or operation represents the closing of status bar icon. 4658 * @syscap SystemCapability.Notification.Notification 4659 * @systemapi 4660 * @since 12 4661 */ 4662 NOTIFICATION_STATUS_CLOSE_STATUSBAR_ICON = 1 << 5 4663 } 4664 4665 /** 4666 * Describes a bundleOption in a notification. 4667 * 4668 * @typedef { _BundleOption } BundleOption 4669 * @syscap SystemCapability.Notification.Notification 4670 * @since 9 4671 */ 4672 export type BundleOption = _BundleOption; 4673 4674 /** 4675 * Describes an action button displayed in a notification. 4676 * 4677 * @typedef { _NotificationActionButton } NotificationActionButton 4678 * @syscap SystemCapability.Notification.Notification 4679 * @since 9 4680 */ 4681 export type NotificationActionButton = _NotificationActionButton; 4682 4683 /** 4684 * Describes a normal text notification. 4685 * 4686 * @syscap SystemCapability.Notification.Notification 4687 * @since 9 4688 */ 4689 /** 4690 * Describes a normal text notification. 4691 * 4692 * @typedef { _NotificationBasicContent } NotificationBasicContent 4693 * @syscap SystemCapability.Notification.Notification 4694 * @crossplatform 4695 * @since 12 4696 */ 4697 export type NotificationBasicContent = _NotificationBasicContent; 4698 4699 /** 4700 * Describes notification types. 4701 * 4702 * @syscap SystemCapability.Notification.Notification 4703 * @since 9 4704 */ 4705 /** 4706 * Describes notification types. 4707 * 4708 * @typedef { _NotificationContent } NotificationContent 4709 * @syscap SystemCapability.Notification.Notification 4710 * @crossplatform 4711 * @since 12 4712 */ 4713 export type NotificationContent = _NotificationContent; 4714 4715 /** 4716 * Describes a long text notification. 4717 * 4718 * @syscap SystemCapability.Notification.Notification 4719 * @since 9 4720 */ 4721 /** 4722 * Describes a long text notification. 4723 * 4724 * @typedef { _NotificationLongTextContent } NotificationLongTextContent 4725 * @syscap SystemCapability.Notification.Notification 4726 * @crossplatform 4727 * @since 12 4728 */ 4729 export type NotificationLongTextContent = _NotificationLongTextContent; 4730 4731 /** 4732 * Describes a live view notification. 4733 * 4734 * @typedef { _NotificationLiveViewContent } NotificationLiveViewContent 4735 * @syscap SystemCapability.Notification.Notification 4736 * @systemapi 4737 * @since 11 4738 */ 4739 export type NotificationLiveViewContent = _NotificationLiveViewContent; 4740 4741 /** 4742 * Describes a multi-line text notification. 4743 * 4744 * @syscap SystemCapability.Notification.Notification 4745 * @since 9 4746 */ 4747 /** 4748 * Describes a multi-line text notification. 4749 * 4750 * @typedef { _NotificationMultiLineContent } NotificationMultiLineContent 4751 * @syscap SystemCapability.Notification.Notification 4752 * @crossplatform 4753 * @since 12 4754 */ 4755 export type NotificationMultiLineContent = _NotificationMultiLineContent; 4756 4757 /** 4758 * Describes a picture-attached notification. 4759 * 4760 * @typedef { _NotificationPictureContent } NotificationPictureContent 4761 * @syscap SystemCapability.Notification.Notification 4762 * @since 9 4763 */ 4764 export type NotificationPictureContent = _NotificationPictureContent; 4765 4766 /** 4767 * Describes a system live view notification. 4768 * 4769 * @typedef { _NotificationSystemLiveViewContent } NotificationSystemLiveViewContent 4770 * @syscap SystemCapability.Notification.Notification 4771 * @since 11 4772 */ 4773 export type NotificationSystemLiveViewContent = _NotificationSystemLiveViewContent; 4774 4775 /** 4776 * Describes a NotificationFlags instance. 4777 * 4778 * @typedef { _NotificationFlags } NotificationFlags 4779 * @syscap SystemCapability.Notification.Notification 4780 * @systemapi 4781 * @since 9 4782 */ 4783 export type NotificationFlags = _NotificationFlags; 4784 4785 /** 4786 * The status of the notification flag. 4787 * 4788 * @typedef { _NotificationFlagStatus } NotificationFlagStatus 4789 * @syscap SystemCapability.Notification.Notification 4790 * @systemapi 4791 * @since 9 4792 */ 4793 export type NotificationFlagStatus = _NotificationFlagStatus; 4794 4795 /** 4796 * Defines a NotificationRequest instance. 4797 * 4798 * @syscap SystemCapability.Notification.Notification 4799 * @since 9 4800 */ 4801 /** 4802 * Defines a NotificationRequest instance. 4803 * 4804 * @typedef { _NotificationRequest } NotificationRequest 4805 * @syscap SystemCapability.Notification.Notification 4806 * @crossplatform 4807 * @since 12 4808 */ 4809 export type NotificationRequest = _NotificationRequest; 4810 4811 /** 4812 * Defines a UnifiedGroupInfo instance. 4813 * 4814 * @typedef { _UnifiedGroupInfo } UnifiedGroupInfo 4815 * @syscap SystemCapability.Notification.Notification 4816 * @systemapi 4817 * @since 12 4818 */ 4819 export type UnifiedGroupInfo = _UnifiedGroupInfo; 4820 4821 /** 4822 * Defines a NotificationFilter instance. 4823 * 4824 * @typedef { _NotificationFilter } NotificationFilter 4825 * @syscap SystemCapability.Notification.Notification 4826 * @systemapi 4827 * @since 11 4828 */ 4829 export type NotificationFilter = _NotificationFilter; 4830 4831 /** 4832 * Defines a NotificationCheckRequest instance. 4833 * 4834 * @typedef { _NotificationCheckRequest } NotificationCheckRequest 4835 * @syscap SystemCapability.Notification.Notification 4836 * @systemapi 4837 * @since 11 4838 */ 4839 export type NotificationCheckRequest = _NotificationCheckRequest; 4840 4841 /** 4842 * Describes distributed options. 4843 * 4844 * @typedef { _DistributedOptions } DistributedOptions 4845 * @syscap SystemCapability.Notification.Notification 4846 * @since 9 4847 */ 4848 export type DistributedOptions = _DistributedOptions; 4849 4850 /** 4851 * Describes a NotificationSlot instance. 4852 * 4853 * @typedef { _NotificationSlot } NotificationSlot 4854 * @syscap SystemCapability.Notification.Notification 4855 * @since 9 4856 */ 4857 export type NotificationSlot = _NotificationSlot; 4858 4859 /** 4860 * Describes live view notification option type. 4861 * 4862 * @typedef { _LiveViewStatus } LiveViewStatus 4863 * @syscap SystemCapability.Notification.Notification 4864 * @systemapi 4865 * @since 11 4866 */ 4867 export type LiveViewStatus = _LiveViewStatus; 4868 4869 /** 4870 * Describes live view notification task type. 4871 * 4872 * @typedef { _LiveViewTypes } LiveViewTypes 4873 * @syscap SystemCapability.Notification.Notification 4874 * @systemapi 4875 * @since 18 4876 */ 4877 export type LiveViewTypes = _LiveViewTypes; 4878 4879 /** 4880 * Provides sorting information about an active notification. 4881 * 4882 * @typedef { _NotificationSorting } NotificationSorting 4883 * @syscap SystemCapability.Notification.Notification 4884 * @systemapi 4885 * @since 9 4886 */ 4887 export type NotificationSorting = _NotificationSorting; 4888 4889 /** 4890 * Describes a NotificationTemplate instance. 4891 * 4892 * @typedef { _NotificationTemplate } NotificationTemplate 4893 * @syscap SystemCapability.Notification.Notification 4894 * @since 9 4895 */ 4896 export type NotificationTemplate = _NotificationTemplate; 4897 4898 /** 4899 * Describes a NotificationUserInput instance. 4900 * 4901 * @typedef { _NotificationUserInput } NotificationUserInput 4902 * @syscap SystemCapability.Notification.Notification 4903 * @since 9 4904 */ 4905 export type NotificationUserInput = _NotificationUserInput; 4906 4907 /** 4908 * Describes a system live view capsule type. 4909 * 4910 * @typedef { _NotificationCapsule } NotificationCapsule 4911 * @syscap SystemCapability.Notification.Notification 4912 * @since 11 4913 */ 4914 export type NotificationCapsule = _NotificationCapsule; 4915 4916 /** 4917 * Describes a system live view button type. 4918 * 4919 * @typedef { _NotificationButton } NotificationButton 4920 * @syscap SystemCapability.Notification.Notification 4921 * @since 11 4922 */ 4923 export type NotificationButton = _NotificationButton; 4924 4925 /** 4926 * Describes a system live view time type. 4927 * 4928 * @typedef { _NotificationTime } NotificationTime 4929 * @syscap SystemCapability.Notification.Notification 4930 * @since 11 4931 */ 4932 export type NotificationTime = _NotificationTime; 4933 4934 /** 4935 * Describes a system live view progress type. 4936 * 4937 * @typedef { _NotificationProgress } NotificationProgress 4938 * @syscap SystemCapability.Notification.Notification 4939 * @since 11 4940 */ 4941 export type NotificationProgress = _NotificationProgress; 4942} 4943 4944export default notificationManager; 4945