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