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