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 { NotificationSystemLiveViewContent as _NotificationSystemLiveViewContent } from './notification/notificationContent'; 32import { NotificationCapsule as _NotificationCapsule } from './notification/notificationContent'; 33import { NotificationButton as _NotificationButton } from './notification/notificationContent'; 34import { NotificationTime as _NotificationTime } from './notification/notificationContent'; 35import { NotificationProgress as _NotificationProgress } from './notification/notificationContent'; 36import { NotificationFlags as _NotificationFlags } from './notification/notificationFlags'; 37import { NotificationFlagStatus as _NotificationFlagStatus } from './notification/notificationFlags'; 38import { NotificationRequest as _NotificationRequest } from './notification/notificationRequest'; 39import { UnifiedGroupInfo as _UnifiedGroupInfo } from './notification/notificationRequest'; 40import { DistributedOptions as _DistributedOptions } from './notification/notificationRequest'; 41import type { NotificationFilter as _NotificationFilter } from './notification/notificationRequest'; 42import type { NotificationCheckRequest as _NotificationCheckRequest } from './notification/notificationRequest'; 43import { NotificationSlot as _NotificationSlot } from './notification/notificationSlot'; 44import { NotificationSorting as _NotificationSorting } from './notification/notificationSorting'; 45import { NotificationTemplate as _NotificationTemplate } from './notification/notificationTemplate'; 46import { NotificationUserInput as _NotificationUserInput } from './notification/notificationUserInput'; 47import type UIAbilityContext from './application/UIAbilityContext'; 48 49/** 50 * Manages notifications. 51 * <p>Generally, only system applications have permissions on notification subscription and unsubscribe. 52 * You can specify the content of a notification to be published and the content is carried by 53 * {@link NotificationRequest}. A notification ID is unique in an application and must be specified 54 * when using {@link NotificationRequest} to carry the notification content. If a notification 55 * with this ID has been published and you need to use this ID to publish another notification, 56 * the original notification will be updated. In addition, the notification ID can be used to cancel 57 * a notification by calling the {@link #cancel(int)} method. 58 * 59 * @namespace notificationManager 60 * @syscap SystemCapability.Notification.Notification 61 * @since 9 62 */ 63/** 64 * Manages notifications. 65 * <p>Generally, only system applications have permissions on notification subscription and unsubscribe. 66 * You can specify the content of a notification to be published and the content is carried by 67 * {@link NotificationRequest}. A notification ID is unique in an application and must be specified 68 * when using {@link NotificationRequest} to carry the notification content. If a notification 69 * with this ID has been published and you need to use this ID to publish another notification, 70 * the original notification will be updated. In addition, the notification ID can be used to cancel 71 * a notification by calling the {@link #cancel(int)} method. 72 * 73 * @namespace notificationManager 74 * @syscap SystemCapability.Notification.Notification 75 * @crossplatform 76 * @atomicservice 77 * @since 12 78 */ 79declare namespace notificationManager { 80 /** 81 * Publishes a notification. 82 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 83 * this method will update the notification. 84 * 85 * @param { NotificationRequest } request - notification request 86 * @param { AsyncCallback<void> } callback - The callback of publish. 87 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 88 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 89 * @throws { BusinessError } 1600001 - Internal error. 90 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 91 * @throws { BusinessError } 1600003 - Failed to connect to the service. 92 * @throws { BusinessError } 1600004 - Notification disabled. 93 * @throws { BusinessError } 1600005 - Notification slot disabled. 94 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 95 * @throws { BusinessError } 1600012 - No memory space. 96 * @syscap SystemCapability.Notification.Notification 97 * @since 9 98 */ 99 /** 100 * Publishes a notification. 101 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 102 * this method will update the notification. 103 * 104 * @param { NotificationRequest } request - notification request 105 * @param { AsyncCallback<void> } callback - The callback of publish. 106 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 107 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 108 * @throws { BusinessError } 1600001 - Internal error. 109 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 110 * @throws { BusinessError } 1600003 - Failed to connect to the service. 111 * @throws { BusinessError } 1600004 - Notification disabled. 112 * @throws { BusinessError } 1600005 - Notification slot disabled. 113 * @throws { BusinessError } 1600007 - The notification does not exist. 114 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 115 * @throws { BusinessError } 1600012 - No memory space. 116 * @throws { BusinessError } 1600014 - No permission. 117 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 118 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 119 * @throws { BusinessError } 2300007 - Network unreachable. 120 * @syscap SystemCapability.Notification.Notification 121 * @since 11 122 */ 123 /** 124 * Publishes a notification. 125 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 126 * this method will update the notification. 127 * 128 * @param { NotificationRequest } request - notification request 129 * @param { AsyncCallback<void> } callback - The callback of publish. 130 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 131 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 132 * @throws { BusinessError } 1600001 - Internal error. 133 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 134 * @throws { BusinessError } 1600003 - Failed to connect to the service. 135 * @throws { BusinessError } 1600004 - Notification disabled. 136 * @throws { BusinessError } 1600005 - Notification slot disabled. 137 * @throws { BusinessError } 1600007 - The notification does not exist. 138 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 139 * @throws { BusinessError } 1600012 - No memory space. 140 * @throws { BusinessError } 1600014 - No permission. 141 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 142 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 143 * @throws { BusinessError } 2300007 - Network unreachable. 144 * @syscap SystemCapability.Notification.Notification 145 * @crossplatform 146 * @since 12 147 */ 148 function publish(request: NotificationRequest, callback: AsyncCallback<void>): void; 149 150 /** 151 * Publishes a notification. 152 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 153 * this method will update the notification. 154 * 155 * @param { NotificationRequest } request - notification request 156 * @returns { Promise<void> } The promise returned by the function. 157 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 158 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 159 * @throws { BusinessError } 1600001 - Internal error. 160 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 161 * @throws { BusinessError } 1600003 - Failed to connect to the service. 162 * @throws { BusinessError } 1600004 - Notification disabled. 163 * @throws { BusinessError } 1600005 - Notification slot disabled. 164 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 165 * @throws { BusinessError } 1600012 - No memory space. 166 * @syscap SystemCapability.Notification.Notification 167 * @since 9 168 */ 169 /** 170 * Publishes a notification. 171 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 172 * this method will update the notification. 173 * 174 * @param { NotificationRequest } request - notification request 175 * @returns { Promise<void> } The promise returned by the function. 176 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 177 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 178 * @throws { BusinessError } 1600001 - Internal error. 179 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 180 * @throws { BusinessError } 1600003 - Failed to connect to the service. 181 * @throws { BusinessError } 1600004 - Notification disabled. 182 * @throws { BusinessError } 1600005 - Notification slot disabled. 183 * @throws { BusinessError } 1600007 - The notification does not exist. 184 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 185 * @throws { BusinessError } 1600012 - No memory space. 186 * @throws { BusinessError } 1600014 - No permission. 187 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 188 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 189 * @throws { BusinessError } 2300007 - Network unreachable. 190 * @syscap SystemCapability.Notification.Notification 191 * @since 11 192 */ 193 /** 194 * Publishes a notification. 195 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 196 * this method will update the notification. 197 * 198 * @param { NotificationRequest } request - notification request 199 * @returns { Promise<void> } The promise returned by the function. 200 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 201 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 202 * @throws { BusinessError } 1600001 - Internal error. 203 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 204 * @throws { BusinessError } 1600003 - Failed to connect to the service. 205 * @throws { BusinessError } 1600004 - Notification disabled. 206 * @throws { BusinessError } 1600005 - Notification slot disabled. 207 * @throws { BusinessError } 1600007 - The notification does not exist. 208 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 209 * @throws { BusinessError } 1600012 - No memory space. 210 * @throws { BusinessError } 1600014 - No permission. 211 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 212 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 213 * @throws { BusinessError } 2300007 - Network unreachable. 214 * @syscap SystemCapability.Notification.Notification 215 * @crossplatform 216 * @since 12 217 */ 218 function publish(request: NotificationRequest): Promise<void>; 219 220 /** 221 * Publishes a notification to the specified user. 222 * 223 * @permission ohos.permission.NOTIFICATION_CONTROLLER 224 * @param { NotificationRequest } request - a notification. 225 * @param { number } userId - of subscriber receiving the notification. 226 * @param { AsyncCallback<void> } callback - The callback of publish. 227 * @throws { BusinessError } 201 - Permission denied. 228 * @throws { BusinessError } 202 - Not system application to call the interface. 229 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 230 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 231 * @throws { BusinessError } 1600001 - Internal error. 232 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 233 * @throws { BusinessError } 1600003 - Failed to connect to the service. 234 * @throws { BusinessError } 1600004 - Notification disabled. 235 * @throws { BusinessError } 1600005 - Notification slot disabled. 236 * @throws { BusinessError } 1600008 - The user does not exist. 237 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 238 * @throws { BusinessError } 1600012 - No memory space. 239 * @syscap SystemCapability.Notification.Notification 240 * @systemapi 241 * @since 9 242 */ 243 /** 244 * Publishes a notification to the specified user. 245 * 246 * @permission ohos.permission.NOTIFICATION_CONTROLLER 247 * @param { NotificationRequest } request - a notification. 248 * @param { number } userId - of subscriber receiving the notification. 249 * @param { AsyncCallback<void> } callback - The callback of publish. 250 * @throws { BusinessError } 201 - Permission denied. 251 * @throws { BusinessError } 202 - Not system application to call the interface. 252 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 253 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 254 * @throws { BusinessError } 1600001 - Internal error. 255 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 256 * @throws { BusinessError } 1600003 - Failed to connect to the service. 257 * @throws { BusinessError } 1600004 - Notification disabled. 258 * @throws { BusinessError } 1600005 - Notification slot disabled. 259 * @throws { BusinessError } 1600007 - The notification does not exist. 260 * @throws { BusinessError } 1600008 - The user does not exist. 261 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 262 * @throws { BusinessError } 1600012 - No memory space. 263 * @throws { BusinessError } 1600014 - No permission. 264 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 265 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 266 * @throws { BusinessError } 2300007 - Network unreachable. 267 * @syscap SystemCapability.Notification.Notification 268 * @systemapi 269 * @since 11 270 */ 271 function publish(request: NotificationRequest, userId: number, callback: AsyncCallback<void>): void; 272 273 /** 274 * Publishes a notification to the specified user. 275 * 276 * @permission ohos.permission.NOTIFICATION_CONTROLLER 277 * @param { NotificationRequest } request - a notification. 278 * @param { number } userId - of subscriber receiving the notification. 279 * @returns { Promise<void> } The promise returned by the function. 280 * @throws { BusinessError } 201 - Permission denied. 281 * @throws { BusinessError } 202 - Not system application to call the interface. 282 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 283 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 284 * @throws { BusinessError } 1600001 - Internal error. 285 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 286 * @throws { BusinessError } 1600003 - Failed to connect to the service. 287 * @throws { BusinessError } 1600004 - Notification disabled. 288 * @throws { BusinessError } 1600005 - Notification slot disabled. 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 * @syscap SystemCapability.Notification.Notification 293 * @systemapi 294 * @since 9 295 */ 296 /** 297 * Publishes a notification to the specified user. 298 * 299 * @permission ohos.permission.NOTIFICATION_CONTROLLER 300 * @param { NotificationRequest } request - a notification. 301 * @param { number } userId - of subscriber receiving the notification. 302 * @returns { Promise<void> } The promise returned by the function. 303 * @throws { BusinessError } 201 - Permission denied. 304 * @throws { BusinessError } 202 - Not system application to call the interface. 305 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 306 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 307 * @throws { BusinessError } 1600001 - Internal error. 308 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 309 * @throws { BusinessError } 1600003 - Failed to connect to the service. 310 * @throws { BusinessError } 1600004 - Notification disabled. 311 * @throws { BusinessError } 1600005 - Notification slot disabled. 312 * @throws { BusinessError } 1600007 - The notification does not exist. 313 * @throws { BusinessError } 1600008 - The user does not exist. 314 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 315 * @throws { BusinessError } 1600012 - No memory space. 316 * @throws { BusinessError } 1600014 - No permission. 317 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 318 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 319 * @throws { BusinessError } 2300007 - Network unreachable. 320 * @syscap SystemCapability.Notification.Notification 321 * @systemapi 322 * @since 11 323 */ 324 function publish(request: NotificationRequest, userId: number): Promise<void>; 325 326 /** 327 * Publishes a representative notification. 328 * 329 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 330 * @param { NotificationRequest } request - a notification. 331 * @param { string } representativeBundle - bundle name of the representative 332 * @param { number } userId - userid of the representative 333 * @param { AsyncCallback<void> } callback - The callback of publishAsBundle. 334 * @throws { BusinessError } 201 - Permission denied. 335 * @throws { BusinessError } 202 - Not system application to call the interface. 336 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 337 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 338 * @throws { BusinessError } 1600001 - Internal error. 339 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 340 * @throws { BusinessError } 1600003 - Failed to connect to the service. 341 * @throws { BusinessError } 1600004 - Notification disabled. 342 * @throws { BusinessError } 1600005 - Notification slot disabled. 343 * @throws { BusinessError } 1600007 - The notification does not exist. 344 * @throws { BusinessError } 1600008 - The user does not exist. 345 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 346 * @throws { BusinessError } 1600012 - No memory space. 347 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 348 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 349 * @throws { BusinessError } 2300007 - Network unreachable. 350 * @syscap SystemCapability.Notification.Notification 351 * @systemapi 352 * @since 9 353 */ 354 function publishAsBundle( 355 request: NotificationRequest, 356 representativeBundle: string, 357 userId: number, 358 callback: AsyncCallback<void> 359 ): void; 360 361 /** 362 * Publishes a representative notification. 363 * 364 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 365 * @param { NotificationRequest } request - a notification. 366 * @param { string } representativeBundle - bundle name of the representative 367 * @param { number } userId - userid of the representative 368 * @returns { Promise<void> } The promise returned by the function. 369 * @throws { BusinessError } 201 - Permission denied. 370 * @throws { BusinessError } 202 - Not system application to call the interface. 371 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 372 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 373 * @throws { BusinessError } 1600001 - Internal error. 374 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 375 * @throws { BusinessError } 1600003 - Failed to connect to the service. 376 * @throws { BusinessError } 1600004 - Notification disabled. 377 * @throws { BusinessError } 1600005 - Notification slot disabled. 378 * @throws { BusinessError } 1600007 - The notification does not exist. 379 * @throws { BusinessError } 1600008 - The user does not exist. 380 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 381 * @throws { BusinessError } 1600012 - No memory space. 382 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 383 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 384 * @throws { BusinessError } 2300007 - Network unreachable. 385 * @syscap SystemCapability.Notification.Notification 386 * @systemapi 387 * @since 9 388 */ 389 function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise<void>; 390 391 /** 392 * Publishes a representative notification. 393 * 394 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 395 * @param { BundleOption } representativeBundle - bundle option of the representative. 396 * @param { NotificationRequest } request - a notification. 397 * @returns { Promise<void> } The promise returned by the function. 398 * @throws { BusinessError } 201 - Permission denied. 399 * @throws { BusinessError } 202 - Not system application to call the interface. 400 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 401 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 402 * @throws { BusinessError } 1600001 - Internal error. 403 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 404 * @throws { BusinessError } 1600003 - Failed to connect to the service. 405 * @throws { BusinessError } 1600004 - Notification disabled. 406 * @throws { BusinessError } 1600005 - Notification slot disabled. 407 * @throws { BusinessError } 1600007 - The notification does not exist. 408 * @throws { BusinessError } 1600008 - The user does not exist. 409 * @throws { BusinessError } 1600009 - The notification sending frequency reaches the upper limit. 410 * @throws { BusinessError } 1600012 - No memory space. 411 * @throws { BusinessError } 1600015 - The current notification status does not support duplicate configurations. 412 * @throws { BusinessError } 1600016 - The notification version for this update is too low. 413 * @throws { BusinessError } 2300007 - Network unreachable. 414 * @syscap SystemCapability.Notification.Notification 415 * @systemapi 416 * @since 12 417 */ 418 function publishAsBundle(representativeBundle: BundleOption, request: NotificationRequest): Promise<void>; 419 420 /** 421 * Cancel a notification with the specified ID. 422 * 423 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 424 * @param { AsyncCallback<void> } callback - The callback of cancel. 425 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 426 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 427 * @throws { BusinessError } 1600001 - Internal error. 428 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 429 * @throws { BusinessError } 1600003 - Failed to connect to the service. 430 * @throws { BusinessError } 1600007 - The notification does not exist. 431 * @syscap SystemCapability.Notification.Notification 432 * @since 9 433 */ 434 /** 435 * Cancel a notification with the specified ID. 436 * 437 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 438 * @param { AsyncCallback<void> } callback - The callback of cancel. 439 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 440 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 441 * @throws { BusinessError } 1600001 - Internal error. 442 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 443 * @throws { BusinessError } 1600003 - Failed to connect to the service. 444 * @throws { BusinessError } 1600007 - The notification does not exist. 445 * @syscap SystemCapability.Notification.Notification 446 * @crossplatform 447 * @since 12 448 */ 449 function cancel(id: number, callback: AsyncCallback<void>): void; 450 451 /** 452 * Cancel a notification with the specified label and ID. 453 * 454 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 455 * @param { string } label - Label of the notification to cancel. 456 * @param { AsyncCallback<void> } callback - The callback of cancel. 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 } 1600007 - The notification does not exist. 463 * @syscap SystemCapability.Notification.Notification 464 * @since 9 465 */ 466 function cancel(id: number, label: string, callback: AsyncCallback<void>): void; 467 468 /** 469 * Cancel a notification with the specified label and ID. 470 * 471 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 472 * @param { string } [label] - Label of the notification to cancel. 473 * @returns { Promise<void> } The promise returned by the function. 474 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 475 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 476 * @throws { BusinessError } 1600001 - Internal error. 477 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 478 * @throws { BusinessError } 1600003 - Failed to connect to the service. 479 * @throws { BusinessError } 1600007 - The notification does not exist. 480 * @syscap SystemCapability.Notification.Notification 481 * @since 9 482 */ 483 function cancel(id: number, label?: string): Promise<void>; 484 485 /** 486 * Cancel a notification with the representative and ID. 487 * 488 * @param { BundleOption } representativeBundle - bundle option of the representative. 489 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 490 * @returns { Promise<void> } The promise returned by the function. 491 * @throws { BusinessError } 202 - Not system application to call the interface. 492 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 493 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 494 * @throws { BusinessError } 1600001 - Internal error. 495 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 496 * @throws { BusinessError } 1600003 - Failed to connect to the service. 497 * @throws { BusinessError } 1600007 - The notification does not exist. 498 * @throws { BusinessError } 1600012 - No memory space. 499 * @throws { BusinessError } 1600017 - There is no corresponding agent relationship configuration. 500 * @syscap SystemCapability.Notification.Notification 501 * @systemapi 502 * @since 12 503 */ 504 function cancel(representativeBundle: BundleOption, id: number): Promise<void>; 505 506 /** 507 * Cancel a representative notification. 508 * 509 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 510 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 511 * @param { string } representativeBundle - bundle name of the representative. 512 * @param { number } userId - userid of the representative. 513 * @param { AsyncCallback<void> } callback - The callback of cancelAsBundle. 514 * @throws { BusinessError } 201 - Permission denied. 515 * @throws { BusinessError } 202 - Not system application to call the interface. 516 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 517 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 518 * @throws { BusinessError } 1600001 - Internal error. 519 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 520 * @throws { BusinessError } 1600003 - Failed to connect to the service. 521 * @throws { BusinessError } 1600007 - The notification does not exist. 522 * @throws { BusinessError } 1600008 - The user does not exist. 523 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 524 * @syscap SystemCapability.Notification.Notification 525 * @systemapi 526 * @since 9 527 */ 528 function cancelAsBundle( 529 id: number, 530 representativeBundle: string, 531 userId: number, 532 callback: AsyncCallback<void> 533 ): void; 534 535 /** 536 * Cancel a representative notification. 537 * 538 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 539 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 540 * @param { string } representativeBundle - bundle name of the representative. 541 * @param { number } userId - userid of the representative. 542 * @returns { Promise<void> } The promise returned by the function. 543 * @throws { BusinessError } 201 - Permission denied. 544 * @throws { BusinessError } 202 - Not system application to call the interface. 545 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 546 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 547 * @throws { BusinessError } 1600001 - Internal error. 548 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 549 * @throws { BusinessError } 1600003 - Failed to connect to the service. 550 * @throws { BusinessError } 1600007 - The notification does not exist. 551 * @throws { BusinessError } 1600008 - The user does not exist. 552 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 553 * @syscap SystemCapability.Notification.Notification 554 * @systemapi 555 * @since 9 556 */ 557 function cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise<void>; 558 559 /** 560 * Cancel a representative notification. 561 * 562 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 563 * @param { BundleOption } representativeBundle - bundle option of the representative. 564 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 565 * @returns { Promise<void> } The promise returned by the function. 566 * @throws { BusinessError } 201 - Permission denied. 567 * @throws { BusinessError } 202 - Not system application to call the interface. 568 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 569 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 570 * @throws { BusinessError } 1600001 - Internal error. 571 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 572 * @throws { BusinessError } 1600003 - Failed to connect to the service. 573 * @throws { BusinessError } 1600007 - The notification does not exist. 574 * @throws { BusinessError } 1600008 - The user does not exist. 575 * @throws { BusinessError } 1600012 - No memory space. 576 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 577 * @syscap SystemCapability.Notification.Notification 578 * @systemapi 579 * @since 12 580 */ 581 function cancelAsBundle(representativeBundle: BundleOption, id: number): Promise<void>; 582 583 /** 584 * Cancel all notifications of the current application. 585 * 586 * @param { AsyncCallback<void> } callback - The callback of cancelAll. 587 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 588 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 589 * @throws { BusinessError } 1600001 - Internal error. 590 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 591 * @throws { BusinessError } 1600003 - Failed to connect to the service. 592 * @syscap SystemCapability.Notification.Notification 593 * @since 9 594 */ 595 /** 596 * Cancel all notifications of the current application. 597 * 598 * @param { AsyncCallback<void> } callback - The callback of cancelAll. 599 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 600 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 601 * @throws { BusinessError } 1600001 - Internal error. 602 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 603 * @throws { BusinessError } 1600003 - Failed to connect to the service. 604 * @syscap SystemCapability.Notification.Notification 605 * @crossplatform 606 * @since 12 607 */ 608 function cancelAll(callback: AsyncCallback<void>): void; 609 610 /** 611 * Cancel all notifications of the current application. 612 * 613 * @returns { Promise<void> } The promise returned by the function. 614 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 615 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 616 * @throws { BusinessError } 1600001 - Internal error. 617 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 618 * @throws { BusinessError } 1600003 - Failed to connect to the service. 619 * @syscap SystemCapability.Notification.Notification 620 * @since 9 621 */ 622 /** 623 * Cancel all notifications of the current application. 624 * 625 * @returns { Promise<void> } The promise returned by the function. 626 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 627 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 628 * @throws { BusinessError } 1600001 - Internal error. 629 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 630 * @throws { BusinessError } 1600003 - Failed to connect to the service. 631 * @syscap SystemCapability.Notification.Notification 632 * @crossplatform 633 * @since 12 634 */ 635 function cancelAll(): Promise<void>; 636 637 /** 638 * Creates a notification slot. 639 * 640 * @permission ohos.permission.NOTIFICATION_CONTROLLER 641 * @param { NotificationSlot } slot - Indicates the notification slot to be created, which is set by {@link NotificationSlot}. 642 * @param { AsyncCallback<void> } callback - The callback of addSlot. 643 * @throws { BusinessError } 201 - Permission denied. 644 * @throws { BusinessError } 202 - Not system application to call the interface. 645 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 646 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 647 * @throws { BusinessError } 1600001 - Internal error. 648 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 649 * @throws { BusinessError } 1600003 - Failed to connect to the service. 650 * @throws { BusinessError } 1600012 - No memory space. 651 * @syscap SystemCapability.Notification.Notification 652 * @systemapi 653 * @since 9 654 */ 655 function addSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; 656 657 /** 658 * Creates a notification slot. 659 * 660 * @permission ohos.permission.NOTIFICATION_CONTROLLER 661 * @param { NotificationSlot } slot - Indicates the notification slot to be created, which is set by {@link NotificationSlot}. 662 * @returns { Promise<void> } The promise returned by the function. 663 * @throws { BusinessError } 201 - Permission denied. 664 * @throws { BusinessError } 202 - Not system application to call the interface. 665 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 666 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 667 * @throws { BusinessError } 1600001 - Internal error. 668 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 669 * @throws { BusinessError } 1600003 - Failed to connect to the service. 670 * @throws { BusinessError } 1600012 - No memory space. 671 * @syscap SystemCapability.Notification.Notification 672 * @systemapi 673 * @since 9 674 */ 675 function addSlot(slot: NotificationSlot): Promise<void>; 676 677 /** 678 * Adds a slot type. 679 * 680 * @param { SlotType } type - Slot type to add. 681 * @param { AsyncCallback<void> } callback - The callback of addSlot. 682 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 683 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 684 * @throws { BusinessError } 1600001 - Internal error. 685 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 686 * @throws { BusinessError } 1600003 - Failed to connect to the service. 687 * @throws { BusinessError } 1600012 - No memory space. 688 * @syscap SystemCapability.Notification.Notification 689 * @since 9 690 */ 691 function addSlot(type: SlotType, callback: AsyncCallback<void>): void; 692 693 /** 694 * Adds a slot type. 695 * 696 * @param { SlotType } type - Slot type to add. 697 * @returns { Promise<void> } The promise returned by the function. 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 * @since 9 706 */ 707 function addSlot(type: SlotType): Promise<void>; 708 709 /** 710 * Creates a notification slot. 711 * 712 * @permission ohos.permission.NOTIFICATION_CONTROLLER 713 * @param { Array<NotificationSlot> } slots - Indicates the notification slots to be created, which is set by {@link NotificationSlot}. 714 * @param { AsyncCallback<void> } callback - The callback of addSlots. 715 * @throws { BusinessError } 201 - Permission denied. 716 * @throws { BusinessError } 202 - Not system application to call the interface. 717 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 718 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 719 * @throws { BusinessError } 1600001 - Internal error. 720 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 721 * @throws { BusinessError } 1600003 - Failed to connect to the service. 722 * @throws { BusinessError } 1600012 - No memory space. 723 * @syscap SystemCapability.Notification.Notification 724 * @systemapi 725 * @since 9 726 */ 727 function addSlots(slots: Array<NotificationSlot>, callback: AsyncCallback<void>): void; 728 729 /** 730 * Creates a notification slot. 731 * 732 * @permission ohos.permission.NOTIFICATION_CONTROLLER 733 * @param { Array<NotificationSlot> } slots - Indicates the notification slots to be created, which is set by {@link NotificationSlot}. 734 * @returns { Promise<void> } The promise returned by the function. 735 * @throws { BusinessError } 201 - Permission denied. 736 * @throws { BusinessError } 202 - Not system application to call the interface. 737 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 738 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 739 * @throws { BusinessError } 1600001 - Internal error. 740 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 741 * @throws { BusinessError } 1600003 - Failed to connect to the service. 742 * @throws { BusinessError } 1600012 - No memory space. 743 * @syscap SystemCapability.Notification.Notification 744 * @systemapi 745 * @since 9 746 */ 747 function addSlots(slots: Array<NotificationSlot>): Promise<void>; 748 749 /** 750 * Obtains a notification slot of the specified slot type. 751 * 752 * @param { SlotType } slotType - Type of the notification slot to obtain. 753 * @param { AsyncCallback<NotificationSlot> } callback - The callback is used to return the NotificationSlot. 754 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 755 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 756 * @throws { BusinessError } 1600001 - Internal error. 757 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 758 * @throws { BusinessError } 1600003 - Failed to connect to the service. 759 * @syscap SystemCapability.Notification.Notification 760 * @since 9 761 */ 762 function getSlot(slotType: SlotType, callback: AsyncCallback<NotificationSlot>): void; 763 764 /** 765 * Obtains a notification slot of the specified slot type. 766 * 767 * @param { SlotType } slotType - Type of the notification slot to obtain. 768 * @returns { Promise<NotificationSlot> } Returns the NotificationSlot. 769 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 770 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 771 * @throws { BusinessError } 1600001 - Internal error. 772 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 773 * @throws { BusinessError } 1600003 - Failed to connect to the service. 774 * @syscap SystemCapability.Notification.Notification 775 * @since 9 776 */ 777 function getSlot(slotType: SlotType): Promise<NotificationSlot>; 778 779 /** 780 * Obtains all NotificationSlot objects created by the current application. 781 * 782 * @param { AsyncCallback<Array<NotificationSlot>> } callback - The callback is used to return all notification slots 783 * of this application. 784 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 785 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 786 * @throws { BusinessError } 1600001 - Internal error. 787 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 788 * @throws { BusinessError } 1600003 - Failed to connect to the service. 789 * @syscap SystemCapability.Notification.Notification 790 * @since 9 791 */ 792 function getSlots(callback: AsyncCallback<Array<NotificationSlot>>): void; 793 794 /** 795 * Obtains all NotificationSlot objects created by the current application. 796 * 797 * @returns { Promise<Array<NotificationSlot>> } Returns all notification slots of this application. 798 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 799 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 800 * @throws { BusinessError } 1600001 - Internal error. 801 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 802 * @throws { BusinessError } 1600003 - Failed to connect to the service. 803 * @syscap SystemCapability.Notification.Notification 804 * @since 9 805 */ 806 function getSlots(): Promise<Array<NotificationSlot>>; 807 808 /** 809 * Obtains allow notification application list. 810 * 811 * @permission ohos.permission.NOTIFICATION_CONTROLLER 812 * @returns { Promise<Array<BundleOption>> } Returns all enable notification applications. 813 * @throws { BusinessError } 201 - Permission denied. 814 * @throws { BusinessError } 202 - Not system application to call the interface. 815 * @throws { BusinessError } 1600001 - Internal error. 816 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 817 * @throws { BusinessError } 1600003 - Failed to connect to the service. 818 * @syscap SystemCapability.Notification.Notification 819 * @systemapi 820 * @since 12 821 */ 822 function getAllNotificationEnabledBundles(): Promise<Array<BundleOption>>; 823 824 /** 825 * Removes a NotificationSlot of the specified SlotType created by the current application. 826 * 827 * @param { SlotType } slotType - Type of the NotificationSlot to remove. 828 * @param { AsyncCallback<void> } callback - The callback of removeSlot. 829 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 830 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 831 * @throws { BusinessError } 1600001 - Internal error. 832 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 833 * @throws { BusinessError } 1600003 - Failed to connect to the service. 834 * @syscap SystemCapability.Notification.Notification 835 * @since 9 836 */ 837 function removeSlot(slotType: SlotType, callback: AsyncCallback<void>): void; 838 839 /** 840 * Removes a NotificationSlot of the specified SlotType created by the current application. 841 * 842 * @param { SlotType } slotType - Type of the NotificationSlot to remove. 843 * @returns { Promise<void> } The promise returned by the function. 844 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 845 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 846 * @throws { BusinessError } 1600001 - Internal error. 847 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 848 * @throws { BusinessError } 1600003 - Failed to connect to the service. 849 * @syscap SystemCapability.Notification.Notification 850 * @since 9 851 */ 852 function removeSlot(slotType: SlotType): Promise<void>; 853 854 /** 855 * Removes all NotificationSlot objects created by the current application. 856 * 857 * @param { AsyncCallback<void> } callback - The callback of removeAllSlots. 858 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 859 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 860 * @throws { BusinessError } 1600001 - Internal error. 861 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 862 * @throws { BusinessError } 1600003 - Failed to connect to the service. 863 * @syscap SystemCapability.Notification.Notification 864 * @since 9 865 */ 866 function removeAllSlots(callback: AsyncCallback<void>): void; 867 868 /** 869 * Removes all NotificationSlot objects created by the current application. 870 * 871 * @returns { Promise<void> } The promise returned by the function. 872 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 873 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 874 * @throws { BusinessError } 1600001 - Internal error. 875 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 876 * @throws { BusinessError } 1600003 - Failed to connect to the service. 877 * @syscap SystemCapability.Notification.Notification 878 * @since 9 879 */ 880 function removeAllSlots(): Promise<void>; 881 882 /** 883 * Set whether the application can send notifications. 884 * 885 * @permission ohos.permission.NOTIFICATION_CONTROLLER 886 * @param { BundleOption } bundle - The bundle option. 887 * @param { boolean } enable - Set enable or not. 888 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnable. 889 * @throws { BusinessError } 201 - Permission denied. 890 * @throws { BusinessError } 202 - Not system application to call the interface. 891 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 892 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 893 * @throws { BusinessError } 1600001 - Internal error. 894 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 895 * @throws { BusinessError } 1600003 - Failed to connect to the service. 896 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 897 * @syscap SystemCapability.Notification.Notification 898 * @systemapi 899 * @since 9 900 */ 901 function setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 902 903 /** 904 * Set whether the application can send notifications. 905 * 906 * @permission ohos.permission.NOTIFICATION_CONTROLLER 907 * @param { BundleOption } bundle - The bundle option. 908 * @param { boolean } enable - Set enable or not. 909 * @returns { Promise<void> } The promise returned by the function. 910 * @throws { BusinessError } 201 - Permission denied. 911 * @throws { BusinessError } 202 - Not system application to call the interface. 912 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 913 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 914 * @throws { BusinessError } 1600001 - Internal error. 915 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 916 * @throws { BusinessError } 1600003 - Failed to connect to the service. 917 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 918 * @syscap SystemCapability.Notification.Notification 919 * @systemapi 920 * @since 9 921 */ 922 function setNotificationEnable(bundle: BundleOption, enable: boolean): Promise<void>; 923 924 /** 925 * Checks whether this application allows to publish notifications. 926 * 927 * @permission ohos.permission.NOTIFICATION_CONTROLLER 928 * @param { BundleOption } bundle - The bundle option. 929 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 930 * @throws { BusinessError } 201 - Permission denied. 931 * @throws { BusinessError } 202 - Not system application to call the interface. 932 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 933 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 934 * @throws { BusinessError } 1600001 - Internal error. 935 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 936 * @throws { BusinessError } 1600003 - Failed to connect to the service. 937 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 938 * @syscap SystemCapability.Notification.Notification 939 * @systemapi 940 * @since 9 941 */ 942 function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 943 944 /** 945 * Checks whether this application allows to publish notifications. 946 * 947 * @permission ohos.permission.NOTIFICATION_CONTROLLER 948 * @param { BundleOption } bundle - The bundle option. 949 * @returns { Promise<boolean> } The promise returned by the function. 950 * @throws { BusinessError } 201 - Permission denied. 951 * @throws { BusinessError } 202 - Not system application to call the interface. 952 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 953 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 954 * @throws { BusinessError } 1600001 - Internal error. 955 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 956 * @throws { BusinessError } 1600003 - Failed to connect to the service. 957 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 958 * @syscap SystemCapability.Notification.Notification 959 * @systemapi 960 * @since 9 961 */ 962 function isNotificationEnabled(bundle: BundleOption): Promise<boolean>; 963 964 /** 965 * Checks whether this application allows to publish notifications. 966 * 967 * @permission ohos.permission.NOTIFICATION_CONTROLLER 968 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 969 * @throws { BusinessError } 201 - Permission denied. 970 * @throws { BusinessError } 202 - Not system application to call the interface. 971 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 972 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 973 * @throws { BusinessError } 1600001 - Internal error. 974 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 975 * @throws { BusinessError } 1600003 - Failed to connect to the service. 976 * @syscap SystemCapability.Notification.Notification 977 * @systemapi 978 * @since 9 979 */ 980 /** 981 * Checks whether this application allows to publish notifications. 982 * 983 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 984 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 985 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 986 * @throws { BusinessError } 1600001 - Internal error. 987 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 988 * @throws { BusinessError } 1600003 - Failed to connect to the service. 989 * @throws { BusinessError } 1600008 - The user does not exist. 990 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 991 * @syscap SystemCapability.Notification.Notification 992 * @since 11 993 */ 994 /** 995 * Checks whether this application allows to publish notifications. 996 * 997 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 998 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 999 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1000 * @throws { BusinessError } 1600001 - Internal error. 1001 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1002 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1003 * @throws { BusinessError } 1600008 - The user does not exist. 1004 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1005 * @syscap SystemCapability.Notification.Notification 1006 * @crossplatform 1007 * @since 12 1008 */ 1009 function isNotificationEnabled(callback: AsyncCallback<boolean>): void; 1010 1011 /** 1012 * Checks whether this application allows to publish notifications. 1013 * 1014 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1015 * @returns { Promise<boolean> } The promise returned by the function. 1016 * @throws { BusinessError } 201 - Permission denied. 1017 * @throws { BusinessError } 202 - Not system application to call the interface. 1018 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1019 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1020 * @throws { BusinessError } 1600001 - Internal error. 1021 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1022 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1023 * @syscap SystemCapability.Notification.Notification 1024 * @systemapi 1025 * @since 9 1026 */ 1027 /** 1028 * Checks whether this application allows to publish notifications. 1029 * 1030 * @returns { Promise<boolean> } The promise returned by the function. 1031 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1032 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1033 * @throws { BusinessError } 1600001 - Internal error. 1034 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1035 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1036 * @throws { BusinessError } 1600008 - The user does not exist. 1037 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1038 * @syscap SystemCapability.Notification.Notification 1039 * @since 11 1040 */ 1041 /** 1042 * Checks whether this application allows to publish notifications. 1043 * 1044 * @returns { Promise<boolean> } The promise returned by the function. 1045 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1046 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1047 * @throws { BusinessError } 1600001 - Internal error. 1048 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1049 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1050 * @throws { BusinessError } 1600008 - The user does not exist. 1051 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1052 * @syscap SystemCapability.Notification.Notification 1053 * @crossplatform 1054 * @since 12 1055 */ 1056 function isNotificationEnabled(): Promise<boolean>; 1057 1058 /** 1059 * Checks whether this application allows to publish notifications. 1060 * 1061 * @returns { boolean } Returned by the function. 1062 * @throws { BusinessError } 1600001 - Internal error. 1063 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1064 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1065 * @syscap SystemCapability.Notification.Notification 1066 * @since 12 1067 */ 1068 function isNotificationEnabledSync(): boolean; 1069 1070 /** 1071 * Checks whether this application allows to publish notifications under the user. 1072 * 1073 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1074 * @param { number } userId - The userid of the representative. 1075 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 1076 * @throws { BusinessError } 201 - Permission denied. 1077 * @throws { BusinessError } 202 - Not system application to call the interface. 1078 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1079 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 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 * @syscap SystemCapability.Notification.Notification 1085 * @systemapi 1086 * @since 9 1087 */ 1088 function isNotificationEnabled(userId: number, callback: AsyncCallback<boolean>): void; 1089 1090 /** 1091 * Checks whether this application allows to publish notifications under the user. 1092 * 1093 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1094 * @param { number } userId - The userid of the representative. 1095 * @returns { Promise<boolean> } The promise returned by the function. 1096 * @throws { BusinessError } 201 - Permission denied. 1097 * @throws { BusinessError } 202 - Not system application to call the interface. 1098 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1099 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1100 * @throws { BusinessError } 1600001 - Internal error. 1101 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1102 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1103 * @throws { BusinessError } 1600008 - The user does not exist. 1104 * @syscap SystemCapability.Notification.Notification 1105 * @systemapi 1106 * @since 9 1107 */ 1108 function isNotificationEnabled(userId: number): Promise<boolean>; 1109 1110 /** 1111 * Sets whether to allow the specified application to show badge. 1112 * 1113 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1114 * @param { BundleOption } bundle - The bundle option. 1115 * @param { boolean } enable - Set enable or not. 1116 * @param { AsyncCallback<void> } callback - The callback of displayBadge. 1117 * @throws { BusinessError } 201 - Permission denied. 1118 * @throws { BusinessError } 202 - Not system application to call the interface. 1119 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1120 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1121 * @throws { BusinessError } 1600001 - Internal error. 1122 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1123 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1124 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1125 * @syscap SystemCapability.Notification.Notification 1126 * @systemapi 1127 * @since 9 1128 */ 1129 function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 1130 1131 /** 1132 * Sets whether to allow the specified application to show badge. 1133 * 1134 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1135 * @param { BundleOption } bundle - The bundle option. 1136 * @param { boolean } enable - Set enable or not. 1137 * @returns { Promise<void> } The promise returned by the function. 1138 * @throws { BusinessError } 201 - Permission denied. 1139 * @throws { BusinessError } 202 - Not system application to call the interface. 1140 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1141 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1142 * @throws { BusinessError } 1600001 - Internal error. 1143 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1144 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1145 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1146 * @syscap SystemCapability.Notification.Notification 1147 * @systemapi 1148 * @since 9 1149 */ 1150 function displayBadge(bundle: BundleOption, enable: boolean): Promise<void>; 1151 1152 /** 1153 * Obtains the flag that whether to allow the application to show badge. 1154 * 1155 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1156 * @param { BundleOption } bundle - The bundle option. 1157 * @param { AsyncCallback<boolean> } callback - The callback of isBadgeDisplayed. 1158 * @throws { BusinessError } 201 - Permission denied. 1159 * @throws { BusinessError } 202 - Not system application to call the interface. 1160 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1161 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1162 * @throws { BusinessError } 1600001 - Internal error. 1163 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1164 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1165 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1166 * @syscap SystemCapability.Notification.Notification 1167 * @systemapi 1168 * @since 9 1169 */ 1170 function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 1171 1172 /** 1173 * Obtains the flag that whether to allow the application to show badge. 1174 * 1175 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1176 * @param { BundleOption } bundle - The bundle option. 1177 * @returns { Promise<boolean> } The promise returned by the function. 1178 * @throws { BusinessError } 201 - Permission denied. 1179 * @throws { BusinessError } 202 - Not system application to call the interface. 1180 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1181 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1182 * @throws { BusinessError } 1600001 - Internal error. 1183 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1184 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1185 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1186 * @syscap SystemCapability.Notification.Notification 1187 * @systemapi 1188 * @since 9 1189 */ 1190 function isBadgeDisplayed(bundle: BundleOption): Promise<boolean>; 1191 1192 /** 1193 * Update all notification slots for the specified bundle. 1194 * 1195 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1196 * @param { BundleOption } bundle - The bundle option. 1197 * @param { NotificationSlot } slot - Indicates the notification slot. 1198 * @param { AsyncCallback<void> } callback - The callback of setSlotByBundle. 1199 * @throws { BusinessError } 201 - Permission denied. 1200 * @throws { BusinessError } 202 - Not system application to call the interface. 1201 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1202 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1203 * @throws { BusinessError } 1600001 - Internal error. 1204 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1205 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1206 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1207 * @syscap SystemCapability.Notification.Notification 1208 * @systemapi 1209 * @since 9 1210 */ 1211 function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback<void>): void; 1212 1213 /** 1214 * Update all notification slots for the specified bundle. 1215 * 1216 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1217 * @param { BundleOption } bundle - The bundle option. 1218 * @param { NotificationSlot } slot - Indicates the notification slot. 1219 * @returns { Promise<void> } The promise returned by the function. 1220 * @throws { BusinessError } 201 - Permission denied. 1221 * @throws { BusinessError } 202 - Not system application to call the interface. 1222 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1223 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1224 * @throws { BusinessError } 1600001 - Internal error. 1225 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1226 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1227 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1228 * @syscap SystemCapability.Notification.Notification 1229 * @systemapi 1230 * @since 9 1231 */ 1232 function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise<void>; 1233 1234 /** 1235 * Obtains all notification slots belonging to the specified bundle. 1236 * 1237 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1238 * @param { BundleOption } bundle - The bundle option. 1239 * @param { AsyncCallback<Array<NotificationSlot>> } callback - The callback of getSlotsByBundle. 1240 * @throws { BusinessError } 201 - Permission denied. 1241 * @throws { BusinessError } 202 - Not system application to call the interface. 1242 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1243 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1244 * @throws { BusinessError } 1600001 - Internal error. 1245 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1246 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1247 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1248 * @syscap SystemCapability.Notification.Notification 1249 * @systemapi 1250 * @since 9 1251 */ 1252 function getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array<NotificationSlot>>): void; 1253 1254 /** 1255 * Get notification slot for the specified bundle. 1256 * 1257 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1258 * @param { BundleOption } bundle - The bundle option. 1259 * @param { SlotType } slotType - Indicates the notification slot. 1260 * @returns { Promise<NotificationSlot> } Returns the NotificationSlot. 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 } 1600001 - Internal error. 1266 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1267 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1268 * @throws { BusinessError } 1600012 - No memory space. 1269 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1270 * @syscap SystemCapability.Notification.Notification 1271 * @systemapi 1272 * @since 12 1273 */ 1274 function getSlotByBundle(bundle: BundleOption, slotType: SlotType): Promise<NotificationSlot>; 1275 1276 /** 1277 * Obtains all notification slots belonging to the specified bundle. 1278 * 1279 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1280 * @param { BundleOption } bundle - The bundle option. 1281 * @returns { Promise<Array<NotificationSlot>> } 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 function getSlotsByBundle(bundle: BundleOption): Promise<Array<NotificationSlot>>; 1295 1296 /** 1297 * Obtains number of slot. 1298 * 1299 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1300 * @param { BundleOption } bundle - The bundle option. 1301 * @param { AsyncCallback<number> } callback - The callback of getSlotNumByBundle. 1302 * @throws { BusinessError } 201 - Permission denied. 1303 * @throws { BusinessError } 202 - Not system application to call the interface. 1304 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1305 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1306 * @throws { BusinessError } 1600001 - Internal error. 1307 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1308 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1309 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1310 * @syscap SystemCapability.Notification.Notification 1311 * @systemapi 1312 * @since 9 1313 */ 1314 function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback<number>): void; 1315 1316 /** 1317 * Obtains number of slot. 1318 * 1319 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1320 * @param { BundleOption } bundle - The bundle option. 1321 * @returns { Promise<number> } The promise returned by the function. 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 function getSlotNumByBundle(bundle: BundleOption): Promise<number>; 1335 1336 /** 1337 * Obtains all active notifications in the current system. The caller must have system permissions to 1338 * call this method. 1339 * 1340 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1341 * @param { AsyncCallback<Array<NotificationRequest>> } callback - The callback of getAllActiveNotifications. 1342 * @throws { BusinessError } 201 - Permission denied. 1343 * @throws { BusinessError } 202 - Not system application to call the interface. 1344 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1345 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 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 * @syscap SystemCapability.Notification.Notification 1350 * @systemapi 1351 * @since 9 1352 */ 1353 function getAllActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 1354 1355 /** 1356 * Obtains all active notifications in the current system. The caller must have system permissions to 1357 * call this method. 1358 * 1359 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1360 * @returns { Promise<Array<NotificationRequest>> } The promise returned by the function. 1361 * @throws { BusinessError } 201 - Permission denied. 1362 * @throws { BusinessError } 202 - Not system application to call the interface. 1363 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1364 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1365 * @throws { BusinessError } 1600001 - Internal error. 1366 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1367 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1368 * @syscap SystemCapability.Notification.Notification 1369 * @systemapi 1370 * @since 9 1371 */ 1372 function getAllActiveNotifications(): Promise<Array<NotificationRequest>>; 1373 1374 /** 1375 * Obtains the number of all active notifications. 1376 * 1377 * @param { AsyncCallback<number> } callback - The callback of getActiveNotificationCount. 1378 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1379 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1380 * @throws { BusinessError } 1600001 - Internal error. 1381 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1382 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1383 * @syscap SystemCapability.Notification.Notification 1384 * @since 9 1385 */ 1386 function getActiveNotificationCount(callback: AsyncCallback<number>): void; 1387 1388 /** 1389 * Obtains the number of all active notifications. 1390 * 1391 * @returns { Promise<number> } The promise returned by the function. 1392 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1393 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1394 * @throws { BusinessError } 1600001 - Internal error. 1395 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1396 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1397 * @syscap SystemCapability.Notification.Notification 1398 * @since 9 1399 */ 1400 function getActiveNotificationCount(): Promise<number>; 1401 1402 /** 1403 * Obtains an array of active notifications. 1404 * 1405 * @param { AsyncCallback<Array<NotificationRequest>> } callback - The callback of getActiveNotifications. 1406 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1407 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1408 * @throws { BusinessError } 1600001 - Internal error. 1409 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1410 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1411 * @syscap SystemCapability.Notification.Notification 1412 * @since 9 1413 */ 1414 function getActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 1415 1416 /** 1417 * Obtains an array of active notifications. 1418 * 1419 * @returns { Promise<Array<NotificationRequest>> } The promise returned by the function. 1420 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1421 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1422 * @throws { BusinessError } 1600001 - Internal error. 1423 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1424 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1425 * @syscap SystemCapability.Notification.Notification 1426 * @since 9 1427 */ 1428 function getActiveNotifications(): Promise<Array<NotificationRequest>>; 1429 1430 /** 1431 * Get the live view notification by bundle option and notification key. If the extraInfoKeys is provided, 1432 * filter the additional information of the live view notification and return the filtered result. 1433 * 1434 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1435 * @param { NotificationFilter } filter - The bundle, notification key and additional information filter of the live view notification. 1436 * @param { AsyncCallback<NotificationRequest> } callback - The callback of getActiveNotificationByFilter. 1437 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1438 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1439 * @throws { BusinessError } 1600007 - The notification does not exist. 1440 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1441 * @syscap SystemCapability.Notification.Notification 1442 * @systemapi 1443 * @since 11 1444 */ 1445 function getActiveNotificationByFilter(filter: NotificationFilter, callback: AsyncCallback<NotificationRequest>): void; 1446 1447 /** 1448 * Get the live view notification by bundle option and notification key. If the extraInfoKeys is provided, 1449 * filter the additional information of the live view notification and return the filtered result. 1450 * 1451 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1452 * @param { NotificationFilter } filter - The bundle, notification key and additional information filter of the live view notification. 1453 * @returns { Promise<NotificationRequest> } The promise returned by the function. 1454 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1455 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1456 * @throws { BusinessError } 1600007 - The notification does not exist. 1457 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1458 * @syscap SystemCapability.Notification.Notification 1459 * @systemapi 1460 * @since 11 1461 */ 1462 function getActiveNotificationByFilter(filter: NotificationFilter): Promise<NotificationRequest>; 1463 1464 /** 1465 * Cancel the notification of a specified group for this application. 1466 * 1467 * @param { string } groupName - The name of the group. 1468 * @param { AsyncCallback<void> } callback - The callback of cancelGroup. 1469 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1470 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1471 * @throws { BusinessError } 1600001 - Internal error. 1472 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1473 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1474 * @syscap SystemCapability.Notification.Notification 1475 * @since 9 1476 */ 1477 function cancelGroup(groupName: string, callback: AsyncCallback<void>): void; 1478 1479 /** 1480 * Cancel the notification of a specified group for this application. 1481 * 1482 * @param { string } groupName - The name of the group. 1483 * @returns { Promise<void> } The promise returned by the function. 1484 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1485 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1486 * @throws { BusinessError } 1600001 - Internal error. 1487 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1488 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1489 * @syscap SystemCapability.Notification.Notification 1490 * @since 9 1491 */ 1492 function cancelGroup(groupName: string): Promise<void>; 1493 1494 /** 1495 * Delete the notification of a specified group for this application. 1496 * 1497 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1498 * @param { BundleOption } bundle - The bundle option. 1499 * @param { string } groupName - The name of the group. 1500 * @param { AsyncCallback<void> } callback - The callback of removeGroupByBundle. 1501 * @throws { BusinessError } 201 - Permission denied. 1502 * @throws { BusinessError } 202 - Not system application to call the interface. 1503 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1504 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1505 * @throws { BusinessError } 1600001 - Internal error. 1506 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1507 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1508 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1509 * @syscap SystemCapability.Notification.Notification 1510 * @systemapi 1511 * @since 9 1512 */ 1513 function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback<void>): void; 1514 1515 /** 1516 * Delete the notification of a specified group for this application. 1517 * 1518 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1519 * @param { BundleOption } bundle - The bundle option. 1520 * @param { string } groupName - The name of the group. 1521 * @returns { Promise<void> } The promise returned by the function. 1522 * @throws { BusinessError } 201 - Permission denied. 1523 * @throws { BusinessError } 202 - Not system application to call the interface. 1524 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1525 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1526 * @throws { BusinessError } 1600001 - Internal error. 1527 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1528 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1529 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1530 * @syscap SystemCapability.Notification.Notification 1531 * @systemapi 1532 * @since 9 1533 */ 1534 function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise<void>; 1535 1536 /** 1537 * Set the Do Not Disturb date. 1538 * 1539 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1540 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1541 * @param { AsyncCallback<void> } callback - The callback of setDoNotDisturbDate. 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 } 1600001 - Internal error. 1547 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1548 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1549 * @throws { BusinessError } 1600012 - No memory space. 1550 * @syscap SystemCapability.Notification.Notification 1551 * @systemapi 1552 * @since 9 1553 */ 1554 function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback<void>): void; 1555 1556 /** 1557 * Set the Do Not Disturb date. 1558 * 1559 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1560 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1561 * @returns { Promise<void> } The promise returned by the function. 1562 * @throws { BusinessError } 201 - Permission denied. 1563 * @throws { BusinessError } 202 - Not system application to call the interface. 1564 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1565 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1566 * @throws { BusinessError } 1600001 - Internal error. 1567 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1568 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1569 * @throws { BusinessError } 1600012 - No memory space. 1570 * @syscap SystemCapability.Notification.Notification 1571 * @systemapi 1572 * @since 9 1573 */ 1574 function setDoNotDisturbDate(date: DoNotDisturbDate): Promise<void>; 1575 1576 /** 1577 * Set the Do Not Disturb date under the specified user. 1578 * 1579 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1580 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1581 * @param { number } userId - The userId. 1582 * @param { AsyncCallback<void> } callback - The callback of setDoNotDisturbDate. 1583 * @throws { BusinessError } 201 - Permission denied. 1584 * @throws { BusinessError } 202 - Not system application to call the interface. 1585 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1586 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1587 * @throws { BusinessError } 1600001 - Internal error. 1588 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1589 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1590 * @throws { BusinessError } 1600008 - The user does not exist. 1591 * @throws { BusinessError } 1600012 - No memory space. 1592 * @syscap SystemCapability.Notification.Notification 1593 * @systemapi 1594 * @since 9 1595 */ 1596 function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallback<void>): void; 1597 1598 /** 1599 * Set the Do Not Disturb date under the specified user. 1600 * 1601 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1602 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1603 * @param { number } userId - The userId. 1604 * @returns { Promise<void> } The promise returned by the function. 1605 * @throws { BusinessError } 201 - Permission denied. 1606 * @throws { BusinessError } 202 - Not system application to call the interface. 1607 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1608 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1609 * @throws { BusinessError } 1600001 - Internal error. 1610 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1611 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1612 * @throws { BusinessError } 1600008 - The user does not exist. 1613 * @throws { BusinessError } 1600012 - No memory space. 1614 * @syscap SystemCapability.Notification.Notification 1615 * @systemapi 1616 * @since 9 1617 */ 1618 function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise<void>; 1619 1620 /** 1621 * Obtains the Do Not Disturb date. 1622 * 1623 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1624 * @param { AsyncCallback<DoNotDisturbDate> } callback - The callback is used to return the Do Not Disturb date. 1625 * @throws { BusinessError } 201 - Permission denied. 1626 * @throws { BusinessError } 202 - Not system application to call the interface. 1627 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1628 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1629 * @throws { BusinessError } 1600001 - Internal error. 1630 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1631 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1632 * @throws { BusinessError } 1600012 - No memory space. 1633 * @syscap SystemCapability.Notification.Notification 1634 * @systemapi 1635 * @since 9 1636 */ 1637 function getDoNotDisturbDate(callback: AsyncCallback<DoNotDisturbDate>): void; 1638 1639 /** 1640 * Obtains the Do Not Disturb date. 1641 * 1642 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1643 * @returns { Promise<DoNotDisturbDate> } Returns the Do Not Disturb date. 1644 * @throws { BusinessError } 201 - Permission denied. 1645 * @throws { BusinessError } 202 - Not system application to call the interface. 1646 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1647 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1648 * @throws { BusinessError } 1600001 - Internal error. 1649 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1650 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1651 * @throws { BusinessError } 1600012 - No memory space. 1652 * @syscap SystemCapability.Notification.Notification 1653 * @systemapi 1654 * @since 9 1655 */ 1656 function getDoNotDisturbDate(): Promise<DoNotDisturbDate>; 1657 1658 /** 1659 * Obtains the Do Not Disturb date. 1660 * 1661 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1662 * @param { number } userId - The userId. 1663 * @param { AsyncCallback<DoNotDisturbDate> } callback - The callback is used to return the Do Not Disturb date. 1664 * @throws { BusinessError } 201 - Permission denied. 1665 * @throws { BusinessError } 202 - Not system application to call the interface. 1666 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1667 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1668 * @throws { BusinessError } 1600001 - Internal error. 1669 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1670 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1671 * @throws { BusinessError } 1600008 - The user does not exist. 1672 * @throws { BusinessError } 1600012 - No memory space. 1673 * @syscap SystemCapability.Notification.Notification 1674 * @systemapi 1675 * @since 9 1676 */ 1677 function getDoNotDisturbDate(userId: number, callback: AsyncCallback<DoNotDisturbDate>): void; 1678 1679 /** 1680 * Obtains the Do Not Disturb date. 1681 * 1682 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1683 * @param { number } userId - The userId. 1684 * @returns { Promise<DoNotDisturbDate> } Returns the Do Not Disturb date. 1685 * @throws { BusinessError } 201 - Permission denied. 1686 * @throws { BusinessError } 202 - Not system application to call the interface. 1687 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1688 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1689 * @throws { BusinessError } 1600001 - Internal error. 1690 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1691 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1692 * @throws { BusinessError } 1600008 - The user does not exist. 1693 * @throws { BusinessError } 1600012 - No memory space. 1694 * @syscap SystemCapability.Notification.Notification 1695 * @systemapi 1696 * @since 9 1697 */ 1698 function getDoNotDisturbDate(userId: number): Promise<DoNotDisturbDate>; 1699 1700 /** 1701 * Obtains whether to support the Do Not Disturb mode. 1702 * 1703 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1704 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether Do Not Disturb 1705 * mode is supported. 1706 * @throws { BusinessError } 201 - Permission denied. 1707 * @throws { BusinessError } 202 - Not system application to call the interface. 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 } 1600001 - Internal error. 1711 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1712 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1713 * @syscap SystemCapability.Notification.Notification 1714 * @systemapi 1715 * @since 9 1716 */ 1717 function isSupportDoNotDisturbMode(callback: AsyncCallback<boolean>): void; 1718 1719 /** 1720 * Obtains whether to support the Do Not Disturb mode. 1721 * 1722 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1723 * @returns { Promise<boolean> } Returns whether Do Not Disturb mode is supported. 1724 * @throws { BusinessError } 201 - Permission denied. 1725 * @throws { BusinessError } 202 - Not system application to call the interface. 1726 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1727 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1728 * @throws { BusinessError } 1600001 - Internal error. 1729 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1730 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1731 * @syscap SystemCapability.Notification.Notification 1732 * @systemapi 1733 * @since 9 1734 */ 1735 function isSupportDoNotDisturbMode(): Promise<boolean>; 1736 1737 /** 1738 * Obtains whether the template is supported by the system. 1739 * 1740 * @param { string } templateName - Name of template to be Obtained. 1741 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the template is supported. 1742 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1743 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1744 * @throws { BusinessError } 1600001 - Internal error. 1745 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1746 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1747 * @syscap SystemCapability.Notification.Notification 1748 * @since 9 1749 */ 1750 function isSupportTemplate(templateName: string, callback: AsyncCallback<boolean>): void; 1751 1752 /** 1753 * Obtains whether the template is supported by the system. 1754 * 1755 * @param { string } templateName - Name of template to be Obtained. 1756 * @returns { Promise<boolean> } Returns whether the template is supported. 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 * @syscap SystemCapability.Notification.Notification 1763 * @since 9 1764 */ 1765 function isSupportTemplate(templateName: string): Promise<boolean>; 1766 1767 /** 1768 * Request permission to send notification. 1769 * 1770 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 1771 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1772 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1773 * @throws { BusinessError } 1600001 - Internal error. 1774 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1775 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1776 * @syscap SystemCapability.Notification.Notification 1777 * @since 9 1778 */ 1779 /** 1780 * Request permission to send notification. 1781 * 1782 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 1783 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1784 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1785 * @throws { BusinessError } 1600001 - Internal error. 1786 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1787 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1788 * @throws { BusinessError } 1600004 - Notification disabled. 1789 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 1790 * @syscap SystemCapability.Notification.Notification 1791 * @since 11 1792 */ 1793 /** 1794 * Request permission to send notification. 1795 * 1796 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 1797 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1798 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1799 * @throws { BusinessError } 1600001 - Internal error. 1800 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1801 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1802 * @throws { BusinessError } 1600004 - Notification disabled. 1803 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 1804 * @syscap SystemCapability.Notification.Notification 1805 * @crossplatform 1806 * @since 12 1807 * @deprecated since 12 1808 * @useinstead requestEnableNotification 1809 */ 1810 function requestEnableNotification(callback: AsyncCallback<void>): void; 1811 1812 /** 1813 * Request permission to send notification. 1814 * 1815 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 1816 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 1817 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1818 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 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 * @syscap SystemCapability.Notification.Notification 1823 * @StageModelOnly 1824 * @since 10 1825 */ 1826 /** 1827 * Request permission to send notification. 1828 * 1829 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 1830 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 1831 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1832 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1833 * @throws { BusinessError } 1600001 - Internal error. 1834 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1835 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1836 * @throws { BusinessError } 1600004 - Notification disabled. 1837 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 1838 * @syscap SystemCapability.Notification.Notification 1839 * @StageModelOnly 1840 * @since 11 1841 */ 1842 /** 1843 * Request permission to send notification. 1844 * 1845 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 1846 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 1847 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1848 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1849 * @throws { BusinessError } 1600001 - Internal error. 1850 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1851 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1852 * @throws { BusinessError } 1600004 - Notification disabled. 1853 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 1854 * @syscap SystemCapability.Notification.Notification 1855 * @StageModelOnly 1856 * @crossplatform 1857 * @since 12 1858 */ 1859 function requestEnableNotification(context: UIAbilityContext, callback: AsyncCallback<void>): void; 1860 1861 /** 1862 * Request permission to send notification. 1863 * 1864 * @returns { Promise<void> } The promise returned by the function. 1865 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1866 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1867 * @throws { BusinessError } 1600001 - Internal error. 1868 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1869 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1870 * @syscap SystemCapability.Notification.Notification 1871 * @since 9 1872 */ 1873 /** 1874 * Request permission to send notification. 1875 * 1876 * @returns { Promise<void> } The promise returned by the function. 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 } 1600004 - Notification disabled. 1883 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 1884 * @syscap SystemCapability.Notification.Notification 1885 * @since 11 1886 */ 1887 /** 1888 * Request permission to send notification. 1889 * 1890 * @returns { Promise<void> } The promise returned by the function. 1891 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1892 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1893 * @throws { BusinessError } 1600001 - Internal error. 1894 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1895 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1896 * @throws { BusinessError } 1600004 - Notification disabled. 1897 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 1898 * @syscap SystemCapability.Notification.Notification 1899 * @crossplatform 1900 * @since 12 1901 * @deprecated since 12 1902 * @useinstead requestEnableNotification 1903 */ 1904 function requestEnableNotification(): Promise<void>; 1905 1906 /** 1907 * Request permission to send notification. 1908 * 1909 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 1910 * @returns { Promise<void> } The promise returned by the function. 1911 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1912 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1913 * @throws { BusinessError } 1600001 - Internal error. 1914 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1915 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1916 * @syscap SystemCapability.Notification.Notification 1917 * @StageModelOnly 1918 * @since 10 1919 */ 1920 /** 1921 * Request permission to send notification. 1922 * 1923 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 1924 * @returns { Promise<void> } The promise returned by the function. 1925 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1926 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1927 * @throws { BusinessError } 1600001 - Internal error. 1928 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1929 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1930 * @throws { BusinessError } 1600004 - Notification disabled. 1931 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 1932 * @syscap SystemCapability.Notification.Notification 1933 * @StageModelOnly 1934 * @since 11 1935 */ 1936 /** 1937 * Request permission to send notification. 1938 * 1939 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 1940 * @returns { Promise<void> } The promise returned by the function. 1941 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1942 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 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 } 1600004 - Notification disabled. 1947 * @throws { BusinessError } 1600013 - A notification dialog box is already displayed. 1948 * @syscap SystemCapability.Notification.Notification 1949 * @StageModelOnly 1950 * @crossplatform 1951 * @since 12 1952 */ 1953 function requestEnableNotification(context: UIAbilityContext): Promise<void>; 1954 1955 /** 1956 * Sets whether the device supports distributed notification. 1957 * 1958 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1959 * @param { boolean } enable - Set enable or not. 1960 * @param { AsyncCallback<void> } callback - The callback of setDistributedEnable. 1961 * @throws { BusinessError } 201 - Permission denied. 1962 * @throws { BusinessError } 202 - Not system application to call the interface. 1963 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1964 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1965 * @throws { BusinessError } 1600001 - Internal error. 1966 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1967 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1968 * @throws { BusinessError } 1600010 - Distributed operation failed. 1969 * @syscap SystemCapability.Notification.Notification 1970 * @systemapi 1971 * @since 9 1972 */ 1973 function setDistributedEnable(enable: boolean, callback: AsyncCallback<void>): void; 1974 1975 /** 1976 * Sets whether the device supports distributed notification. 1977 * 1978 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1979 * @param { boolean } enable - Set enable or not. 1980 * @returns { Promise<void> } The promise returned by the function. 1981 * @throws { BusinessError } 201 - Permission denied. 1982 * @throws { BusinessError } 202 - Not system application to call the interface. 1983 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 1984 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 1985 * @throws { BusinessError } 1600001 - Internal error. 1986 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1987 * @throws { BusinessError } 1600003 - Failed to connect to the service. 1988 * @throws { BusinessError } 1600010 - Distributed operation failed. 1989 * @syscap SystemCapability.Notification.Notification 1990 * @systemapi 1991 * @since 9 1992 */ 1993 function setDistributedEnable(enable: boolean): Promise<void>; 1994 1995 /** 1996 * Obtains whether the device supports distributed notification. 1997 * 1998 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the distributed 1999 * notification is supported. 2000 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2001 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2002 * @throws { BusinessError } 1600001 - Internal error. 2003 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2004 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2005 * @throws { BusinessError } 1600010 - Distributed operation failed. 2006 * @syscap SystemCapability.Notification.Notification 2007 * @since 9 2008 */ 2009 function isDistributedEnabled(callback: AsyncCallback<boolean>): void; 2010 2011 /** 2012 * Obtains whether the device supports distributed notification. 2013 * 2014 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 2015 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2016 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2017 * @throws { BusinessError } 1600001 - Internal error. 2018 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2019 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2020 * @throws { BusinessError } 1600010 - Distributed operation failed. 2021 * @syscap SystemCapability.Notification.Notification 2022 * @since 9 2023 */ 2024 function isDistributedEnabled(): Promise<boolean>; 2025 2026 /** 2027 * Sets whether an application supports distributed notification. 2028 * 2029 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2030 * @param { BundleOption } bundle - The bundle option. 2031 * @param { boolean } enable - Set enable or not. 2032 * @param { AsyncCallback<void> } callback - The callback of setDistributedEnableByBundle. 2033 * @throws { BusinessError } 201 - Permission denied. 2034 * @throws { BusinessError } 202 - Not system application to call the interface. 2035 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2036 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2037 * @throws { BusinessError } 1600001 - Internal error. 2038 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2039 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2040 * @throws { BusinessError } 1600010 - Distributed operation failed. 2041 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2042 * @syscap SystemCapability.Notification.Notification 2043 * @systemapi 2044 * @since 9 2045 */ 2046 function setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 2047 2048 /** 2049 * Sets whether an application supports distributed notification. 2050 * 2051 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2052 * @param { BundleOption } bundle - The bundle option. 2053 * @param { boolean } enable - Set enable or not. 2054 * @returns { Promise<void> } The promise returned by the function. 2055 * @throws { BusinessError } 201 - Permission denied. 2056 * @throws { BusinessError } 202 - Not system application to call the interface. 2057 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2058 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2059 * @throws { BusinessError } 1600001 - Internal error. 2060 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2061 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2062 * @throws { BusinessError } 1600010 - Distributed operation failed. 2063 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2064 * @syscap SystemCapability.Notification.Notification 2065 * @systemapi 2066 * @since 9 2067 */ 2068 function setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise<void>; 2069 2070 /** 2071 * Sets whether an application supports distributed notification. 2072 * 2073 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2074 * @param { BundleOption } bundle - The bundle option. 2075 * @param { string } deviceType - The device type. 2076 * @param { boolean } enable - Set enable or not. 2077 * @returns { Promise<void> } The promise returned by the function. 2078 * @throws { BusinessError } 201 - Permission denied. 2079 * @throws { BusinessError } 202 - Not system application to call the interface. 2080 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2081 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2082 * @throws { BusinessError } 1600001 - Internal error. 2083 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2084 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2085 * @throws { BusinessError } 1600010 - Distributed operation failed. 2086 * @throws { BusinessError } 1600012 - No memory space. 2087 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2088 * @syscap SystemCapability.Notification.Notification 2089 * @systemapi 2090 * @since 12 2091 */ 2092 function setDistributedEnabledByBundle(bundle: BundleOption, deviceType: string, enable: boolean): Promise<void>; 2093 2094 /** 2095 * Obtains whether an application supports distributed notification. 2096 * 2097 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2098 * @param { BundleOption } bundle - The bundle option. 2099 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the distributed 2100 * notification is supported. 2101 * @throws { BusinessError } 201 - Permission denied. 2102 * @throws { BusinessError } 202 - Not system application to call the interface. 2103 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2104 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2105 * @throws { BusinessError } 1600001 - Internal error. 2106 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2107 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2108 * @throws { BusinessError } 1600010 - Distributed operation failed. 2109 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2110 * @syscap SystemCapability.Notification.Notification 2111 * @systemapi 2112 * @since 9 2113 */ 2114 function isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 2115 2116 /** 2117 * Obtains whether an application supports distributed notification. 2118 * 2119 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2120 * @param { BundleOption } bundle - The bundle option. 2121 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 2122 * @throws { BusinessError } 201 - Permission denied. 2123 * @throws { BusinessError } 202 - Not system application to call the interface. 2124 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2125 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2126 * @throws { BusinessError } 1600001 - Internal error. 2127 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2128 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2129 * @throws { BusinessError } 1600010 - Distributed operation failed. 2130 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2131 * @syscap SystemCapability.Notification.Notification 2132 * @systemapi 2133 * @since 9 2134 */ 2135 function isDistributedEnabledByBundle(bundle: BundleOption): Promise<boolean>; 2136 2137 /** 2138 * Obtains whether an application supports distributed notification. 2139 * 2140 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2141 * @param { BundleOption } bundle - The bundle option. 2142 * @param { string } deviceType - The device type. 2143 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 2144 * @throws { BusinessError } 201 - Permission denied. 2145 * @throws { BusinessError } 202 - Not system application to call the interface. 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 * @throws { BusinessError } 1600010 - Distributed operation failed. 2152 * @throws { BusinessError } 1600012 - No memory space. 2153 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2154 * @syscap SystemCapability.Notification.Notification 2155 * @systemapi 2156 * @since 12 2157 */ 2158 function isDistributedEnabledByBundle(bundle: BundleOption, deviceType: string): Promise<boolean>; 2159 2160 /** 2161 * Sets whether an application supports smart reminders across devices. 2162 * 2163 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2164 * @param { string } deviceType - The device type. 2165 * @param { boolean } enable - Set enable or not. 2166 * @returns { Promise<void> } The promise returned by the function. 2167 * @throws { BusinessError } 201 - Permission denied. 2168 * @throws { BusinessError } 202 - Not system application to call the interface. 2169 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2170 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2171 * @throws { BusinessError } 1600001 - Internal error. 2172 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2173 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2174 * @throws { BusinessError } 1600010 - Distributed operation failed. 2175 * @throws { BusinessError } 1600012 - No memory space. 2176 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2177 * @syscap SystemCapability.Notification.Notification 2178 * @systemapi 2179 * @since 12 2180 */ 2181 function setSmartReminderEnabled(deviceType: string, enable: boolean): Promise<void>; 2182 2183 /** 2184 * Obtains whether an application supports smart reminders across devices. 2185 * 2186 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2187 * @param { string } deviceType - The device type. 2188 * @returns { Promise<boolean> } Returns whether the smart reminders across devices notification is supported. 2189 * @throws { BusinessError } 201 - Permission denied. 2190 * @throws { BusinessError } 202 - Not system application to call the interface. 2191 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2192 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2193 * @throws { BusinessError } 1600001 - Internal error. 2194 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2195 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2196 * @throws { BusinessError } 1600010 - Distributed operation failed. 2197 * @throws { BusinessError } 1600012 - No memory space. 2198 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2199 * @syscap SystemCapability.Notification.Notification 2200 * @systemapi 2201 * @since 12 2202 */ 2203 function isSmartReminderEnabled(deviceType: string): Promise<boolean>; 2204 2205 /** 2206 * Obtains the remind modes of the notification. 2207 * 2208 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2209 * @param { AsyncCallback<DeviceRemindType> } callback - The callback is used to return the RemindType. 2210 * @throws { BusinessError } 201 - Permission denied. 2211 * @throws { BusinessError } 202 - Not system application to call the interface. 2212 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2213 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2214 * @throws { BusinessError } 1600001 - Internal error. 2215 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2216 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2217 * @syscap SystemCapability.Notification.Notification 2218 * @systemapi 2219 * @since 9 2220 */ 2221 function getDeviceRemindType(callback: AsyncCallback<DeviceRemindType>): void; 2222 2223 /** 2224 * Obtains the remind modes of the notification. 2225 * 2226 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2227 * @returns { Promise<DeviceRemindType> } Returns the RemindType. 2228 * @throws { BusinessError } 201 - Permission denied. 2229 * @throws { BusinessError } 202 - Not system application to call the interface. 2230 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2231 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2232 * @throws { BusinessError } 1600001 - Internal error. 2233 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2234 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2235 * @syscap SystemCapability.Notification.Notification 2236 * @systemapi 2237 * @since 9 2238 */ 2239 function getDeviceRemindType(): Promise<DeviceRemindType>; 2240 2241 /** 2242 * Set whether the application slot is enabled. 2243 * 2244 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2245 * @param { BundleOption } bundle - The bundle option. 2246 * @param { SlotType } type - Type of the notification slot. 2247 * @param { boolean } enable - Set enable or not. 2248 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 2249 * @throws { BusinessError } 201 - Permission denied. 2250 * @throws { BusinessError } 202 - Not system application to call the interface. 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 } 17700001 - The specified bundle name was not found. 2257 * @syscap SystemCapability.Notification.Notification 2258 * @systemapi 2259 * @since 9 2260 */ 2261 /** 2262 * Set whether the application slot is enabled. 2263 * 2264 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2265 * @param { BundleOption } bundle - The bundle option. 2266 * @param { SlotType } type - Type of the notification slot. 2267 * @param { boolean } enable - Set enable or not. 2268 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 2269 * @throws { BusinessError } 201 - Permission denied. 2270 * @throws { BusinessError } 202 - Not system application to call the interface. 2271 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2272 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2273 * @throws { BusinessError } 1600001 - Internal error. 2274 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2275 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2276 * @throws { BusinessError } 1600012 - No memory space. 2277 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2278 * @syscap SystemCapability.Notification.Notification 2279 * @systemapi 2280 * @since 11 2281 */ 2282 function setNotificationEnableSlot( 2283 bundle: BundleOption, 2284 type: SlotType, 2285 enable: boolean, 2286 callback: AsyncCallback<void> 2287 ): void; 2288 2289 /** 2290 * Set whether the application slot is enabled. 2291 * 2292 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2293 * @param { BundleOption } bundle - The bundle option. 2294 * @param { SlotType } type - Type of the notification slot. 2295 * @param { boolean } enable - Set enable or not. 2296 * @param { boolean } isForceControl - Is the notification slot enable affected by the application 2297 * notification enable, false means affected. 2298 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 2299 * @throws { BusinessError } 201 - Permission denied. 2300 * @throws { BusinessError } 202 - Not system application to call the interface. 2301 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2302 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2303 * @throws { BusinessError } 1600001 - Internal error. 2304 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2305 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2306 * @throws { BusinessError } 1600012 - No memory space. 2307 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2308 * @syscap SystemCapability.Notification.Notification 2309 * @systemapi 2310 * @since 11 2311 */ 2312 function setNotificationEnableSlot( 2313 bundle: BundleOption, 2314 type: SlotType, 2315 enable: boolean, 2316 isForceControl: boolean, 2317 callback: AsyncCallback<void>, 2318 ): void; 2319 2320 /** 2321 * Set whether the application slot is enabled. 2322 * 2323 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2324 * @param { BundleOption } bundle - The bundle option. 2325 * @param { SlotType } type - Type of the notification slot. 2326 * @param { boolean } enable - Set enable or not. 2327 * @returns { Promise<void> } The promise returned by the function. 2328 * @throws { BusinessError } 201 - Permission denied. 2329 * @throws { BusinessError } 202 - Not system application to call the interface. 2330 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2331 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2332 * @throws { BusinessError } 1600001 - Internal error. 2333 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2334 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2335 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2336 * @syscap SystemCapability.Notification.Notification 2337 * @systemapi 2338 * @since 9 2339 */ 2340 /** 2341 * Set whether the application slot is enabled. 2342 * 2343 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2344 * @param { BundleOption } bundle - The bundle option. 2345 * @param { SlotType } type - Type of the notification slot. 2346 * @param { boolean } enable - Set enable or not. 2347 * @param { boolean } isForceControl - Is the notification slot enable affected by the application 2348 * notification enable, false means affected. 2349 * @returns { Promise<void> } The promise returned by the function. 2350 * @throws { BusinessError } 201 - Permission denied. 2351 * @throws { BusinessError } 202 - Not system application to call the interface. 2352 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2353 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2354 * @throws { BusinessError } 1600001 - Internal error. 2355 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2356 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2357 * @throws { BusinessError } 1600012 - No memory space. 2358 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2359 * @syscap SystemCapability.Notification.Notification 2360 * @systemapi 2361 * @since 11 2362 */ 2363 function setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean, isForceControl?: boolean): Promise<void>; 2364 2365 /** 2366 * Obtains whether the application slot is enabled. 2367 * 2368 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2369 * @param { BundleOption } bundle - The bundle option. 2370 * @param { SlotType } type - Type of the notification slot. 2371 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the application slot is enabled. 2372 * @throws { BusinessError } 201 - Permission denied. 2373 * @throws { BusinessError } 202 - Not system application to call the interface. 2374 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2375 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2376 * @throws { BusinessError } 1600001 - Internal error. 2377 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2378 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2379 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2380 * @syscap SystemCapability.Notification.Notification 2381 * @systemapi 2382 * @since 9 2383 */ 2384 function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback<boolean>): void; 2385 2386 /** 2387 * Obtains whether the application slot is enabled. 2388 * 2389 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2390 * @param { BundleOption } bundle - The bundle option. 2391 * @param { SlotType } type - Type of the notification slot. 2392 * @returns { Promise<boolean> } Returns whether the application slot is enabled. 2393 * @throws { BusinessError } 201 - Permission denied. 2394 * @throws { BusinessError } 202 - Not system application to call the interface. 2395 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2396 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2397 * @throws { BusinessError } 1600001 - Internal error. 2398 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2399 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2400 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2401 * @syscap SystemCapability.Notification.Notification 2402 * @systemapi 2403 * @since 9 2404 */ 2405 function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise<boolean>; 2406 2407 /** 2408 * Set whether to sync notifications to devices that do not have the app installed. 2409 * 2410 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2411 * @param { number } userId - The userId. 2412 * @param { boolean } enable - Set enable or not. 2413 * @param { AsyncCallback<void> } callback - The callback of setSyncNotificationEnabledWithoutApp. 2414 * @throws { BusinessError } 201 - Permission denied. 2415 * @throws { BusinessError } 202 - Not system application to call the interface. 2416 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2417 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2418 * @throws { BusinessError } 1600001 - Internal error. 2419 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2420 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2421 * @throws { BusinessError } 1600008 - The user does not exist. 2422 * @syscap SystemCapability.Notification.Notification 2423 * @systemapi 2424 * @since 9 2425 */ 2426 function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean, callback: AsyncCallback<void>): void; 2427 2428 /** 2429 * Set whether to sync notifications to devices that do not have the app installed. 2430 * 2431 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2432 * @param { number } userId - The userId. 2433 * @param { boolean } enable - Set enable or not. 2434 * @returns { Promise<void> } The promise returned by the function. 2435 * @throws { BusinessError } 201 - Permission denied. 2436 * @throws { BusinessError } 202 - Not system application to call the interface. 2437 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2438 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2439 * @throws { BusinessError } 1600001 - Internal error. 2440 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2441 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2442 * @throws { BusinessError } 1600008 - The user does not exist. 2443 * @syscap SystemCapability.Notification.Notification 2444 * @systemapi 2445 * @since 9 2446 */ 2447 function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean): Promise<void>; 2448 2449 /** 2450 * Obtains whether to sync notifications to devices that do not have the app installed. 2451 * 2452 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2453 * @param { number } userId - The userId. 2454 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether to sync notifications to devices. 2455 * @throws { BusinessError } 201 - Permission denied. 2456 * @throws { BusinessError } 202 - Not system application to call the interface. 2457 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2458 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2459 * @throws { BusinessError } 1600001 - Internal error. 2460 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2461 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2462 * @throws { BusinessError } 1600008 - The user does not exist. 2463 * @syscap SystemCapability.Notification.Notification 2464 * @systemapi 2465 * @since 9 2466 */ 2467 function getSyncNotificationEnabledWithoutApp(userId: number, callback: AsyncCallback<boolean>): void; 2468 2469 /** 2470 * Obtains whether to sync notifications to devices that do not have the app installed. 2471 * 2472 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2473 * @param { number } userId - The userId. 2474 * @returns { Promise<boolean> } Returns whether to sync notifications to devices. 2475 * @throws { BusinessError } 201 - Permission denied. 2476 * @throws { BusinessError } 202 - Not system application to call the interface. 2477 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2478 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2479 * @throws { BusinessError } 1600001 - Internal error. 2480 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2481 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2482 * @throws { BusinessError } 1600008 - The user does not exist. 2483 * @syscap SystemCapability.Notification.Notification 2484 * @systemapi 2485 * @since 9 2486 */ 2487 function getSyncNotificationEnabledWithoutApp(userId: number): Promise<boolean>; 2488 2489 /** 2490 * Set badge number. 2491 * 2492 * @param { number } badgeNumber - Badge number. 2493 * @param { AsyncCallback<void> } callback - callback - The callback of setBadgeNumber.. 2494 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2495 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2496 * @throws { BusinessError } 1600001 - Internal error. 2497 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2498 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2499 * @throws { BusinessError } 1600012 - No memory space. 2500 * @syscap SystemCapability.Notification.Notification 2501 * @since 10 2502 */ 2503 /** 2504 * Set badge number. 2505 * 2506 * @param { number } badgeNumber - Badge number. 2507 * @param { AsyncCallback<void> } callback - callback - The callback of setBadgeNumber.. 2508 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2509 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2510 * @throws { BusinessError } 1600001 - Internal error. 2511 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2512 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2513 * @throws { BusinessError } 1600012 - No memory space. 2514 * @syscap SystemCapability.Notification.Notification 2515 * @crossplatform 2516 * @since 12 2517 */ 2518 function setBadgeNumber(badgeNumber: number, callback: AsyncCallback<void>): void; 2519 2520 /** 2521 * Set badge number. 2522 * 2523 * @param { number } badgeNumber - Badge number. 2524 * @returns { Promise<void> } The promise returned by the function. 2525 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2526 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2527 * @throws { BusinessError } 1600001 - Internal error. 2528 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2529 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2530 * @throws { BusinessError } 1600012 - No memory space. 2531 * @syscap SystemCapability.Notification.Notification 2532 * @since 10 2533 */ 2534 /** 2535 * Set badge number. 2536 * 2537 * @param { number } badgeNumber - Badge number. 2538 * @returns { Promise<void> } The promise returned by the function. 2539 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2540 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2541 * @throws { BusinessError } 1600001 - Internal error. 2542 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2543 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2544 * @throws { BusinessError } 1600012 - No memory space. 2545 * @syscap SystemCapability.Notification.Notification 2546 * @crossplatform 2547 * @since 12 2548 */ 2549 function setBadgeNumber(badgeNumber: number): Promise<void>; 2550 2551 /** 2552 * Set badge number by bundle. 2553 * 2554 * @param { BundleOption } bundle - Use the bundleOption to carry bundleName and uid of the application. 2555 * @param { number } badgeNumber - Badge number. 2556 * @returns { Promise<void> } The promise returned by the function. 2557 * @throws { BusinessError } 202 - Not system application to call the interface. 2558 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2559 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2560 * @throws { BusinessError } 1600001 - Internal error. 2561 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2562 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2563 * @throws { BusinessError } 1600012 - No memory space. 2564 * @throws { BusinessError } 1600017 - There is no corresponding agent relationship configuration. 2565 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2566 * @syscap SystemCapability.Notification.Notification 2567 * @systemapi 2568 * @since 12 2569 */ 2570 function setBadgeNumberByBundle(bundle: BundleOption, badgeNumber: number): Promise<void>; 2571 2572 /** 2573 * Subscribe the callback for check notifications. 2574 * 2575 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2576 * @param { 'checkNotification' } type - Type of the callback to listen for. 2577 * @param { function } callback - callback - The callback of check notifications. 2578 * @throws { BusinessError } 202 - Not system application. 2579 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2580 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2581 * @throws { BusinessError } 1600001 - Internal error. 2582 * @syscap SystemCapability.Notification.Notification 2583 * @systemapi 2584 * @since 10 2585 */ 2586 function on(type: 'checkNotification', callback: (checkInfo: NotificationCheckInfo) => NotificationCheckResult): void; 2587 2588 /** 2589 * Subscribe the callback for check notifications. 2590 * 2591 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2592 * @param { 'checkNotification' } type - Type of the callback to listen for. 2593 * @param { NotificationCheckRequest } checkRequest - Check Request for filter notification request. 2594 * @param { function } callback - callback - The callback of check notifications. 2595 * @throws { BusinessError } 201 - Permission denied. 2596 * @throws { BusinessError } 202 - Not system application. 2597 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2598 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2599 * @throws { BusinessError } 1600001 - Internal error. 2600 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2601 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2602 * @syscap SystemCapability.Notification.Notification 2603 * @systemapi 2604 * @since 11 2605 */ 2606 function on(type: 'checkNotification', checkRequest: NotificationCheckRequest, 2607 callback: (checkInfo: NotificationCheckInfo) => Promise<NotificationCheckResult>): void; 2608 2609 /** 2610 * Unsubscribe the callback for check notifications. 2611 * 2612 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2613 * @param { 'checkNotification' } type - Type of the callback to listen for. 2614 * @param { function } [callback] - callback - The callback 2615 * of check notifications. 2616 * @throws { BusinessError } 202 - Not system application. 2617 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2618 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2619 * @throws { BusinessError } 1600001 - Internal error. 2620 * @syscap SystemCapability.Notification.Notification 2621 * @systemapi 2622 * @since 10 2623 */ 2624 function off( 2625 type: 'checkNotification', 2626 callback?: (checkInfo: NotificationCheckInfo) => NotificationCheckResult 2627 ): void; 2628 2629 /** 2630 * Trigger system live view notification. 2631 * 2632 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2633 * @param { BundleOption } bundle - The bundle option. 2634 * @param { number } notificationId - The notification id. 2635 * @param { ButtonOptions } buttonOptions - The button option. 2636 * @returns { Promise<void> } The promise returned by the function. 2637 * @throws { BusinessError } 201 - Permission denied. 2638 * @throws { BusinessError } 202 - Not system application to call the interface. 2639 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2640 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2641 * @throws { BusinessError } 1600001 - Internal error. 2642 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2643 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2644 * @throws { BusinessError } 1600007 - The notification does not exist. 2645 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2646 * @syscap SystemCapability.Notification.Notification 2647 * @systemapi 2648 * @since 11 2649 */ 2650 function triggerSystemLiveView(bundle: BundleOption, notificationId: number, buttonOptions: ButtonOptions): Promise<void>; 2651 2652 /** 2653 * Subscribe to system live view notifications 2654 * 2655 * @param { SystemLiveViewSubscriber } subscriber - The system live vie notification subscriber. 2656 * @returns { Promise<void> } The promise returned by the function. 2657 * @throws { BusinessError } 202 - Not system application to call the interface. 2658 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2659 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2660 * @throws { BusinessError } 1600001 - Internal error. 2661 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2662 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2663 * @throws { BusinessError } 1600012 - No memory space. 2664 * @syscap SystemCapability.Notification.Notification 2665 * @systemapi 2666 * @since 11 2667 */ 2668 function subscribeSystemLiveView(subscriber: SystemLiveViewSubscriber): Promise<void>; 2669 2670 /** 2671 * Set basic configurations of application-level notification channels. 2672 * 2673 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2674 * @param { BundleOption } bundle - The bundle option. 2675 * @param { number } slotFlags - Indicates the slotFlags. 2676 * @returns { Promise<void> } The promise returned by the function. 2677 * @throws { BusinessError } 201 - Permission denied. 2678 * @throws { BusinessError } 202 - Not system application to call the interface. 2679 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2680 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2681 * @throws { BusinessError } 1600001 - Internal error. 2682 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2683 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2684 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2685 * @syscap SystemCapability.Notification.Notification 2686 * @systemapi 2687 * @since 11 2688 */ 2689 function setSlotFlagsByBundle(bundle: BundleOption, slotFlags: number): Promise<void>; 2690 2691 /** 2692 * Obtains basic configurations of application-level notification channels. 2693 * 2694 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2695 * @param { BundleOption } bundle - The bundle option. 2696 * @returns { Promise<number> } The promise returned by the function. 2697 * @throws { BusinessError } 201 - Permission denied. 2698 * @throws { BusinessError } 202 - Not system application to call the interface. 2699 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2700 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2701 * @throws { BusinessError } 1600001 - Internal error. 2702 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2703 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2704 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 2705 * @syscap SystemCapability.Notification.Notification 2706 * @systemapi 2707 * @since 11 2708 */ 2709 function getSlotFlagsByBundle(bundle: BundleOption): Promise<number>; 2710 2711 /** 2712 * Add do not disturb notification templates. 2713 * 2714 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2715 * @param { Array<DoNotDisturbProfile> } templates - The array of Notification templates. 2716 * @returns { Promise<void> } The promise returned by the function. 2717 * @throws { BusinessError } 201 - Permission denied. 2718 * @throws { BusinessError } 202 - Not system application to call the interface. 2719 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2720 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2721 * @throws { BusinessError } 1600001 - Internal error. 2722 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2723 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2724 * @throws { BusinessError } 1600012 - No memory space. 2725 * @syscap SystemCapability.Notification.Notification 2726 * @systemapi 2727 * @since 12 2728 */ 2729 function addDoNotDisturbProfile(templates: Array<DoNotDisturbProfile>): Promise<void>; 2730 2731 /** 2732 * Remove do not disturb notification templates. 2733 * 2734 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2735 * @param { Array<DoNotDisturbProfile> } templates - The array of Notification templates. 2736 * @returns { Promise<void> } The promise returned by the function. 2737 * @throws { BusinessError } 201 - Permission denied. 2738 * @throws { BusinessError } 202 - Not system application to call the interface. 2739 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2740 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2741 * @throws { BusinessError } 1600001 - Internal error. 2742 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2743 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2744 * @throws { BusinessError } 1600012 - No memory space. 2745 * @syscap SystemCapability.Notification.Notification 2746 * @systemapi 2747 * @since 12 2748 */ 2749 function removeDoNotDisturbProfile(templates: Array<DoNotDisturbProfile>): Promise<void>; 2750 2751 /** 2752 * Set system additional config information of notification 2753 * 2754 * @permission ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2755 * @param { string } key - addition config key. 2756 * @param { string } value - addition config value. 2757 * @returns { Promise<number> } The promise returned by the function. 2758 * @throws { BusinessError } 201 - Permission denied. 2759 * @throws { BusinessError } 202 - Not system application to call the interface. 2760 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2761 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2762 * @throws { BusinessError } 1600001 - Internal error. 2763 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2764 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2765 * @syscap SystemCapability.Notification.Notification 2766 * @systemapi 2767 * @since 12 2768 */ 2769 function setAdditionalConfig(key: string, value: string): Promise<number>; 2770 2771 /** 2772 * Request open the notification settings pop-up window. 2773 * 2774 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 2775 * @returns { Promise<void> } The promise returned by the function. 2776 * @throws { BusinessError } 1600001 - Internal error. 2777 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2778 * @throws { BusinessError } 1600018 - the notification settings window is already displayed. 2779 * @syscap SystemCapability.Notification.NotificationSettings 2780 * @stagemodelonly 2781 * @since 13 2782 */ 2783 function openNotificationSettings(context: UIAbilityContext): Promise<void>; 2784 2785 /** 2786 * Get do not disturb profile by id. 2787 * 2788 * @permission ohos.permission.NOTIFICATION_CONTROLLER 2789 * @param { number } id - The id of profile. 2790 * @returns { Promise<DoNotDisturbProfile> } The promise returned by the function. 2791 * @throws { BusinessError } 201 - Permission denied. 2792 * @throws { BusinessError } 202 - Not system application to call the interface. 2793 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2794 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 2795 * @throws { BusinessError } 1600001 - Internal error. 2796 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 2797 * @throws { BusinessError } 1600003 - Failed to connect to the service. 2798 * @throws { BusinessError } 1600019 - The do-not-disturb profile does not exist. 2799 * @syscap SystemCapability.Notification.Notification 2800 * @systemapi 2801 * @since 13 2802 */ 2803 function getDoNotDisturbProfile(id: number): Promise<DoNotDisturbProfile>; 2804 2805 /** 2806 * Describes a button option for a triggering. 2807 * 2808 * @typedef ButtonOptions 2809 * @syscap SystemCapability.Notification.Notification 2810 * @systemapi 2811 * @since 11 2812 */ 2813 export interface ButtonOptions { 2814 /** 2815 * The button name for a triggering. 2816 * 2817 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2818 * @type { string } 2819 * @syscap SystemCapability.Notification.Notification 2820 * @systemapi 2821 * @since 11 2822 */ 2823 buttonName: string; 2824 } 2825 2826 /** 2827 * Describes a subscriber for system live view. 2828 * 2829 * @typedef SystemLiveViewSubscriber 2830 * @syscap SystemCapability.Notification.Notification 2831 * @systemapi 2832 * @since 11 2833 */ 2834 export interface SystemLiveViewSubscriber { 2835 /** 2836 * The callback function that receives a new button option of a notification. 2837 * 2838 * @type { ?function } 2839 * @syscap SystemCapability.Notification.Notification 2840 * @systemapi 2841 * @since 11 2842 */ 2843 onResponse?: (notificationId: number, buttonOptions: ButtonOptions) => void; 2844 } 2845 2846 /** 2847 * Describes the parameters of check notifications. 2848 * 2849 * @typedef NotificationCheckInfo 2850 * @syscap SystemCapability.Notification.Notification 2851 * @systemapi 2852 * @since 10 2853 */ 2854 export interface NotificationCheckInfo { 2855 /** 2856 * The application bundle name for publishing notification. 2857 * 2858 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2859 * @type { string } 2860 * @syscap SystemCapability.Notification.Notification 2861 * @systemapi 2862 * @since 10 2863 */ 2864 bundleName: string; 2865 2866 /** 2867 * The notification id. 2868 * 2869 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2870 * @type { number } 2871 * @syscap SystemCapability.Notification.Notification 2872 * @systemapi 2873 * @since 10 2874 */ 2875 notificationId: number; 2876 2877 /** 2878 * Label of the notification. 2879 * 2880 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2881 * @type { ?string } 2882 * @syscap SystemCapability.Notification.Notification 2883 * @systemapi 2884 * @since 11 2885 */ 2886 label?: string; 2887 2888 /** 2889 * The notification content type. 2890 * 2891 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2892 * @type { ContentType } 2893 * @syscap SystemCapability.Notification.Notification 2894 * @systemapi 2895 * @since 10 2896 */ 2897 contentType: ContentType; 2898 2899 /** 2900 * UserId of the notification creator. 2901 * 2902 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2903 * @type { number } 2904 * @syscap SystemCapability.Notification.Notification 2905 * @systemapi 2906 * @since 11 2907 */ 2908 creatorUserId: number; 2909 2910 /** 2911 * Type of the notification slot. 2912 * 2913 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2914 * @type { SlotType } 2915 * @syscap SystemCapability.Notification.Notification 2916 * @systemapi 2917 * @since 11 2918 */ 2919 slotType: SlotType; 2920 2921 /** 2922 * Additional information of the live view notification. 2923 * 2924 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2925 * @type { ?Record<string, Object> } 2926 * @syscap SystemCapability.Notification.Notification 2927 * @systemapi 2928 * @since 11 2929 */ 2930 extraInfos?: Record<string, Object>; 2931 } 2932 2933 /** 2934 * Describes the result of check notifications. 2935 * 2936 * @typedef NotificationCheckResult 2937 * @syscap SystemCapability.Notification.Notification 2938 * @systemapi 2939 * @since 10 2940 */ 2941 export interface NotificationCheckResult { 2942 /** 2943 * The result code. 0-display, 1-no display 2944 * 2945 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2946 * @type { number } 2947 * @syscap SystemCapability.Notification.Notification 2948 * @systemapi 2949 * @since 10 2950 */ 2951 code: number; 2952 2953 /** 2954 * The result message. 2955 * 2956 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 2957 * @type { string } 2958 * @syscap SystemCapability.Notification.Notification 2959 * @systemapi 2960 * @since 10 2961 */ 2962 message: string; 2963 } 2964 2965 /** 2966 * Describes NotificationSlot types. 2967 * 2968 * @enum { number } 2969 * @syscap SystemCapability.Notification.Notification 2970 * @since 9 2971 */ 2972 /** 2973 * Describes NotificationSlot types. 2974 * 2975 * @enum { number } 2976 * @syscap SystemCapability.Notification.Notification 2977 * @atomicservice 2978 * @since 12 2979 */ 2980 export enum SlotType { 2981 /** 2982 * NotificationSlot of an unknown type. 2983 * 2984 * @syscap SystemCapability.Notification.Notification 2985 * @since 9 2986 */ 2987 /** 2988 * NotificationSlot of an unknown type. 2989 * 2990 * @syscap SystemCapability.Notification.Notification 2991 * @atomicservice 2992 * @since 12 2993 */ 2994 UNKNOWN_TYPE = 0, 2995 2996 /** 2997 * NotificationSlot for social communication. 2998 * 2999 * @syscap SystemCapability.Notification.Notification 3000 * @since 9 3001 */ 3002 /** 3003 * NotificationSlot for social communication. 3004 * 3005 * @syscap SystemCapability.Notification.Notification 3006 * @atomicservice 3007 * @since 12 3008 */ 3009 SOCIAL_COMMUNICATION = 1, 3010 3011 /** 3012 * NotificationSlot for service information. 3013 * 3014 * @syscap SystemCapability.Notification.Notification 3015 * @since 9 3016 */ 3017 /** 3018 * NotificationSlot for service information. 3019 * 3020 * @syscap SystemCapability.Notification.Notification 3021 * @atomicservice 3022 * @since 12 3023 */ 3024 SERVICE_INFORMATION = 2, 3025 3026 /** 3027 * NotificationSlot for content information. 3028 * 3029 * @syscap SystemCapability.Notification.Notification 3030 * @since 9 3031 */ 3032 /** 3033 * NotificationSlot for content information. 3034 * 3035 * @syscap SystemCapability.Notification.Notification 3036 * @atomicservice 3037 * @since 12 3038 */ 3039 CONTENT_INFORMATION = 3, 3040 3041 /** 3042 * NotificationSlot for live view. 3043 * 3044 * @syscap SystemCapability.Notification.Notification 3045 * @since 11 3046 */ 3047 /** 3048 * NotificationSlot for live view. 3049 * 3050 * @syscap SystemCapability.Notification.Notification 3051 * @atomicservice 3052 * @since 12 3053 */ 3054 LIVE_VIEW = 4, 3055 3056 /** 3057 * NotificationSlot for customer service. 3058 * 3059 * @syscap SystemCapability.Notification.Notification 3060 * @since 11 3061 */ 3062 /** 3063 * NotificationSlot for customer service. 3064 * 3065 * @syscap SystemCapability.Notification.Notification 3066 * @atomicservice 3067 * @since 12 3068 */ 3069 CUSTOMER_SERVICE = 5, 3070 3071 /** 3072 * NotificationSlot for emergency information. 3073 * 3074 * @syscap SystemCapability.Notification.Notification 3075 * @systemapi 3076 * @since 12 3077 */ 3078 EMERGENCY_INFORMATION = 10, 3079 3080 /** 3081 * NotificationSlot for other purposes. 3082 * 3083 * @syscap SystemCapability.Notification.Notification 3084 * @since 9 3085 */ 3086 /** 3087 * NotificationSlot for other purposes. 3088 * 3089 * @syscap SystemCapability.Notification.Notification 3090 * @atomicservice 3091 * @since 12 3092 */ 3093 OTHER_TYPES = 0xFFFF 3094 } 3095 3096 /** 3097 * Describes notification content types. 3098 * 3099 * @enum { number } 3100 * @syscap SystemCapability.Notification.Notification 3101 * @since 9 3102 */ 3103 /** 3104 * Describes notification content types. 3105 * 3106 * @enum { number } 3107 * @syscap SystemCapability.Notification.Notification 3108 * @crossplatform 3109 * @atomicservice 3110 * @since 12 3111 */ 3112 export enum ContentType { 3113 /** 3114 * Normal text notification. 3115 * 3116 * @syscap SystemCapability.Notification.Notification 3117 * @since 9 3118 */ 3119 /** 3120 * Normal text notification. 3121 * 3122 * @syscap SystemCapability.Notification.Notification 3123 * @crossplatform 3124 * @atomicservice 3125 * @since 12 3126 */ 3127 NOTIFICATION_CONTENT_BASIC_TEXT, 3128 3129 /** 3130 * Long text notification. 3131 * 3132 * @syscap SystemCapability.Notification.Notification 3133 * @since 9 3134 */ 3135 /** 3136 * Long text notification. 3137 * 3138 * @syscap SystemCapability.Notification.Notification 3139 * @crossplatform 3140 * @atomicservice 3141 * @since 12 3142 */ 3143 NOTIFICATION_CONTENT_LONG_TEXT, 3144 3145 /** 3146 * Picture-attached notification. 3147 * 3148 * @syscap SystemCapability.Notification.Notification 3149 * @since 9 3150 */ 3151 /** 3152 * Picture-attached notification. 3153 * 3154 * @syscap SystemCapability.Notification.Notification 3155 * @atomicservice 3156 * @since 12 3157 */ 3158 NOTIFICATION_CONTENT_PICTURE, 3159 3160 /** 3161 * Conversation notification. 3162 * 3163 * @syscap SystemCapability.Notification.Notification 3164 * @since 9 3165 */ 3166 /** 3167 * Conversation notification. 3168 * 3169 * @syscap SystemCapability.Notification.Notification 3170 * @atomicservice 3171 * @since 12 3172 */ 3173 NOTIFICATION_CONTENT_CONVERSATION, 3174 3175 /** 3176 * Multi-line text notification. 3177 * 3178 * @syscap SystemCapability.Notification.Notification 3179 * @since 9 3180 */ 3181 /** 3182 * Multi-line text notification. 3183 * 3184 * @syscap SystemCapability.Notification.Notification 3185 * @crossplatform 3186 * @atomicservice 3187 * @since 12 3188 */ 3189 NOTIFICATION_CONTENT_MULTILINE, 3190 3191 /** 3192 * System local live view notification. 3193 * 3194 * @syscap SystemCapability.Notification.Notification 3195 * @since 11 3196 */ 3197 /** 3198 * System local live view notification. 3199 * 3200 * @syscap SystemCapability.Notification.Notification 3201 * @atomicservice 3202 * @since 12 3203 */ 3204 NOTIFICATION_CONTENT_SYSTEM_LIVE_VIEW, 3205 3206 /** 3207 * Common live view notification. 3208 * 3209 * @syscap SystemCapability.Notification.Notification 3210 * @since 11 3211 */ 3212 /** 3213 * Common live view notification. 3214 * 3215 * @syscap SystemCapability.Notification.Notification 3216 * @atomicservice 3217 * @since 12 3218 */ 3219 NOTIFICATION_CONTENT_LIVE_VIEW, 3220 } 3221 3222 /** 3223 * Indicates the level of the slot 3224 * 3225 * @enum { number } 3226 * @syscap SystemCapability.Notification.Notification 3227 * @since 9 3228 */ 3229 export enum SlotLevel { 3230 /** 3231 * Indicates that the notification function is disabled. 3232 * 3233 * @syscap SystemCapability.Notification.Notification 3234 * @since 9 3235 */ 3236 LEVEL_NONE = 0, 3237 3238 /** 3239 * Indicates that the notification function is enabled but notification 3240 * icons are not displayed in the status bar, with no banner or prompt tone. 3241 * 3242 * @syscap SystemCapability.Notification.Notification 3243 * @since 9 3244 */ 3245 LEVEL_MIN = 1, 3246 3247 /** 3248 * Indicates that the notification function is enabled and notification 3249 * icons are displayed in the status bar, with no banner or prompt tone. 3250 * 3251 * @syscap SystemCapability.Notification.Notification 3252 * @since 9 3253 */ 3254 LEVEL_LOW = 2, 3255 3256 /** 3257 * Indicates that the notification function is enabled and notification 3258 * icons are displayed in the status bar, with no banner but with a prompt tone. 3259 * 3260 * @syscap SystemCapability.Notification.Notification 3261 * @since 9 3262 */ 3263 LEVEL_DEFAULT = 3, 3264 3265 /** 3266 * Indicates that the notification function is enabled and notification 3267 * icons are displayed in the status bar, with a banner and a prompt tone. 3268 * 3269 * @syscap SystemCapability.Notification.Notification 3270 * @since 9 3271 */ 3272 LEVEL_HIGH = 4 3273 } 3274 3275 /** 3276 * The type of the Do Not Disturb. 3277 * 3278 * @enum { number } 3279 * @syscap SystemCapability.Notification.Notification 3280 * @systemapi 3281 * @since 9 3282 */ 3283 export enum DoNotDisturbType { 3284 /** 3285 * Non do not disturb type notification 3286 * 3287 * @syscap SystemCapability.Notification.Notification 3288 * @systemapi 3289 * @since 9 3290 */ 3291 TYPE_NONE = 0, 3292 3293 /** 3294 * Execute do not disturb once in the set time period (only watch hours and minutes) 3295 * 3296 * @syscap SystemCapability.Notification.Notification 3297 * @systemapi 3298 * @since 9 3299 */ 3300 TYPE_ONCE = 1, 3301 3302 /** 3303 * Execute do not disturb every day with a set time period (only watch hours and minutes) 3304 * 3305 * @syscap SystemCapability.Notification.Notification 3306 * @systemapi 3307 * @since 9 3308 */ 3309 TYPE_DAILY = 2, 3310 3311 /** 3312 * Execute in the set time period (specify the time, month, day and hour) 3313 * 3314 * @syscap SystemCapability.Notification.Notification 3315 * @systemapi 3316 * @since 9 3317 */ 3318 TYPE_CLEARLY = 3 3319 } 3320 3321 /** 3322 * Describes a DoNotDisturbDate instance. 3323 * 3324 * @typedef DoNotDisturbDate 3325 * @syscap SystemCapability.Notification.Notification 3326 * @systemapi 3327 * @since 9 3328 */ 3329 export interface DoNotDisturbDate { 3330 /** 3331 * the type of the Do Not Disturb. 3332 * 3333 * @type { DoNotDisturbType } 3334 * @syscap SystemCapability.Notification.Notification 3335 * @systemapi 3336 * @since 9 3337 */ 3338 type: DoNotDisturbType; 3339 3340 /** 3341 * The start time of the Do Not Disturb. 3342 * 3343 * @type { Date } 3344 * @syscap SystemCapability.Notification.Notification 3345 * @systemapi 3346 * @since 9 3347 */ 3348 begin: Date; 3349 3350 /** 3351 * The end time of the Do Not Disturb. 3352 * 3353 * @type { Date } 3354 * @syscap SystemCapability.Notification.Notification 3355 * @systemapi 3356 * @since 9 3357 */ 3358 end: Date; 3359 } 3360 3361 /** 3362 * Describes a DoNotDisturbProfile instance. 3363 * 3364 * @typedef DoNotDisturbProfile 3365 * @syscap SystemCapability.Notification.Notification 3366 * @systemapi 3367 * @since 12 3368 */ 3369 export interface DoNotDisturbProfile { 3370 /** 3371 * The profile id of the Do Not disturb. 3372 * 3373 * @type { number } 3374 * @syscap SystemCapability.Notification.Notification 3375 * @systemapi 3376 * @since 12 3377 */ 3378 id: number; 3379 3380 /** 3381 * The profile name of the Do Not disturb. 3382 * 3383 * @type { string } 3384 * @syscap SystemCapability.Notification.Notification 3385 * @systemapi 3386 * @since 12 3387 */ 3388 name: string; 3389 3390 /** 3391 * The trustlist of application. 3392 * 3393 * @type { ?Array<BundleOption> } 3394 * @syscap SystemCapability.Notification.Notification 3395 * @systemapi 3396 * @since 12 3397 */ 3398 trustlist?: Array<BundleOption>; 3399 } 3400 3401 /** 3402 * The remind type of the notification. 3403 * 3404 * @enum { number } 3405 * @syscap SystemCapability.Notification.Notification 3406 * @systemapi 3407 * @since 9 3408 */ 3409 export enum DeviceRemindType { 3410 /** 3411 * The device is not in use, no reminder 3412 * 3413 * @syscap SystemCapability.Notification.Notification 3414 * @systemapi 3415 * @since 9 3416 */ 3417 IDLE_DONOT_REMIND = 0, 3418 3419 /** 3420 * The device is not in use, remind 3421 * 3422 * @syscap SystemCapability.Notification.Notification 3423 * @systemapi 3424 * @since 9 3425 */ 3426 IDLE_REMIND = 1, 3427 3428 /** 3429 * The device is in use, no reminder 3430 * 3431 * @syscap SystemCapability.Notification.Notification 3432 * @systemapi 3433 * @since 9 3434 */ 3435 ACTIVE_DONOT_REMIND = 2, 3436 3437 /** 3438 * The device is in use, reminder 3439 * 3440 * @syscap SystemCapability.Notification.Notification 3441 * @systemapi 3442 * @since 9 3443 */ 3444 ACTIVE_REMIND = 3 3445 } 3446 3447 /** 3448 * Notification source type 3449 * 3450 * @enum { number } 3451 * @syscap SystemCapability.Notification.Notification 3452 * @systemapi 3453 * @since 9 3454 */ 3455 export enum SourceType { 3456 /** 3457 * General notification 3458 * 3459 * @syscap SystemCapability.Notification.Notification 3460 * @systemapi 3461 * @since 9 3462 */ 3463 TYPE_NORMAL = 0, 3464 3465 /** 3466 * Continuous notification 3467 * 3468 * @syscap SystemCapability.Notification.Notification 3469 * @systemapi 3470 * @since 9 3471 */ 3472 TYPE_CONTINUOUS = 1, 3473 3474 /** 3475 * Scheduled notification 3476 * 3477 * @syscap SystemCapability.Notification.Notification 3478 * @systemapi 3479 * @since 9 3480 */ 3481 TYPE_TIMER = 2 3482 } 3483 3484 /** 3485 * Enum for notification control flag status. 3486 * 3487 * @enum { number } 3488 * @syscap SystemCapability.Notification.Notification 3489 * @systemapi 3490 * @since 12 3491 */ 3492 export enum NotificationControlFlagStatus { 3493 /** 3494 * Manipulating of the enumeration by bitwise-or operation represents the closing of ringtone. 3495 * @syscap SystemCapability.Notification.Notification 3496 * @systemapi 3497 * @since 12 3498 */ 3499 NOTIFICATION_STATUS_CLOSE_SOUND = 1 << 0, 3500 3501 /** 3502 * Manipulating of the enumeration by bitwise-or operation represents the closing of lock screen. 3503 * @syscap SystemCapability.Notification.Notification 3504 * @systemapi 3505 * @since 12 3506 */ 3507 NOTIFICATION_STATUS_CLOSE_LOCKSCREEN = 1 << 1, 3508 3509 /** 3510 * Manipulating of the enumeration by bitwise-or operation represents the closing of banner. 3511 * @syscap SystemCapability.Notification.Notification 3512 * @systemapi 3513 * @since 12 3514 */ 3515 NOTIFICATION_STATUS_CLOSE_BANNER = 1 << 2, 3516 3517 /** 3518 * Manipulating of the enumeration by bitwise-or operation represents the closing of light screen. 3519 * @syscap SystemCapability.Notification.Notification 3520 * @systemapi 3521 * @since 12 3522 */ 3523 NOTIFICATION_STATUS_CLOSE_LIGHT_SCREEN = 1 << 3, 3524 3525 /** 3526 * Manipulating of the enumeration by bitwise-or operation represents the closing of vibration. 3527 * @syscap SystemCapability.Notification.Notification 3528 * @systemapi 3529 * @since 12 3530 */ 3531 NOTIFICATION_STATUS_CLOSE_VIBRATION = 1 << 4, 3532 3533 /** 3534 * Manipulating of the enumeration by bitwise-or operation represents the closing of status bar icon. 3535 * @syscap SystemCapability.Notification.Notification 3536 * @systemapi 3537 * @since 12 3538 */ 3539 NOTIFICATION_STATUS_CLOSE_STATUSBAR_ICON = 1 << 5 3540 } 3541 3542 /** 3543 * Describes a bundleOption in a notification. 3544 * 3545 * @typedef { _BundleOption } BundleOption 3546 * @syscap SystemCapability.Notification.Notification 3547 * @since 9 3548 */ 3549 export type BundleOption = _BundleOption; 3550 3551 /** 3552 * Describes an action button displayed in a notification. 3553 * 3554 * @typedef { _NotificationActionButton } NotificationActionButton 3555 * @syscap SystemCapability.Notification.Notification 3556 * @since 9 3557 */ 3558 export type NotificationActionButton = _NotificationActionButton; 3559 3560 /** 3561 * Describes a normal text notification. 3562 * 3563 * @syscap SystemCapability.Notification.Notification 3564 * @since 9 3565 */ 3566 /** 3567 * Describes a normal text notification. 3568 * 3569 * @typedef { _NotificationBasicContent } NotificationBasicContent 3570 * @syscap SystemCapability.Notification.Notification 3571 * @crossplatform 3572 * @since 12 3573 */ 3574 export type NotificationBasicContent = _NotificationBasicContent; 3575 3576 /** 3577 * Describes notification types. 3578 * 3579 * @syscap SystemCapability.Notification.Notification 3580 * @since 9 3581 */ 3582 /** 3583 * Describes notification types. 3584 * 3585 * @typedef { _NotificationContent } NotificationContent 3586 * @syscap SystemCapability.Notification.Notification 3587 * @crossplatform 3588 * @since 12 3589 */ 3590 export type NotificationContent = _NotificationContent; 3591 3592 /** 3593 * Describes a long text notification. 3594 * 3595 * @syscap SystemCapability.Notification.Notification 3596 * @since 9 3597 */ 3598 /** 3599 * Describes a long text notification. 3600 * 3601 * @typedef { _NotificationLongTextContent } NotificationLongTextContent 3602 * @syscap SystemCapability.Notification.Notification 3603 * @crossplatform 3604 * @since 12 3605 */ 3606 export type NotificationLongTextContent = _NotificationLongTextContent; 3607 3608 /** 3609 * Describes a live view notification. 3610 * 3611 * @typedef { _NotificationLiveViewContent } NotificationLiveViewContent 3612 * @syscap SystemCapability.Notification.Notification 3613 * @systemapi 3614 * @since 11 3615 */ 3616 export type NotificationLiveViewContent = _NotificationLiveViewContent; 3617 3618 /** 3619 * Describes a multi-line text notification. 3620 * 3621 * @syscap SystemCapability.Notification.Notification 3622 * @since 9 3623 */ 3624 /** 3625 * Describes a multi-line text notification. 3626 * 3627 * @typedef { _NotificationMultiLineContent } NotificationMultiLineContent 3628 * @syscap SystemCapability.Notification.Notification 3629 * @crossplatform 3630 * @since 12 3631 */ 3632 export type NotificationMultiLineContent = _NotificationMultiLineContent; 3633 3634 /** 3635 * Describes a picture-attached notification. 3636 * 3637 * @typedef { _NotificationPictureContent } NotificationPictureContent 3638 * @syscap SystemCapability.Notification.Notification 3639 * @since 9 3640 */ 3641 export type NotificationPictureContent = _NotificationPictureContent; 3642 3643 /** 3644 * Describes a system live view notification. 3645 * 3646 * @typedef { _NotificationSystemLiveViewContent } NotificationSystemLiveViewContent 3647 * @syscap SystemCapability.Notification.Notification 3648 * @since 11 3649 */ 3650 export type NotificationSystemLiveViewContent = _NotificationSystemLiveViewContent; 3651 3652 /** 3653 * Describes a NotificationFlags instance. 3654 * 3655 * @typedef { _NotificationFlags } NotificationFlags 3656 * @syscap SystemCapability.Notification.Notification 3657 * @systemapi 3658 * @since 9 3659 */ 3660 export type NotificationFlags = _NotificationFlags; 3661 3662 /** 3663 * The status of the notification flag. 3664 * 3665 * @typedef { _NotificationFlagStatus } NotificationFlagStatus 3666 * @syscap SystemCapability.Notification.Notification 3667 * @systemapi 3668 * @since 9 3669 */ 3670 export type NotificationFlagStatus = _NotificationFlagStatus; 3671 3672 /** 3673 * Defines a NotificationRequest instance. 3674 * 3675 * @syscap SystemCapability.Notification.Notification 3676 * @since 9 3677 */ 3678 /** 3679 * Defines a NotificationRequest instance. 3680 * 3681 * @typedef { _NotificationRequest } NotificationRequest 3682 * @syscap SystemCapability.Notification.Notification 3683 * @crossplatform 3684 * @since 12 3685 */ 3686 export type NotificationRequest = _NotificationRequest; 3687 3688 /** 3689 * Defines a UnifiedGroupInfo instance. 3690 * 3691 * @typedef { _UnifiedGroupInfo } UnifiedGroupInfo 3692 * @syscap SystemCapability.Notification.Notification 3693 * @systemapi 3694 * @since 12 3695 */ 3696 export type UnifiedGroupInfo = _UnifiedGroupInfo; 3697 3698 /** 3699 * Defines a NotificationFilter instance. 3700 * 3701 * @typedef { _NotificationFilter } NotificationFilter 3702 * @syscap SystemCapability.Notification.Notification 3703 * @systemapi 3704 * @since 11 3705 */ 3706 export type NotificationFilter = _NotificationFilter; 3707 3708 /** 3709 * Defines a NotificationCheckRequest instance. 3710 * 3711 * @typedef { _NotificationCheckRequest } NotificationCheckRequest 3712 * @syscap SystemCapability.Notification.Notification 3713 * @systemapi 3714 * @since 11 3715 */ 3716 export type NotificationCheckRequest = _NotificationCheckRequest; 3717 3718 /** 3719 * Describes distributed options. 3720 * 3721 * @typedef { _DistributedOptions } DistributedOptions 3722 * @syscap SystemCapability.Notification.Notification 3723 * @since 9 3724 */ 3725 export type DistributedOptions = _DistributedOptions; 3726 3727 /** 3728 * Describes a NotificationSlot instance. 3729 * 3730 * @typedef { _NotificationSlot } NotificationSlot 3731 * @syscap SystemCapability.Notification.Notification 3732 * @since 9 3733 */ 3734 export type NotificationSlot = _NotificationSlot; 3735 3736 /** 3737 * Describes live view notification option type. 3738 * 3739 * @typedef { _LiveViewStatus } LiveViewStatus 3740 * @syscap SystemCapability.Notification.Notification 3741 * @systemapi 3742 * @since 11 3743 */ 3744 export type LiveViewStatus = _LiveViewStatus; 3745 3746 /** 3747 * Provides sorting information about an active notification. 3748 * 3749 * @typedef { _NotificationSorting } NotificationSorting 3750 * @syscap SystemCapability.Notification.Notification 3751 * @systemapi 3752 * @since 9 3753 */ 3754 export type NotificationSorting = _NotificationSorting; 3755 3756 /** 3757 * Describes a NotificationTemplate instance. 3758 * 3759 * @typedef { _NotificationTemplate } NotificationTemplate 3760 * @syscap SystemCapability.Notification.Notification 3761 * @since 9 3762 */ 3763 export type NotificationTemplate = _NotificationTemplate; 3764 3765 /** 3766 * Describes a NotificationUserInput instance. 3767 * 3768 * @typedef { _NotificationUserInput } NotificationUserInput 3769 * @syscap SystemCapability.Notification.Notification 3770 * @since 9 3771 */ 3772 export type NotificationUserInput = _NotificationUserInput; 3773 3774 /** 3775 * Describes a system live view capsule type. 3776 * 3777 * @typedef { _NotificationCapsule } NotificationCapsule 3778 * @syscap SystemCapability.Notification.Notification 3779 * @since 11 3780 */ 3781 export type NotificationCapsule = _NotificationCapsule; 3782 3783 /** 3784 * Describes a system live view button type. 3785 * 3786 * @typedef { _NotificationButton } NotificationButton 3787 * @syscap SystemCapability.Notification.Notification 3788 * @since 11 3789 */ 3790 export type NotificationButton = _NotificationButton; 3791 3792 /** 3793 * Describes a system live view time type. 3794 * 3795 * @typedef { _NotificationTime } NotificationTime 3796 * @syscap SystemCapability.Notification.Notification 3797 * @since 11 3798 */ 3799 export type NotificationTime = _NotificationTime; 3800 3801 /** 3802 * Describes a system live view progress type. 3803 * 3804 * @typedef { _NotificationProgress } NotificationProgress 3805 * @syscap SystemCapability.Notification.Notification 3806 * @since 11 3807 */ 3808 export type NotificationProgress = _NotificationProgress; 3809} 3810 3811export default notificationManager; 3812