1/* 2 * Copyright (c) 2022-2023 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 16import { AsyncCallback } from './@ohos.base'; 17import { BundleOption as _BundleOption } from './notification/NotificationCommonDef'; 18import { NotificationActionButton as _NotificationActionButton } from './notification/notificationActionButton'; 19import { NotificationBasicContent as _NotificationBasicContent } from './notification/notificationContent'; 20import { NotificationContent as _NotificationContent } from './notification/notificationContent'; 21import { NotificationLongTextContent as _NotificationLongTextContent } from './notification/notificationContent'; 22import { NotificationMultiLineContent as _NotificationMultiLineContent } from './notification/notificationContent'; 23import { NotificationPictureContent as _NotificationPictureContent } from './notification/notificationContent'; 24import { NotificationFlags as _NotificationFlags } from './notification/notificationFlags'; 25import { NotificationFlagStatus as _NotificationFlagStatus } from './notification/notificationFlags'; 26import { NotificationRequest as _NotificationRequest } from './notification/notificationRequest'; 27import { DistributedOptions as _DistributedOptions } from './notification/notificationRequest'; 28import { NotificationSlot as _NotificationSlot } from './notification/notificationSlot'; 29import { NotificationSorting as _NotificationSorting } from './notification/notificationSorting'; 30import { NotificationTemplate as _NotificationTemplate } from './notification/notificationTemplate'; 31import { NotificationUserInput as _NotificationUserInput } from './notification/notificationUserInput'; 32import type UIAbilityContext from './application/UIAbilityContext'; 33 34/** 35 * Manages notifications. 36 * <p>Generally, only system applications have permissions on notification subscription and unsubscribe. 37 * You can specify the content of a notification to be published and the content is carried by 38 * {@link NotificationRequest}. A notification ID is unique in an application and must be specified 39 * when using {@link NotificationRequest} to carry the notification content. If a notification 40 * with this ID has been published and you need to use this ID to publish another notification, 41 * the original notification will be updated. In addition, the notification ID can be used to cancel 42 * a notification by calling the {@link #cancel(int)} method. 43 * 44 * @namespace notificationManager 45 * @syscap SystemCapability.Notification.Notification 46 * @since 9 47 */ 48declare namespace notificationManager { 49 /** 50 * Publishes a notification. 51 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 52 * this method will update the notification. 53 * 54 * @param { NotificationRequest } request - notification request 55 * @param { AsyncCallback<void> } callback - The callback of publish. 56 * @throws { BusinessError } 401 - The parameter check failed. 57 * @throws { BusinessError } 1600001 - Internal error. 58 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 59 * @throws { BusinessError } 1600003 - Failed to connect service. 60 * @throws { BusinessError } 1600004 - Notification is not enabled. 61 * @throws { BusinessError } 1600005 - Notification slot is not enabled. 62 * @throws { BusinessError } 1600009 - Over max number notifications per second. 63 * @throws { BusinessError } 1600012 - No memory space. 64 * @syscap SystemCapability.Notification.Notification 65 * @since 9 66 */ 67 function publish(request: NotificationRequest, callback: AsyncCallback<void>): void; 68 69 /** 70 * Publishes a notification. 71 * <p>If a notification with the same ID has been published by the current application and has not been deleted, 72 * this method will update the notification. 73 * 74 * @param { NotificationRequest } request - notification request 75 * @returns { Promise<void> } The promise returned by the function. 76 * @throws { BusinessError } 401 - The parameter check failed. 77 * @throws { BusinessError } 1600001 - Internal error. 78 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 79 * @throws { BusinessError } 1600003 - Failed to connect service. 80 * @throws { BusinessError } 1600004 - Notification is not enabled. 81 * @throws { BusinessError } 1600005 - Notification slot is not enabled. 82 * @throws { BusinessError } 1600009 - Over max number notifications per second. 83 * @throws { BusinessError } 1600012 - No memory space. 84 * @syscap SystemCapability.Notification.Notification 85 * @since 9 86 */ 87 function publish(request: NotificationRequest): Promise<void>; 88 89 /** 90 * Publishes a notification to the specified user. 91 * 92 * @permission ohos.permission.NOTIFICATION_CONTROLLER 93 * @param { NotificationRequest } request - a notification. 94 * @param { number } userId - of subscriber receiving the notification. 95 * @param { AsyncCallback<void> } callback - The callback of publish. 96 * @throws { BusinessError } 201 - Permission denied. 97 * @throws { BusinessError } 202 - Not system application to call the interface. 98 * @throws { BusinessError } 401 - The parameter check failed. 99 * @throws { BusinessError } 1600001 - Internal error. 100 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 101 * @throws { BusinessError } 1600003 - Failed to connect service. 102 * @throws { BusinessError } 1600004 - Notification is not enabled. 103 * @throws { BusinessError } 1600005 - Notification slot is not enabled. 104 * @throws { BusinessError } 1600008 - The user is not exist. 105 * @throws { BusinessError } 1600009 - Over max number notifications per second. 106 * @throws { BusinessError } 1600012 - No memory space. 107 * @syscap SystemCapability.Notification.Notification 108 * @systemapi 109 * @since 9 110 */ 111 function publish(request: NotificationRequest, userId: number, callback: AsyncCallback<void>): void; 112 113 /** 114 * Publishes a notification to the specified user. 115 * 116 * @permission ohos.permission.NOTIFICATION_CONTROLLER 117 * @param { NotificationRequest } request - a notification. 118 * @param { number } userId - of subscriber receiving the notification. 119 * @returns { Promise<void> } The promise returned by the function. 120 * @throws { BusinessError } 201 - Permission denied. 121 * @throws { BusinessError } 202 - Not system application to call the interface. 122 * @throws { BusinessError } 401 - The parameter check failed. 123 * @throws { BusinessError } 1600001 - Internal error. 124 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 125 * @throws { BusinessError } 1600003 - Failed to connect service. 126 * @throws { BusinessError } 1600004 - Notification is not enabled. 127 * @throws { BusinessError } 1600005 - Notification slot is not enabled. 128 * @throws { BusinessError } 1600008 - The user is not exist. 129 * @throws { BusinessError } 1600009 - Over max number notifications per second. 130 * @throws { BusinessError } 1600012 - No memory space. 131 * @syscap SystemCapability.Notification.Notification 132 * @systemapi 133 * @since 9 134 */ 135 function publish(request: NotificationRequest, userId: number): Promise<void>; 136 137 /** 138 * Publishes a representative notification. 139 * 140 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 141 * @param { NotificationRequest } request - a notification. 142 * @param { string } representativeBundle - bundle name of the representative 143 * @param { number } userId - userid of the representative 144 * @param { AsyncCallback<void> } callback - The callback of publishAsBundle. 145 * @throws { BusinessError } 201 - Permission denied. 146 * @throws { BusinessError } 202 - Not system application to call the interface. 147 * @throws { BusinessError } 401 - The parameter check failed. 148 * @throws { BusinessError } 1600001 - Internal error. 149 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 150 * @throws { BusinessError } 1600003 - Failed to connect service. 151 * @throws { BusinessError } 1600004 - Notification is not enabled. 152 * @throws { BusinessError } 1600005 - Notification slot is not enabled. 153 * @throws { BusinessError } 1600008 - The user is not exist. 154 * @throws { BusinessError } 1600009 - Over max number notifications per second. 155 * @throws { BusinessError } 1600012 - No memory space. 156 * @syscap SystemCapability.Notification.Notification 157 * @systemapi 158 * @since 9 159 */ 160 function publishAsBundle( 161 request: NotificationRequest, 162 representativeBundle: string, 163 userId: number, 164 callback: AsyncCallback<void> 165 ): void; 166 167 /** 168 * Publishes a representative notification. 169 * 170 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 171 * @param { NotificationRequest } request - a notification. 172 * @param { string } representativeBundle - bundle name of the representative 173 * @param { number } userId - userid of the representative 174 * @returns { Promise<void> } The promise returned by the function. 175 * @throws { BusinessError } 201 - Permission denied. 176 * @throws { BusinessError } 202 - Not system application to call the interface. 177 * @throws { BusinessError } 401 - The parameter check failed. 178 * @throws { BusinessError } 1600001 - Internal error. 179 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 180 * @throws { BusinessError } 1600003 - Failed to connect service. 181 * @throws { BusinessError } 1600004 - Notification is not enabled. 182 * @throws { BusinessError } 1600005 - Notification slot is not enabled. 183 * @throws { BusinessError } 1600008 - The user is not exist. 184 * @throws { BusinessError } 1600009 - Over max number notifications per second. 185 * @throws { BusinessError } 1600012 - No memory space. 186 * @syscap SystemCapability.Notification.Notification 187 * @systemapi 188 * @since 9 189 */ 190 function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise<void>; 191 192 /** 193 * Cancel a notification with the specified ID. 194 * 195 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 196 * @param { AsyncCallback<void> } callback - The callback of cancel. 197 * @throws { BusinessError } 401 - The parameter check failed. 198 * @throws { BusinessError } 1600001 - Internal error. 199 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 200 * @throws { BusinessError } 1600003 - Failed to connect service. 201 * @throws { BusinessError } 1600007 - The notification is not exist. 202 * @syscap SystemCapability.Notification.Notification 203 * @since 9 204 */ 205 function cancel(id: number, callback: AsyncCallback<void>): void; 206 207 /** 208 * Cancel a notification with the specified label and ID. 209 * 210 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 211 * @param { string } label - Label of the notification to cancel. 212 * @param { AsyncCallback<void> } callback - The callback of cancel. 213 * @throws { BusinessError } 401 - The parameter check failed. 214 * @throws { BusinessError } 1600001 - Internal error. 215 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 216 * @throws { BusinessError } 1600003 - Failed to connect service. 217 * @throws { BusinessError } 1600007 - The notification is not exist. 218 * @syscap SystemCapability.Notification.Notification 219 * @since 9 220 */ 221 function cancel(id: number, label: string, callback: AsyncCallback<void>): void; 222 223 /** 224 * Cancel a notification with the specified label and ID. 225 * 226 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 227 * @param { string } [label] - Label of the notification to cancel. 228 * @returns { Promise<void> } The promise returned by the function. 229 * @throws { BusinessError } 401 - The parameter check failed. 230 * @throws { BusinessError } 1600001 - Internal error. 231 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 232 * @throws { BusinessError } 1600003 - Failed to connect service. 233 * @throws { BusinessError } 1600007 - The notification is not exist. 234 * @syscap SystemCapability.Notification.Notification 235 * @since 9 236 */ 237 function cancel(id: number, label?: string): Promise<void>; 238 239 /** 240 * Cancel a representative notification. 241 * 242 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 243 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 244 * @param { string } representativeBundle - bundle name of the representative. 245 * @param { number } userId - userid of the representative. 246 * @param { AsyncCallback<void> } callback - The callback of cancelAsBundle. 247 * @throws { BusinessError } 201 - Permission denied. 248 * @throws { BusinessError } 202 - Not system application to call the interface. 249 * @throws { BusinessError } 401 - The parameter check failed. 250 * @throws { BusinessError } 1600001 - Internal error. 251 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 252 * @throws { BusinessError } 1600003 - Failed to connect service. 253 * @throws { BusinessError } 1600007 - The notification is not exist. 254 * @throws { BusinessError } 1600008 - The user is not exist. 255 * @syscap SystemCapability.Notification.Notification 256 * @systemapi 257 * @since 9 258 */ 259 function cancelAsBundle( 260 id: number, 261 representativeBundle: string, 262 userId: number, 263 callback: AsyncCallback<void> 264 ): void; 265 266 /** 267 * Cancel a representative notification. 268 * 269 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 270 * @param { number } id - ID of the notification to cancel, which must be unique in the application. 271 * @param { string } representativeBundle - bundle name of the representative. 272 * @param { number } userId - userid of the representative. 273 * @returns { Promise<void> } The promise returned by the function. 274 * @throws { BusinessError } 201 - Permission denied. 275 * @throws { BusinessError } 202 - Not system application to call the interface. 276 * @throws { BusinessError } 401 - The parameter check failed. 277 * @throws { BusinessError } 1600001 - Internal error. 278 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 279 * @throws { BusinessError } 1600003 - Failed to connect service. 280 * @throws { BusinessError } 1600007 - The notification is not exist. 281 * @throws { BusinessError } 1600008 - The user is not exist. 282 * @syscap SystemCapability.Notification.Notification 283 * @systemapi 284 * @since 9 285 */ 286 function cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise<void>; 287 288 /** 289 * Cancel all notifications of the current application. 290 * 291 * @param { AsyncCallback<void> } callback - The callback of cancelAll. 292 * @throws { BusinessError } 401 - The parameter check failed. 293 * @throws { BusinessError } 1600001 - Internal error. 294 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 295 * @throws { BusinessError } 1600003 - Failed to connect service. 296 * @syscap SystemCapability.Notification.Notification 297 * @since 9 298 */ 299 function cancelAll(callback: AsyncCallback<void>): void; 300 301 /** 302 * Cancel all notifications of the current application. 303 * 304 * @returns { Promise<void> } The promise returned by the function. 305 * @throws { BusinessError } 401 - The parameter check failed. 306 * @throws { BusinessError } 1600001 - Internal error. 307 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 308 * @throws { BusinessError } 1600003 - Failed to connect service. 309 * @syscap SystemCapability.Notification.Notification 310 * @since 9 311 */ 312 function cancelAll(): Promise<void>; 313 314 /** 315 * Creates a notification slot. 316 * 317 * @permission ohos.permission.NOTIFICATION_CONTROLLER 318 * @param { NotificationSlot } slot - Indicates the notification slot to be created, which is set by {@link NotificationSlot}. 319 * @param { AsyncCallback<void> } callback - The callback of addSlot. 320 * @throws { BusinessError } 201 - Permission denied. 321 * @throws { BusinessError } 202 - Not system application to call the interface. 322 * @throws { BusinessError } 401 - The parameter check failed. 323 * @throws { BusinessError } 1600001 - Internal error. 324 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 325 * @throws { BusinessError } 1600003 - Failed to connect service. 326 * @throws { BusinessError } 1600012 - No memory space. 327 * @syscap SystemCapability.Notification.Notification 328 * @systemapi 329 * @since 9 330 */ 331 function addSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void; 332 333 /** 334 * Creates a notification slot. 335 * 336 * @permission ohos.permission.NOTIFICATION_CONTROLLER 337 * @param { NotificationSlot } slot - Indicates the notification slot to be created, which is set by {@link NotificationSlot}. 338 * @returns { Promise<void> } The promise returned by the function. 339 * @throws { BusinessError } 201 - Permission denied. 340 * @throws { BusinessError } 202 - Not system application to call the interface. 341 * @throws { BusinessError } 401 - The parameter check failed. 342 * @throws { BusinessError } 1600001 - Internal error. 343 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 344 * @throws { BusinessError } 1600003 - Failed to connect service. 345 * @throws { BusinessError } 1600012 - No memory space. 346 * @syscap SystemCapability.Notification.Notification 347 * @systemapi 348 * @since 9 349 */ 350 function addSlot(slot: NotificationSlot): Promise<void>; 351 352 /** 353 * Adds a slot type. 354 * 355 * @param { SlotType } type - Slot type to add. 356 * @param { AsyncCallback<void> } callback - The callback of addSlot. 357 * @throws { BusinessError } 401 - The parameter check failed. 358 * @throws { BusinessError } 1600001 - Internal error. 359 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 360 * @throws { BusinessError } 1600003 - Failed to connect service. 361 * @throws { BusinessError } 1600012 - No memory space. 362 * @syscap SystemCapability.Notification.Notification 363 * @since 9 364 */ 365 function addSlot(type: SlotType, callback: AsyncCallback<void>): void; 366 367 /** 368 * Adds a slot type. 369 * 370 * @param { SlotType } type - Slot type to add. 371 * @returns { Promise<void> } The promise returned by the function. 372 * @throws { BusinessError } 401 - The parameter check failed. 373 * @throws { BusinessError } 1600001 - Internal error. 374 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 375 * @throws { BusinessError } 1600003 - Failed to connect service. 376 * @throws { BusinessError } 1600012 - No memory space. 377 * @syscap SystemCapability.Notification.Notification 378 * @since 9 379 */ 380 function addSlot(type: SlotType): Promise<void>; 381 382 /** 383 * Creates a notification slot. 384 * 385 * @permission ohos.permission.NOTIFICATION_CONTROLLER 386 * @param { Array<NotificationSlot> } slots - Indicates the notification slots to be created, which is set by {@link NotificationSlot}. 387 * @param { AsyncCallback<void> } callback - The callback of addSlots. 388 * @throws { BusinessError } 201 - Permission denied. 389 * @throws { BusinessError } 202 - Not system application to call the interface. 390 * @throws { BusinessError } 401 - The parameter check failed. 391 * @throws { BusinessError } 1600001 - Internal error. 392 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 393 * @throws { BusinessError } 1600003 - Failed to connect service. 394 * @throws { BusinessError } 1600012 - No memory space. 395 * @syscap SystemCapability.Notification.Notification 396 * @systemapi 397 * @since 9 398 */ 399 function addSlots(slots: Array<NotificationSlot>, callback: AsyncCallback<void>): void; 400 401 /** 402 * Creates a notification slot. 403 * 404 * @permission ohos.permission.NOTIFICATION_CONTROLLER 405 * @param { Array<NotificationSlot> } slots - Indicates the notification slots to be created, which is set by {@link NotificationSlot}. 406 * @returns { Promise<void> } The promise returned by the function. 407 * @throws { BusinessError } 201 - Permission denied. 408 * @throws { BusinessError } 202 - Not system application to call the interface. 409 * @throws { BusinessError } 401 - The parameter check failed. 410 * @throws { BusinessError } 1600001 - Internal error. 411 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 412 * @throws { BusinessError } 1600003 - Failed to connect service. 413 * @throws { BusinessError } 1600012 - No memory space. 414 * @syscap SystemCapability.Notification.Notification 415 * @systemapi 416 * @since 9 417 */ 418 function addSlots(slots: Array<NotificationSlot>): Promise<void>; 419 420 /** 421 * Obtains a notification slot of the specified slot type. 422 * 423 * @param { SlotType } slotType - Type of the notification slot to obtain. 424 * @param { AsyncCallback<NotificationSlot> } callback - The callback is used to return the NotificationSlot. 425 * @throws { BusinessError } 401 - The parameter check failed. 426 * @throws { BusinessError } 1600001 - Internal error. 427 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 428 * @throws { BusinessError } 1600003 - Failed to connect service. 429 * @syscap SystemCapability.Notification.Notification 430 * @since 9 431 */ 432 function getSlot(slotType: SlotType, callback: AsyncCallback<NotificationSlot>): void; 433 434 /** 435 * Obtains a notification slot of the specified slot type. 436 * 437 * @param { SlotType } slotType - Type of the notification slot to obtain. 438 * @returns { Promise<NotificationSlot> } Returns the NotificationSlot. 439 * @throws { BusinessError } 401 - The parameter check failed. 440 * @throws { BusinessError } 1600001 - Internal error. 441 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 442 * @throws { BusinessError } 1600003 - Failed to connect service. 443 * @syscap SystemCapability.Notification.Notification 444 * @since 9 445 */ 446 function getSlot(slotType: SlotType): Promise<NotificationSlot>; 447 448 /** 449 * Obtains all NotificationSlot objects created by the current application. 450 * 451 * @param { AsyncCallback<Array<NotificationSlot>> } callback - The callback is used to return all notification slots 452 * of this application. 453 * @throws { BusinessError } 401 - The parameter check failed. 454 * @throws { BusinessError } 1600001 - Internal error. 455 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 456 * @throws { BusinessError } 1600003 - Failed to connect service. 457 * @syscap SystemCapability.Notification.Notification 458 * @since 9 459 */ 460 function getSlots(callback: AsyncCallback<Array<NotificationSlot>>): void; 461 462 /** 463 * Obtains all NotificationSlot objects created by the current application. 464 * 465 * @returns { Promise<Array<NotificationSlot>> } Returns all notification slots of this application. 466 * @throws { BusinessError } 401 - The parameter check failed. 467 * @throws { BusinessError } 1600001 - Internal error. 468 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 469 * @throws { BusinessError } 1600003 - Failed to connect service. 470 * @syscap SystemCapability.Notification.Notification 471 * @since 9 472 */ 473 function getSlots(): Promise<Array<NotificationSlot>>; 474 475 /** 476 * Removes a NotificationSlot of the specified SlotType created by the current application. 477 * 478 * @param { SlotType } slotType - Type of the NotificationSlot to remove. 479 * @param { AsyncCallback<void> } callback - The callback of removeSlot. 480 * @throws { BusinessError } 401 - The parameter check failed. 481 * @throws { BusinessError } 1600001 - Internal error. 482 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 483 * @throws { BusinessError } 1600003 - Failed to connect service. 484 * @syscap SystemCapability.Notification.Notification 485 * @since 9 486 */ 487 function removeSlot(slotType: SlotType, callback: AsyncCallback<void>): void; 488 489 /** 490 * Removes a NotificationSlot of the specified SlotType created by the current application. 491 * 492 * @param { SlotType } slotType - Type of the NotificationSlot to remove. 493 * @returns { Promise<void> } The promise returned by the function. 494 * @throws { BusinessError } 401 - The parameter check failed. 495 * @throws { BusinessError } 1600001 - Internal error. 496 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 497 * @throws { BusinessError } 1600003 - Failed to connect service. 498 * @syscap SystemCapability.Notification.Notification 499 * @since 9 500 */ 501 function removeSlot(slotType: SlotType): Promise<void>; 502 503 /** 504 * Removes all NotificationSlot objects created by the current application. 505 * 506 * @param { AsyncCallback<void> } callback - The callback of removeAllSlots. 507 * @throws { BusinessError } 401 - The parameter check failed. 508 * @throws { BusinessError } 1600001 - Internal error. 509 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 510 * @throws { BusinessError } 1600003 - Failed to connect service. 511 * @syscap SystemCapability.Notification.Notification 512 * @since 9 513 */ 514 function removeAllSlots(callback: AsyncCallback<void>): void; 515 516 /** 517 * Removes all NotificationSlot objects created by the current application. 518 * 519 * @returns { Promise<void> } The promise returned by the function. 520 * @throws { BusinessError } 401 - The parameter check failed. 521 * @throws { BusinessError } 1600001 - Internal error. 522 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 523 * @throws { BusinessError } 1600003 - Failed to connect service. 524 * @syscap SystemCapability.Notification.Notification 525 * @since 9 526 */ 527 function removeAllSlots(): Promise<void>; 528 529 /** 530 * Set whether the application can send notifications. 531 * 532 * @permission ohos.permission.NOTIFICATION_CONTROLLER 533 * @param { BundleOption } bundle - The bundle option. 534 * @param { boolean } enable - Set enable or not. 535 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnable. 536 * @throws { BusinessError } 201 - Permission denied. 537 * @throws { BusinessError } 202 - Not system application to call the interface. 538 * @throws { BusinessError } 401 - The parameter check failed. 539 * @throws { BusinessError } 1600001 - Internal error. 540 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 541 * @throws { BusinessError } 1600003 - Failed to connect service. 542 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 543 * @syscap SystemCapability.Notification.Notification 544 * @systemapi 545 * @since 9 546 */ 547 function setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 548 549 /** 550 * Set whether the application can send notifications. 551 * 552 * @permission ohos.permission.NOTIFICATION_CONTROLLER 553 * @param { BundleOption } bundle - The bundle option. 554 * @param { boolean } enable - Set enable or not. 555 * @returns { Promise<void> } The promise returned by the function. 556 * @throws { BusinessError } 201 - Permission denied. 557 * @throws { BusinessError } 202 - Not system application to call the interface. 558 * @throws { BusinessError } 401 - The parameter check failed. 559 * @throws { BusinessError } 1600001 - Internal error. 560 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 561 * @throws { BusinessError } 1600003 - Failed to connect service. 562 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 563 * @syscap SystemCapability.Notification.Notification 564 * @systemapi 565 * @since 9 566 */ 567 function setNotificationEnable(bundle: BundleOption, enable: boolean): Promise<void>; 568 569 /** 570 * Checks whether this application allows to publish notifications. 571 * 572 * @permission ohos.permission.NOTIFICATION_CONTROLLER 573 * @param { BundleOption } bundle - The bundle option. 574 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 575 * @throws { BusinessError } 201 - Permission denied. 576 * @throws { BusinessError } 202 - Not system application to call the interface. 577 * @throws { BusinessError } 401 - The parameter check failed. 578 * @throws { BusinessError } 1600001 - Internal error. 579 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 580 * @throws { BusinessError } 1600003 - Failed to connect service. 581 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 582 * @syscap SystemCapability.Notification.Notification 583 * @systemapi 584 * @since 9 585 */ 586 function isNotificationEnabled(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 587 588 /** 589 * Checks whether this application allows to publish notifications. 590 * 591 * @permission ohos.permission.NOTIFICATION_CONTROLLER 592 * @param { BundleOption } bundle - The bundle option. 593 * @returns { Promise<boolean> } The promise returned by the function. 594 * @throws { BusinessError } 201 - Permission denied. 595 * @throws { BusinessError } 202 - Not system application to call the interface. 596 * @throws { BusinessError } 401 - The parameter check failed. 597 * @throws { BusinessError } 1600001 - Internal error. 598 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 599 * @throws { BusinessError } 1600003 - Failed to connect service. 600 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 601 * @syscap SystemCapability.Notification.Notification 602 * @systemapi 603 * @since 9 604 */ 605 function isNotificationEnabled(bundle: BundleOption): Promise<boolean>; 606 607 /** 608 * Checks whether this application allows to publish notifications. 609 * 610 * @permission ohos.permission.NOTIFICATION_CONTROLLER 611 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 612 * @throws { BusinessError } 201 - Permission denied. 613 * @throws { BusinessError } 202 - Not system application to call the interface. 614 * @throws { BusinessError } 401 - The parameter check failed. 615 * @throws { BusinessError } 1600001 - Internal error. 616 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 617 * @throws { BusinessError } 1600003 - Failed to connect service. 618 * @syscap SystemCapability.Notification.Notification 619 * @systemapi 620 * @since 9 621 */ 622 function isNotificationEnabled(callback: AsyncCallback<boolean>): void; 623 624 /** 625 * Checks whether this application allows to publish notifications. 626 * 627 * @permission ohos.permission.NOTIFICATION_CONTROLLER 628 * @returns { Promise<boolean> } The promise returned by the function. 629 * @throws { BusinessError } 201 - Permission denied. 630 * @throws { BusinessError } 202 - Not system application to call the interface. 631 * @throws { BusinessError } 401 - The parameter check failed. 632 * @throws { BusinessError } 1600001 - Internal error. 633 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 634 * @throws { BusinessError } 1600003 - Failed to connect service. 635 * @syscap SystemCapability.Notification.Notification 636 * @systemapi 637 * @since 9 638 */ 639 function isNotificationEnabled(): Promise<boolean>; 640 641 /** 642 * Checks whether this application allows to publish notifications under the user. 643 * 644 * @permission ohos.permission.NOTIFICATION_CONTROLLER 645 * @param { number } userId - The userid of the representative. 646 * @param { AsyncCallback<boolean> } callback - The callback of isNotificationEnabled. 647 * @throws { BusinessError } 201 - Permission denied. 648 * @throws { BusinessError } 202 - Not system application to call the interface. 649 * @throws { BusinessError } 401 - The parameter check failed. 650 * @throws { BusinessError } 1600001 - Internal error. 651 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 652 * @throws { BusinessError } 1600003 - Failed to connect service. 653 * @throws { BusinessError } 1600008 - The user is not exist. 654 * @syscap SystemCapability.Notification.Notification 655 * @systemapi 656 * @since 9 657 */ 658 function isNotificationEnabled(userId: number, callback: AsyncCallback<boolean>): void; 659 660 /** 661 * Checks whether this application allows to publish notifications under the user. 662 * 663 * @permission ohos.permission.NOTIFICATION_CONTROLLER 664 * @param { number } userId - The userid of the representative. 665 * @returns { Promise<boolean> } The promise returned by the function. 666 * @throws { BusinessError } 201 - Permission denied. 667 * @throws { BusinessError } 202 - Not system application to call the interface. 668 * @throws { BusinessError } 401 - The parameter check failed. 669 * @throws { BusinessError } 1600001 - Internal error. 670 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 671 * @throws { BusinessError } 1600003 - Failed to connect service. 672 * @throws { BusinessError } 1600008 - The user is not exist. 673 * @syscap SystemCapability.Notification.Notification 674 * @systemapi 675 * @since 9 676 */ 677 function isNotificationEnabled(userId: number): Promise<boolean>; 678 679 /** 680 * Sets whether to allow the specified application to show badge. 681 * 682 * @permission ohos.permission.NOTIFICATION_CONTROLLER 683 * @param { BundleOption } bundle - The bundle option. 684 * @param { boolean } enable - Set enable or not. 685 * @param { AsyncCallback<void> } callback - The callback of displayBadge. 686 * @throws { BusinessError } 201 - Permission denied. 687 * @throws { BusinessError } 202 - Not system application to call the interface. 688 * @throws { BusinessError } 401 - The parameter check failed. 689 * @throws { BusinessError } 1600001 - Internal error. 690 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 691 * @throws { BusinessError } 1600003 - Failed to connect service. 692 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 693 * @syscap SystemCapability.Notification.Notification 694 * @systemapi 695 * @since 9 696 */ 697 function displayBadge(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 698 699 /** 700 * Sets whether to allow the specified application to show badge. 701 * 702 * @permission ohos.permission.NOTIFICATION_CONTROLLER 703 * @param { BundleOption } bundle - The bundle option. 704 * @param { boolean } enable - Set enable or not. 705 * @returns { Promise<void> } The promise returned by the function. 706 * @throws { BusinessError } 201 - Permission denied. 707 * @throws { BusinessError } 202 - Not system application to call the interface. 708 * @throws { BusinessError } 401 - The parameter check failed. 709 * @throws { BusinessError } 1600001 - Internal error. 710 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 711 * @throws { BusinessError } 1600003 - Failed to connect service. 712 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 713 * @syscap SystemCapability.Notification.Notification 714 * @systemapi 715 * @since 9 716 */ 717 function displayBadge(bundle: BundleOption, enable: boolean): Promise<void>; 718 719 /** 720 * Obtains the flag that whether to allow the application to show badge. 721 * 722 * @permission ohos.permission.NOTIFICATION_CONTROLLER 723 * @param { BundleOption } bundle - The bundle option. 724 * @param { AsyncCallback<boolean> } callback - The callback of isBadgeDisplayed. 725 * @throws { BusinessError } 201 - Permission denied. 726 * @throws { BusinessError } 202 - Not system application to call the interface. 727 * @throws { BusinessError } 401 - The parameter check failed. 728 * @throws { BusinessError } 1600001 - Internal error. 729 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 730 * @throws { BusinessError } 1600003 - Failed to connect service. 731 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 732 * @syscap SystemCapability.Notification.Notification 733 * @systemapi 734 * @since 9 735 */ 736 function isBadgeDisplayed(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 737 738 /** 739 * Obtains the flag that whether to allow the application to show badge. 740 * 741 * @permission ohos.permission.NOTIFICATION_CONTROLLER 742 * @param { BundleOption } bundle - The bundle option. 743 * @returns { Promise<boolean> } The promise returned by the function. 744 * @throws { BusinessError } 201 - Permission denied. 745 * @throws { BusinessError } 202 - Not system application to call the interface. 746 * @throws { BusinessError } 401 - The parameter check failed. 747 * @throws { BusinessError } 1600001 - Internal error. 748 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 749 * @throws { BusinessError } 1600003 - Failed to connect service. 750 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 751 * @syscap SystemCapability.Notification.Notification 752 * @systemapi 753 * @since 9 754 */ 755 function isBadgeDisplayed(bundle: BundleOption): Promise<boolean>; 756 757 /** 758 * Update all notification slots for the specified bundle. 759 * 760 * @permission ohos.permission.NOTIFICATION_CONTROLLER 761 * @param { BundleOption } bundle - The bundle option. 762 * @param { NotificationSlot } slot - Indicates the notification slot. 763 * @param { AsyncCallback<void> } callback - The callback of setSlotByBundle. 764 * @throws { BusinessError } 201 - Permission denied. 765 * @throws { BusinessError } 202 - Not system application to call the interface. 766 * @throws { BusinessError } 401 - The parameter check failed. 767 * @throws { BusinessError } 1600001 - Internal error. 768 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 769 * @throws { BusinessError } 1600003 - Failed to connect service. 770 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 771 * @syscap SystemCapability.Notification.Notification 772 * @systemapi 773 * @since 9 774 */ 775 function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot, callback: AsyncCallback<void>): void; 776 777 /** 778 * Update all notification slots for the specified bundle. 779 * 780 * @permission ohos.permission.NOTIFICATION_CONTROLLER 781 * @param { BundleOption } bundle - The bundle option. 782 * @param { NotificationSlot } slot - Indicates the notification slot. 783 * @returns { Promise<void> } The promise returned by the function. 784 * @throws { BusinessError } 201 - Permission denied. 785 * @throws { BusinessError } 202 - Not system application to call the interface. 786 * @throws { BusinessError } 401 - The parameter check failed. 787 * @throws { BusinessError } 1600001 - Internal error. 788 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 789 * @throws { BusinessError } 1600003 - Failed to connect service. 790 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 791 * @syscap SystemCapability.Notification.Notification 792 * @systemapi 793 * @since 9 794 */ 795 function setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise<void>; 796 797 /** 798 * Obtains all notification slots belonging to the specified bundle. 799 * 800 * @permission ohos.permission.NOTIFICATION_CONTROLLER 801 * @param { BundleOption } bundle - The bundle option. 802 * @param { AsyncCallback<Array<NotificationSlot>> } callback - The callback of getSlotsByBundle. 803 * @throws { BusinessError } 201 - Permission denied. 804 * @throws { BusinessError } 202 - Not system application to call the interface. 805 * @throws { BusinessError } 401 - The parameter check failed. 806 * @throws { BusinessError } 1600001 - Internal error. 807 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 808 * @throws { BusinessError } 1600003 - Failed to connect service. 809 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 810 * @syscap SystemCapability.Notification.Notification 811 * @systemapi 812 * @since 9 813 */ 814 function getSlotsByBundle(bundle: BundleOption, callback: AsyncCallback<Array<NotificationSlot>>): void; 815 816 /** 817 * Obtains all notification slots belonging to the specified bundle. 818 * 819 * @permission ohos.permission.NOTIFICATION_CONTROLLER 820 * @param { BundleOption } bundle - The bundle option. 821 * @returns { Promise<Array<NotificationSlot>> } The promise returned by the function. 822 * @throws { BusinessError } 201 - Permission denied. 823 * @throws { BusinessError } 202 - Not system application to call the interface. 824 * @throws { BusinessError } 401 - The parameter check failed. 825 * @throws { BusinessError } 1600001 - Internal error. 826 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 827 * @throws { BusinessError } 1600003 - Failed to connect service. 828 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 829 * @syscap SystemCapability.Notification.Notification 830 * @systemapi 831 * @since 9 832 */ 833 function getSlotsByBundle(bundle: BundleOption): Promise<Array<NotificationSlot>>; 834 835 /** 836 * Obtains number of slot. 837 * 838 * @permission ohos.permission.NOTIFICATION_CONTROLLER 839 * @param { BundleOption } bundle - The bundle option. 840 * @param { AsyncCallback<number> } callback - The callback of getSlotNumByBundle. 841 * @throws { BusinessError } 201 - Permission denied. 842 * @throws { BusinessError } 202 - Not system application to call the interface. 843 * @throws { BusinessError } 401 - The parameter check failed. 844 * @throws { BusinessError } 1600001 - Internal error. 845 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 846 * @throws { BusinessError } 1600003 - Failed to connect service. 847 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 848 * @syscap SystemCapability.Notification.Notification 849 * @systemapi 850 * @since 9 851 */ 852 function getSlotNumByBundle(bundle: BundleOption, callback: AsyncCallback<number>): void; 853 854 /** 855 * Obtains number of slot. 856 * 857 * @permission ohos.permission.NOTIFICATION_CONTROLLER 858 * @param { BundleOption } bundle - The bundle option. 859 * @returns { Promise<number> } The promise returned by the function. 860 * @throws { BusinessError } 201 - Permission denied. 861 * @throws { BusinessError } 202 - Not system application to call the interface. 862 * @throws { BusinessError } 401 - The parameter check failed. 863 * @throws { BusinessError } 1600001 - Internal error. 864 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 865 * @throws { BusinessError } 1600003 - Failed to connect service. 866 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 867 * @syscap SystemCapability.Notification.Notification 868 * @systemapi 869 * @since 9 870 */ 871 function getSlotNumByBundle(bundle: BundleOption): Promise<number>; 872 873 /** 874 * Obtains all active notifications in the current system. The caller must have system permissions to 875 * call this method. 876 * 877 * @permission ohos.permission.NOTIFICATION_CONTROLLER 878 * @param { AsyncCallback<Array<NotificationRequest>> } callback - The callback of getAllActiveNotifications. 879 * @throws { BusinessError } 201 - Permission denied. 880 * @throws { BusinessError } 202 - Not system application to call the interface. 881 * @throws { BusinessError } 401 - The parameter check failed. 882 * @throws { BusinessError } 1600001 - Internal error. 883 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 884 * @throws { BusinessError } 1600003 - Failed to connect service. 885 * @syscap SystemCapability.Notification.Notification 886 * @systemapi 887 * @since 9 888 */ 889 function getAllActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 890 891 /** 892 * Obtains all active notifications in the current system. The caller must have system permissions to 893 * call this method. 894 * 895 * @permission ohos.permission.NOTIFICATION_CONTROLLER 896 * @returns { Promise<Array<NotificationRequest>> } The promise returned by the function. 897 * @throws { BusinessError } 201 - Permission denied. 898 * @throws { BusinessError } 202 - Not system application to call the interface. 899 * @throws { BusinessError } 401 - The parameter check failed. 900 * @throws { BusinessError } 1600001 - Internal error. 901 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 902 * @throws { BusinessError } 1600003 - Failed to connect service. 903 * @syscap SystemCapability.Notification.Notification 904 * @systemapi 905 * @since 9 906 */ 907 function getAllActiveNotifications(): Promise<Array<NotificationRequest>>; 908 909 /** 910 * Obtains the number of all active notifications. 911 * 912 * @param { AsyncCallback<number> } callback - The callback of getActiveNotificationCount. 913 * @throws { BusinessError } 401 - The parameter check failed. 914 * @throws { BusinessError } 1600001 - Internal error. 915 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 916 * @throws { BusinessError } 1600003 - Failed to connect service. 917 * @syscap SystemCapability.Notification.Notification 918 * @since 9 919 */ 920 function getActiveNotificationCount(callback: AsyncCallback<number>): void; 921 922 /** 923 * Obtains the number of all active notifications. 924 * 925 * @returns { Promise<number> } The promise returned by the function. 926 * @throws { BusinessError } 401 - The parameter check failed. 927 * @throws { BusinessError } 1600001 - Internal error. 928 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 929 * @throws { BusinessError } 1600003 - Failed to connect service. 930 * @syscap SystemCapability.Notification.Notification 931 * @since 9 932 */ 933 function getActiveNotificationCount(): Promise<number>; 934 935 /** 936 * Obtains an array of active notifications. 937 * 938 * @param { AsyncCallback<Array<NotificationRequest>> } callback - The callback of getActiveNotifications. 939 * @throws { BusinessError } 401 - The parameter check failed. 940 * @throws { BusinessError } 1600001 - Internal error. 941 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 942 * @throws { BusinessError } 1600003 - Failed to connect service. 943 * @syscap SystemCapability.Notification.Notification 944 * @since 9 945 */ 946 function getActiveNotifications(callback: AsyncCallback<Array<NotificationRequest>>): void; 947 948 /** 949 * Obtains an array of active notifications. 950 * 951 * @returns { Promise<Array<NotificationRequest>> } The promise returned by the function. 952 * @throws { BusinessError } 401 - The parameter check failed. 953 * @throws { BusinessError } 1600001 - Internal error. 954 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 955 * @throws { BusinessError } 1600003 - Failed to connect service. 956 * @syscap SystemCapability.Notification.Notification 957 * @since 9 958 */ 959 function getActiveNotifications(): Promise<Array<NotificationRequest>>; 960 961 /** 962 * Cancel the notification of a specified group for this application. 963 * 964 * @param { string } groupName - The name of the group. 965 * @param { AsyncCallback<void> } callback - The callback of cancelGroup. 966 * @throws { BusinessError } 401 - The parameter check failed. 967 * @throws { BusinessError } 1600001 - Internal error. 968 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 969 * @throws { BusinessError } 1600003 - Failed to connect service. 970 * @syscap SystemCapability.Notification.Notification 971 * @since 9 972 */ 973 function cancelGroup(groupName: string, callback: AsyncCallback<void>): void; 974 975 /** 976 * Cancel the notification of a specified group for this application. 977 * 978 * @param { string } groupName - The name of the group. 979 * @returns { Promise<void> } The promise returned by the function. 980 * @throws { BusinessError } 401 - The parameter check failed. 981 * @throws { BusinessError } 1600001 - Internal error. 982 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 983 * @throws { BusinessError } 1600003 - Failed to connect service. 984 * @syscap SystemCapability.Notification.Notification 985 * @since 9 986 */ 987 function cancelGroup(groupName: string): Promise<void>; 988 989 /** 990 * Delete the notification of a specified group for this application. 991 * 992 * @permission ohos.permission.NOTIFICATION_CONTROLLER 993 * @param { BundleOption } bundle - The bundle option. 994 * @param { string } groupName - The name of the group. 995 * @param { AsyncCallback<void> } callback - The callback of removeGroupByBundle. 996 * @throws { BusinessError } 201 - Permission denied. 997 * @throws { BusinessError } 202 - Not system application to call the interface. 998 * @throws { BusinessError } 401 - The parameter check failed. 999 * @throws { BusinessError } 1600001 - Internal error. 1000 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1001 * @throws { BusinessError } 1600003 - Failed to connect service. 1002 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1003 * @syscap SystemCapability.Notification.Notification 1004 * @systemapi 1005 * @since 9 1006 */ 1007 function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback<void>): void; 1008 1009 /** 1010 * Delete the notification of a specified group for this application. 1011 * 1012 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1013 * @param { BundleOption } bundle - The bundle option. 1014 * @param { string } groupName - The name of the group. 1015 * @returns { Promise<void> } The promise returned by the function. 1016 * @throws { BusinessError } 201 - Permission denied. 1017 * @throws { BusinessError } 202 - Not system application to call the interface. 1018 * @throws { BusinessError } 401 - The parameter check failed. 1019 * @throws { BusinessError } 1600001 - Internal error. 1020 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1021 * @throws { BusinessError } 1600003 - Failed to connect service. 1022 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1023 * @syscap SystemCapability.Notification.Notification 1024 * @systemapi 1025 * @since 9 1026 */ 1027 function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise<void>; 1028 1029 /** 1030 * Set the Do Not Disturb date. 1031 * 1032 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1033 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1034 * @param { AsyncCallback<void> } callback - The callback of setDoNotDisturbDate. 1035 * @throws { BusinessError } 201 - Permission denied. 1036 * @throws { BusinessError } 202 - Not system application to call the interface. 1037 * @throws { BusinessError } 401 - The parameter check failed. 1038 * @throws { BusinessError } 1600001 - Internal error. 1039 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1040 * @throws { BusinessError } 1600003 - Failed to connect service. 1041 * @throws { BusinessError } 1600012 - No memory space. 1042 * @syscap SystemCapability.Notification.Notification 1043 * @systemapi 1044 * @since 9 1045 */ 1046 function setDoNotDisturbDate(date: DoNotDisturbDate, callback: AsyncCallback<void>): void; 1047 1048 /** 1049 * Set the Do Not Disturb date. 1050 * 1051 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1052 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1053 * @returns { Promise<void> } The promise returned by the function. 1054 * @throws { BusinessError } 201 - Permission denied. 1055 * @throws { BusinessError } 202 - Not system application to call the interface. 1056 * @throws { BusinessError } 401 - The parameter check failed. 1057 * @throws { BusinessError } 1600001 - Internal error. 1058 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1059 * @throws { BusinessError } 1600003 - Failed to connect service. 1060 * @throws { BusinessError } 1600012 - No memory space. 1061 * @syscap SystemCapability.Notification.Notification 1062 * @systemapi 1063 * @since 9 1064 */ 1065 function setDoNotDisturbDate(date: DoNotDisturbDate): Promise<void>; 1066 1067 /** 1068 * Set the Do Not Disturb date under the specified user. 1069 * 1070 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1071 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1072 * @param { number } userId - The userId. 1073 * @param { AsyncCallback<void> } callback - The callback of setDoNotDisturbDate. 1074 * @throws { BusinessError } 201 - Permission denied. 1075 * @throws { BusinessError } 202 - Not system application to call the interface. 1076 * @throws { BusinessError } 401 - The parameter check failed. 1077 * @throws { BusinessError } 1600001 - Internal error. 1078 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1079 * @throws { BusinessError } 1600003 - Failed to connect service. 1080 * @throws { BusinessError } 1600008 - The user is not exist. 1081 * @throws { BusinessError } 1600012 - No memory space. 1082 * @syscap SystemCapability.Notification.Notification 1083 * @systemapi 1084 * @since 9 1085 */ 1086 function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number, callback: AsyncCallback<void>): void; 1087 1088 /** 1089 * Set the Do Not Disturb date under the specified user. 1090 * 1091 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1092 * @param { DoNotDisturbDate } date - The Do Not Disturb date. 1093 * @param { number } userId - The userId. 1094 * @returns { Promise<void> } The promise returned by the function. 1095 * @throws { BusinessError } 201 - Permission denied. 1096 * @throws { BusinessError } 202 - Not system application to call the interface. 1097 * @throws { BusinessError } 401 - The parameter check failed. 1098 * @throws { BusinessError } 1600001 - Internal error. 1099 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1100 * @throws { BusinessError } 1600003 - Failed to connect service. 1101 * @throws { BusinessError } 1600008 - The user is not exist. 1102 * @throws { BusinessError } 1600012 - No memory space. 1103 * @syscap SystemCapability.Notification.Notification 1104 * @systemapi 1105 * @since 9 1106 */ 1107 function setDoNotDisturbDate(date: DoNotDisturbDate, userId: number): Promise<void>; 1108 1109 /** 1110 * Obtains the Do Not Disturb date. 1111 * 1112 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1113 * @param { AsyncCallback<DoNotDisturbDate> } callback - The callback is used to return the Do Not Disturb date. 1114 * @throws { BusinessError } 201 - Permission denied. 1115 * @throws { BusinessError } 202 - Not system application to call the interface. 1116 * @throws { BusinessError } 401 - The parameter check failed. 1117 * @throws { BusinessError } 1600001 - Internal error. 1118 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1119 * @throws { BusinessError } 1600003 - Failed to connect service. 1120 * @throws { BusinessError } 1600012 - No memory space. 1121 * @syscap SystemCapability.Notification.Notification 1122 * @systemapi 1123 * @since 9 1124 */ 1125 function getDoNotDisturbDate(callback: AsyncCallback<DoNotDisturbDate>): void; 1126 1127 /** 1128 * Obtains the Do Not Disturb date. 1129 * 1130 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1131 * @returns { Promise<DoNotDisturbDate> } Returns the Do Not Disturb date. 1132 * @throws { BusinessError } 201 - Permission denied. 1133 * @throws { BusinessError } 202 - Not system application to call the interface. 1134 * @throws { BusinessError } 401 - The parameter check failed. 1135 * @throws { BusinessError } 1600001 - Internal error. 1136 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1137 * @throws { BusinessError } 1600003 - Failed to connect service. 1138 * @throws { BusinessError } 1600012 - No memory space. 1139 * @syscap SystemCapability.Notification.Notification 1140 * @systemapi 1141 * @since 9 1142 */ 1143 function getDoNotDisturbDate(): Promise<DoNotDisturbDate>; 1144 1145 /** 1146 * Obtains the Do Not Disturb date. 1147 * 1148 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1149 * @param { number } userId - The userId. 1150 * @param { AsyncCallback<DoNotDisturbDate> } callback - The callback is used to return the Do Not Disturb date. 1151 * @throws { BusinessError } 201 - Permission denied. 1152 * @throws { BusinessError } 202 - Not system application to call the interface. 1153 * @throws { BusinessError } 401 - The parameter check failed. 1154 * @throws { BusinessError } 1600001 - Internal error. 1155 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1156 * @throws { BusinessError } 1600003 - Failed to connect service. 1157 * @throws { BusinessError } 1600008 - The user is not exist. 1158 * @throws { BusinessError } 1600012 - No memory space. 1159 * @syscap SystemCapability.Notification.Notification 1160 * @systemapi 1161 * @since 9 1162 */ 1163 function getDoNotDisturbDate(userId: number, callback: AsyncCallback<DoNotDisturbDate>): void; 1164 1165 /** 1166 * Obtains the Do Not Disturb date. 1167 * 1168 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1169 * @param { number } userId - The userId. 1170 * @returns { Promise<DoNotDisturbDate> } Returns the Do Not Disturb date. 1171 * @throws { BusinessError } 201 - Permission denied. 1172 * @throws { BusinessError } 202 - Not system application to call the interface. 1173 * @throws { BusinessError } 401 - The parameter check failed. 1174 * @throws { BusinessError } 1600001 - Internal error. 1175 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1176 * @throws { BusinessError } 1600003 - Failed to connect service. 1177 * @throws { BusinessError } 1600008 - The user is not exist. 1178 * @throws { BusinessError } 1600012 - No memory space. 1179 * @syscap SystemCapability.Notification.Notification 1180 * @systemapi 1181 * @since 9 1182 */ 1183 function getDoNotDisturbDate(userId: number): Promise<DoNotDisturbDate>; 1184 1185 /** 1186 * Obtains whether to support the Do Not Disturb mode. 1187 * 1188 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1189 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether Do Not Disturb 1190 * mode is supported. 1191 * @throws { BusinessError } 201 - Permission denied. 1192 * @throws { BusinessError } 202 - Not system application to call the interface. 1193 * @throws { BusinessError } 401 - The parameter check failed. 1194 * @throws { BusinessError } 1600001 - Internal error. 1195 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1196 * @throws { BusinessError } 1600003 - Failed to connect service. 1197 * @syscap SystemCapability.Notification.Notification 1198 * @systemapi 1199 * @since 9 1200 */ 1201 function isSupportDoNotDisturbMode(callback: AsyncCallback<boolean>): void; 1202 1203 /** 1204 * Obtains whether to support the Do Not Disturb mode. 1205 * 1206 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1207 * @returns { Promise<boolean> } Returns whether Do Not Disturb mode is supported. 1208 * @throws { BusinessError } 201 - Permission denied. 1209 * @throws { BusinessError } 202 - Not system application to call the interface. 1210 * @throws { BusinessError } 401 - The parameter check failed. 1211 * @throws { BusinessError } 1600001 - Internal error. 1212 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1213 * @throws { BusinessError } 1600003 - Failed to connect service. 1214 * @syscap SystemCapability.Notification.Notification 1215 * @systemapi 1216 * @since 9 1217 */ 1218 function isSupportDoNotDisturbMode(): Promise<boolean>; 1219 1220 /** 1221 * Obtains whether the template is supported by the system. 1222 * 1223 * @param { string } templateName - Name of template to be Obtained. 1224 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the template is supported. 1225 * @throws { BusinessError } 401 - The parameter check failed. 1226 * @throws { BusinessError } 1600001 - Internal error. 1227 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1228 * @throws { BusinessError } 1600003 - Failed to connect service. 1229 * @syscap SystemCapability.Notification.Notification 1230 * @since 9 1231 */ 1232 function isSupportTemplate(templateName: string, callback: AsyncCallback<boolean>): void; 1233 1234 /** 1235 * Obtains whether the template is supported by the system. 1236 * 1237 * @param { string } templateName - Name of template to be Obtained. 1238 * @returns { Promise<boolean> } Returns whether the template is supported. 1239 * @throws { BusinessError } 401 - The parameter check failed. 1240 * @throws { BusinessError } 1600001 - Internal error. 1241 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1242 * @throws { BusinessError } 1600003 - Failed to connect service. 1243 * @syscap SystemCapability.Notification.Notification 1244 * @since 9 1245 */ 1246 function isSupportTemplate(templateName: string): Promise<boolean>; 1247 1248 /** 1249 * Request permission to send notification. 1250 * 1251 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 1252 * @throws { BusinessError } 401 - The parameter check failed. 1253 * @throws { BusinessError } 1600001 - Internal error. 1254 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1255 * @throws { BusinessError } 1600003 - Failed to connect service. 1256 * @syscap SystemCapability.Notification.Notification 1257 * @since 9 1258 */ 1259 function requestEnableNotification(callback: AsyncCallback<void>): void; 1260 1261 /** 1262 * Request permission to send notification. 1263 * 1264 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 1265 * @param { AsyncCallback<void> } callback - The callback of requestEnableNotification. 1266 * @throws { BusinessError } 401 - The parameter check failed. 1267 * @throws { BusinessError } 1600001 - Internal error. 1268 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1269 * @throws { BusinessError } 1600003 - Failed to connect service. 1270 * @syscap SystemCapability.Notification.Notification 1271 * @StageModelOnly 1272 * @since 10 1273 */ 1274 function requestEnableNotification(context: UIAbilityContext, callback: AsyncCallback<void>): void; 1275 1276 /** 1277 * Request permission to send notification. 1278 * 1279 * @returns { Promise<void> } The promise returned by the function. 1280 * @throws { BusinessError } 401 - The parameter check failed. 1281 * @throws { BusinessError } 1600001 - Internal error. 1282 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1283 * @throws { BusinessError } 1600003 - Failed to connect service. 1284 * @syscap SystemCapability.Notification.Notification 1285 * @since 9 1286 */ 1287 function requestEnableNotification(): Promise<void>; 1288 1289 /** 1290 * Request permission to send notification. 1291 * 1292 * @param { UIAbilityContext } context - The context indicates the ability context you want to bind; 1293 * @returns { Promise<void> } The promise returned by the function. 1294 * @throws { BusinessError } 401 - The parameter check failed. 1295 * @throws { BusinessError } 1600001 - Internal error. 1296 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1297 * @throws { BusinessError } 1600003 - Failed to connect service. 1298 * @syscap SystemCapability.Notification.Notification 1299 * @StageModelOnly 1300 * @since 10 1301 */ 1302 function requestEnableNotification(context: UIAbilityContext): Promise<void>; 1303 1304 /** 1305 * Sets whether the device supports distributed notification. 1306 * 1307 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1308 * @param { boolean } enable - Set enable or not. 1309 * @param { AsyncCallback<void> } callback - The callback of setDistributedEnable. 1310 * @throws { BusinessError } 201 - Permission denied. 1311 * @throws { BusinessError } 202 - Not system application to call the interface. 1312 * @throws { BusinessError } 401 - The parameter check failed. 1313 * @throws { BusinessError } 1600001 - Internal error. 1314 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1315 * @throws { BusinessError } 1600003 - Failed to connect service. 1316 * @throws { BusinessError } 1600010 - Distributed operation failed. 1317 * @syscap SystemCapability.Notification.Notification 1318 * @systemapi 1319 * @since 9 1320 */ 1321 function setDistributedEnable(enable: boolean, callback: AsyncCallback<void>): void; 1322 1323 /** 1324 * Sets whether the device supports distributed notification. 1325 * 1326 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1327 * @param { boolean } enable - Set enable or not. 1328 * @returns { Promise<void> } The promise returned by the function. 1329 * @throws { BusinessError } 201 - Permission denied. 1330 * @throws { BusinessError } 202 - Not system application to call the interface. 1331 * @throws { BusinessError } 401 - The parameter check failed. 1332 * @throws { BusinessError } 1600001 - Internal error. 1333 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1334 * @throws { BusinessError } 1600003 - Failed to connect service. 1335 * @throws { BusinessError } 1600010 - Distributed operation failed. 1336 * @syscap SystemCapability.Notification.Notification 1337 * @systemapi 1338 * @since 9 1339 */ 1340 function setDistributedEnable(enable: boolean): Promise<void>; 1341 1342 /** 1343 * Obtains whether the device supports distributed notification. 1344 * 1345 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the distributed 1346 * notification is supported. 1347 * @throws { BusinessError } 401 - The parameter check failed. 1348 * @throws { BusinessError } 1600001 - Internal error. 1349 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1350 * @throws { BusinessError } 1600003 - Failed to connect service. 1351 * @throws { BusinessError } 1600010 - Distributed operation failed. 1352 * @syscap SystemCapability.Notification.Notification 1353 * @since 9 1354 */ 1355 function isDistributedEnabled(callback: AsyncCallback<boolean>): void; 1356 1357 /** 1358 * Obtains whether the device supports distributed notification. 1359 * 1360 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 1361 * @throws { BusinessError } 401 - The parameter check failed. 1362 * @throws { BusinessError } 1600001 - Internal error. 1363 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1364 * @throws { BusinessError } 1600003 - Failed to connect service. 1365 * @throws { BusinessError } 1600010 - Distributed operation failed. 1366 * @syscap SystemCapability.Notification.Notification 1367 * @since 9 1368 */ 1369 function isDistributedEnabled(): Promise<boolean>; 1370 1371 /** 1372 * Sets whether an application supports distributed notification. 1373 * 1374 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1375 * @param { BundleOption } bundle - The bundle option. 1376 * @param { boolean } enable - Set enable or not. 1377 * @param { AsyncCallback<void> } callback - The callback of setDistributedEnableByBundle. 1378 * @throws { BusinessError } 201 - Permission denied. 1379 * @throws { BusinessError } 202 - Not system application to call the interface. 1380 * @throws { BusinessError } 401 - The parameter check failed. 1381 * @throws { BusinessError } 1600001 - Internal error. 1382 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1383 * @throws { BusinessError } 1600003 - Failed to connect service. 1384 * @throws { BusinessError } 1600010 - Distributed operation failed. 1385 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1386 * @syscap SystemCapability.Notification.Notification 1387 * @systemapi 1388 * @since 9 1389 */ 1390 function setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<void>): void; 1391 1392 /** 1393 * Sets whether an application supports distributed notification. 1394 * 1395 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1396 * @param { BundleOption } bundle - The bundle option. 1397 * @param { boolean } enable - Set enable or not. 1398 * @returns { Promise<void> } The promise returned by the function. 1399 * @throws { BusinessError } 201 - Permission denied. 1400 * @throws { BusinessError } 202 - Not system application to call the interface. 1401 * @throws { BusinessError } 401 - The parameter check failed. 1402 * @throws { BusinessError } 1600001 - Internal error. 1403 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1404 * @throws { BusinessError } 1600003 - Failed to connect service. 1405 * @throws { BusinessError } 1600010 - Distributed operation failed. 1406 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1407 * @syscap SystemCapability.Notification.Notification 1408 * @systemapi 1409 * @since 9 1410 */ 1411 function setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise<void>; 1412 1413 /** 1414 * Obtains whether an application supports distributed notification. 1415 * 1416 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1417 * @param { BundleOption } bundle - The bundle option. 1418 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the distributed 1419 * notification is supported. 1420 * @throws { BusinessError } 201 - Permission denied. 1421 * @throws { BusinessError } 202 - Not system application to call the interface. 1422 * @throws { BusinessError } 401 - The parameter check failed. 1423 * @throws { BusinessError } 1600001 - Internal error. 1424 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1425 * @throws { BusinessError } 1600003 - Failed to connect service. 1426 * @throws { BusinessError } 1600010 - Distributed operation failed. 1427 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1428 * @syscap SystemCapability.Notification.Notification 1429 * @systemapi 1430 * @since 9 1431 */ 1432 function isDistributedEnabledByBundle(bundle: BundleOption, callback: AsyncCallback<boolean>): void; 1433 1434 /** 1435 * Obtains whether an application supports distributed notification. 1436 * 1437 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1438 * @param { BundleOption } bundle - The bundle option. 1439 * @returns { Promise<boolean> } Returns whether the distributed notification is supported. 1440 * @throws { BusinessError } 201 - Permission denied. 1441 * @throws { BusinessError } 202 - Not system application to call the interface. 1442 * @throws { BusinessError } 401 - The parameter check failed. 1443 * @throws { BusinessError } 1600001 - Internal error. 1444 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1445 * @throws { BusinessError } 1600003 - Failed to connect service. 1446 * @throws { BusinessError } 1600010 - Distributed operation failed. 1447 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1448 * @syscap SystemCapability.Notification.Notification 1449 * @systemapi 1450 * @since 9 1451 */ 1452 function isDistributedEnabledByBundle(bundle: BundleOption): Promise<boolean>; 1453 1454 /** 1455 * Obtains the remind modes of the notification. 1456 * 1457 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1458 * @param { AsyncCallback<DeviceRemindType> } callback - The callback is used to return the RemindType. 1459 * @throws { BusinessError } 201 - Permission denied. 1460 * @throws { BusinessError } 202 - Not system application to call the interface. 1461 * @throws { BusinessError } 401 - The parameter check failed. 1462 * @throws { BusinessError } 1600001 - Internal error. 1463 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1464 * @throws { BusinessError } 1600003 - Failed to connect service. 1465 * @syscap SystemCapability.Notification.Notification 1466 * @systemapi 1467 * @since 9 1468 */ 1469 function getDeviceRemindType(callback: AsyncCallback<DeviceRemindType>): void; 1470 1471 /** 1472 * Obtains the remind modes of the notification. 1473 * 1474 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1475 * @returns { Promise<DeviceRemindType> } Returns the RemindType. 1476 * @throws { BusinessError } 201 - Permission denied. 1477 * @throws { BusinessError } 202 - Not system application to call the interface. 1478 * @throws { BusinessError } 401 - The parameter check failed. 1479 * @throws { BusinessError } 1600001 - Internal error. 1480 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1481 * @throws { BusinessError } 1600003 - Failed to connect service. 1482 * @syscap SystemCapability.Notification.Notification 1483 * @systemapi 1484 * @since 9 1485 */ 1486 function getDeviceRemindType(): Promise<DeviceRemindType>; 1487 1488 /** 1489 * Set whether the application slot is enabled. 1490 * 1491 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1492 * @param { BundleOption } bundle - The bundle option. 1493 * @param { SlotType } type - Type of the notification slot. 1494 * @param { boolean } enable - Set enable or not. 1495 * @param { AsyncCallback<void> } callback - The callback of setNotificationEnableSlot. 1496 * @throws { BusinessError } 201 - Permission denied. 1497 * @throws { BusinessError } 202 - Not system application to call the interface. 1498 * @throws { BusinessError } 401 - The parameter check failed. 1499 * @throws { BusinessError } 1600001 - Internal error. 1500 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1501 * @throws { BusinessError } 1600003 - Failed to connect service. 1502 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1503 * @syscap SystemCapability.Notification.Notification 1504 * @systemapi 1505 * @since 9 1506 */ 1507 function setNotificationEnableSlot( 1508 bundle: BundleOption, 1509 type: SlotType, 1510 enable: boolean, 1511 callback: AsyncCallback<void> 1512 ): void; 1513 1514 /** 1515 * Set whether the application slot is enabled. 1516 * 1517 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1518 * @param { BundleOption } bundle - The bundle option. 1519 * @param { SlotType } type - Type of the notification slot. 1520 * @param { boolean } enable - Set enable or not. 1521 * @returns { Promise<void> } The promise returned by the function. 1522 * @throws { BusinessError } 201 - Permission denied. 1523 * @throws { BusinessError } 202 - Not system application to call the interface. 1524 * @throws { BusinessError } 401 - The parameter check failed. 1525 * @throws { BusinessError } 1600001 - Internal error. 1526 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1527 * @throws { BusinessError } 1600003 - Failed to connect service. 1528 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1529 * @syscap SystemCapability.Notification.Notification 1530 * @systemapi 1531 * @since 9 1532 */ 1533 function setNotificationEnableSlot(bundle: BundleOption, type: SlotType, enable: boolean): Promise<void>; 1534 1535 /** 1536 * Obtains whether the application slot is enabled. 1537 * 1538 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1539 * @param { BundleOption } bundle - The bundle option. 1540 * @param { SlotType } type - Type of the notification slot. 1541 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether the application slot is enabled. 1542 * @throws { BusinessError } 201 - Permission denied. 1543 * @throws { BusinessError } 202 - Not system application to call the interface. 1544 * @throws { BusinessError } 401 - The parameter check failed. 1545 * @throws { BusinessError } 1600001 - Internal error. 1546 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1547 * @throws { BusinessError } 1600003 - Failed to connect service. 1548 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1549 * @syscap SystemCapability.Notification.Notification 1550 * @systemapi 1551 * @since 9 1552 */ 1553 function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback<boolean>): void; 1554 1555 /** 1556 * Obtains whether the application slot is enabled. 1557 * 1558 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1559 * @param { BundleOption } bundle - The bundle option. 1560 * @param { SlotType } type - Type of the notification slot. 1561 * @returns { Promise<boolean> } Returns whether the application slot is enabled. 1562 * @throws { BusinessError } 201 - Permission denied. 1563 * @throws { BusinessError } 202 - Not system application to call the interface. 1564 * @throws { BusinessError } 401 - The parameter check failed. 1565 * @throws { BusinessError } 1600001 - Internal error. 1566 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1567 * @throws { BusinessError } 1600003 - Failed to connect service. 1568 * @throws { BusinessError } 17700001 - The specified bundle name was not found. 1569 * @syscap SystemCapability.Notification.Notification 1570 * @systemapi 1571 * @since 9 1572 */ 1573 function isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise<boolean>; 1574 1575 /** 1576 * Set whether to sync notifications to devices that do not have the app installed. 1577 * 1578 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1579 * @param { number } userId - The userId. 1580 * @param { boolean } enable - Set enable or not. 1581 * @param { AsyncCallback<void> } callback - The callback of setSyncNotificationEnabledWithoutApp. 1582 * @throws { BusinessError } 201 - Permission denied. 1583 * @throws { BusinessError } 202 - Not system application to call the interface. 1584 * @throws { BusinessError } 401 - The parameter check failed. 1585 * @throws { BusinessError } 1600001 - Internal error. 1586 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1587 * @throws { BusinessError } 1600003 - Failed to connect service. 1588 * @throws { BusinessError } 1600008 - The user is not exist. 1589 * @syscap SystemCapability.Notification.Notification 1590 * @systemapi 1591 * @since 9 1592 */ 1593 function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean, callback: AsyncCallback<void>): void; 1594 1595 /** 1596 * Set whether to sync notifications to devices that do not have the app installed. 1597 * 1598 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1599 * @param { number } userId - The userId. 1600 * @param { boolean } enable - Set enable or not. 1601 * @returns { Promise<void> } The promise returned by the function. 1602 * @throws { BusinessError } 201 - Permission denied. 1603 * @throws { BusinessError } 202 - Not system application to call the interface. 1604 * @throws { BusinessError } 401 - The parameter check failed. 1605 * @throws { BusinessError } 1600001 - Internal error. 1606 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1607 * @throws { BusinessError } 1600003 - Failed to connect service. 1608 * @throws { BusinessError } 1600008 - The user is not exist. 1609 * @syscap SystemCapability.Notification.Notification 1610 * @systemapi 1611 * @since 9 1612 */ 1613 function setSyncNotificationEnabledWithoutApp(userId: number, enable: boolean): Promise<void>; 1614 1615 /** 1616 * Obtains whether to sync notifications to devices that do not have the app installed. 1617 * 1618 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1619 * @param { number } userId - The userId. 1620 * @param { AsyncCallback<boolean> } callback - The callback is used to return whether to sync notifications to devices. 1621 * @throws { BusinessError } 201 - Permission denied. 1622 * @throws { BusinessError } 202 - Not system application to call the interface. 1623 * @throws { BusinessError } 401 - The parameter check failed. 1624 * @throws { BusinessError } 1600001 - Internal error. 1625 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1626 * @throws { BusinessError } 1600003 - Failed to connect service. 1627 * @throws { BusinessError } 1600008 - The user is not exist. 1628 * @syscap SystemCapability.Notification.Notification 1629 * @systemapi 1630 * @since 9 1631 */ 1632 function getSyncNotificationEnabledWithoutApp(userId: number, callback: AsyncCallback<boolean>): void; 1633 1634 /** 1635 * Obtains whether to sync notifications to devices that do not have the app installed. 1636 * 1637 * @permission ohos.permission.NOTIFICATION_CONTROLLER 1638 * @param { number } userId - The userId. 1639 * @returns { Promise<boolean> } Returns whether to sync notifications to devices. 1640 * @throws { BusinessError } 201 - Permission denied. 1641 * @throws { BusinessError } 202 - Not system application to call the interface. 1642 * @throws { BusinessError } 401 - The parameter check failed. 1643 * @throws { BusinessError } 1600001 - Internal error. 1644 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1645 * @throws { BusinessError } 1600003 - Failed to connect service. 1646 * @throws { BusinessError } 1600008 - The user is not exist. 1647 * @syscap SystemCapability.Notification.Notification 1648 * @systemapi 1649 * @since 9 1650 */ 1651 function getSyncNotificationEnabledWithoutApp(userId: number): Promise<boolean>; 1652 1653 /** 1654 * Set badge number. 1655 * 1656 * @param { number } badgeNumber - Badge number. 1657 * @param { AsyncCallback<void> } callback - callback - The callback of setBadgeNumber.. 1658 * @throws { BusinessError } 401 - The parameter check failed. 1659 * @throws { BusinessError } 1600001 - Internal error. 1660 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1661 * @throws { BusinessError } 1600003 - Failed to connect service. 1662 * @throws { BusinessError } 1600012 - No memory space. 1663 * @syscap SystemCapability.Notification.Notification 1664 * @since 10 1665 */ 1666 function setBadgeNumber(badgeNumber: number, callback: AsyncCallback<void>): void; 1667 1668 /** 1669 * Set badge number. 1670 * 1671 * @param { number } badgeNumber - Badge number. 1672 * @returns { Promise<void> } The promise returned by the function. 1673 * @throws { BusinessError } 401 - The parameter check failed. 1674 * @throws { BusinessError } 1600001 - Internal error. 1675 * @throws { BusinessError } 1600002 - Marshalling or unmarshalling error. 1676 * @throws { BusinessError } 1600003 - Failed to connect service. 1677 * @throws { BusinessError } 1600012 - No memory space. 1678 * @syscap SystemCapability.Notification.Notification 1679 * @since 10 1680 */ 1681 function setBadgeNumber(badgeNumber: number): Promise<void>; 1682 1683 /** 1684 * Subscribe the callback for check notifications. 1685 * 1686 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1687 * @param { 'checkNotification' } type - Type of the callback to listen for. 1688 * @param { function } callback - callback - The callback of check notifications. 1689 * @throws { BusinessError } 202 - Not system application. 1690 * @throws { BusinessError } 401 - The parameter check failed. 1691 * @throws { BusinessError } 1600001 - Internal error. 1692 * @syscap SystemCapability.Notification.Notification 1693 * @systemapi 1694 * @since 10 1695 */ 1696 function on(type: 'checkNotification', callback: (checkInfo: NotificationCheckInfo) => NotificationCheckResult): void; 1697 1698 /** 1699 * Unsubscribe the callback for check notifications. 1700 * 1701 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1702 * @param { 'checkNotification' } type - Type of the callback to listen for. 1703 * @param { function } [callback] - callback - The callback 1704 * of check notifications. 1705 * @throws { BusinessError } 202 - Not system application. 1706 * @throws { BusinessError } 401 - The parameter check failed. 1707 * @throws { BusinessError } 1600001 - Internal error. 1708 * @syscap SystemCapability.Notification.Notification 1709 * @systemapi 1710 * @since 10 1711 */ 1712 function off( 1713 type: 'checkNotification', 1714 callback?: (checkInfo: NotificationCheckInfo) => NotificationCheckResult 1715 ): void; 1716 1717 /** 1718 * Describes the parameters of check notifications. 1719 * 1720 * @typedef NotificationCheckInfo 1721 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1722 * @syscap SystemCapability.Notification.Notification 1723 * @systemapi 1724 * @since 10 1725 */ 1726 export interface NotificationCheckInfo { 1727 /** 1728 * The application bundle name for publishing notification. 1729 * 1730 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1731 * @type { string } 1732 * @syscap SystemCapability.Notification.Notification 1733 * @systemapi 1734 * @since 10 1735 */ 1736 bundleName: string; 1737 1738 /** 1739 * The notification id. 1740 * 1741 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1742 * @type { number } 1743 * @syscap SystemCapability.Notification.Notification 1744 * @systemapi 1745 * @since 10 1746 */ 1747 notificationId: number; 1748 1749 /** 1750 * The notification content type. 1751 * 1752 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1753 * @type { ContentType } 1754 * @syscap SystemCapability.Notification.Notification 1755 * @systemapi 1756 * @since 10 1757 */ 1758 contentType: ContentType; 1759 } 1760 1761 /** 1762 * Describes the result of check notifications. 1763 * 1764 * @typedef NotificationCheckResult 1765 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1766 * @syscap SystemCapability.Notification.Notification 1767 * @systemapi 1768 * @since 10 1769 */ 1770 export interface NotificationCheckResult { 1771 /** 1772 * The result code. 0-display, 1-no display 1773 * 1774 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1775 * @type { number } 1776 * @syscap SystemCapability.Notification.Notification 1777 * @systemapi 1778 * @since 10 1779 */ 1780 code: number; 1781 1782 /** 1783 * The result message. 1784 * 1785 * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER 1786 * @type { string } 1787 * @syscap SystemCapability.Notification.Notification 1788 * @systemapi 1789 * @since 10 1790 */ 1791 message: string; 1792 } 1793 1794 /** 1795 * Describes NotificationSlot types. 1796 * 1797 * @enum { number } 1798 * @syscap SystemCapability.Notification.Notification 1799 * @since 9 1800 */ 1801 export enum SlotType { 1802 /** 1803 * NotificationSlot of an unknown type. 1804 * 1805 * @syscap SystemCapability.Notification.Notification 1806 * @since 9 1807 */ 1808 UNKNOWN_TYPE = 0, 1809 1810 /** 1811 * NotificationSlot for social communication. 1812 * 1813 * @syscap SystemCapability.Notification.Notification 1814 * @since 9 1815 */ 1816 SOCIAL_COMMUNICATION = 1, 1817 1818 /** 1819 * NotificationSlot for service information. 1820 * 1821 * @syscap SystemCapability.Notification.Notification 1822 * @since 9 1823 */ 1824 SERVICE_INFORMATION = 2, 1825 1826 /** 1827 * NotificationSlot for content information. 1828 * 1829 * @syscap SystemCapability.Notification.Notification 1830 * @since 9 1831 */ 1832 CONTENT_INFORMATION = 3, 1833 1834 /** 1835 * NotificationSlot for other purposes. 1836 * 1837 * @syscap SystemCapability.Notification.Notification 1838 * @since 9 1839 */ 1840 OTHER_TYPES = 0xFFFF 1841 } 1842 1843 /** 1844 * Describes notification content types. 1845 * 1846 * @enum { number } 1847 * @syscap SystemCapability.Notification.Notification 1848 * @since 9 1849 */ 1850 export enum ContentType { 1851 /** 1852 * Normal text notification. 1853 * 1854 * @syscap SystemCapability.Notification.Notification 1855 * @since 9 1856 */ 1857 NOTIFICATION_CONTENT_BASIC_TEXT, 1858 1859 /** 1860 * Long text notification. 1861 * 1862 * @syscap SystemCapability.Notification.Notification 1863 * @since 9 1864 */ 1865 NOTIFICATION_CONTENT_LONG_TEXT, 1866 1867 /** 1868 * Picture-attached notification. 1869 * 1870 * @syscap SystemCapability.Notification.Notification 1871 * @since 9 1872 */ 1873 NOTIFICATION_CONTENT_PICTURE, 1874 1875 /** 1876 * Conversation notification. 1877 * 1878 * @syscap SystemCapability.Notification.Notification 1879 * @since 9 1880 */ 1881 NOTIFICATION_CONTENT_CONVERSATION, 1882 1883 /** 1884 * Multi-line text notification. 1885 * 1886 * @syscap SystemCapability.Notification.Notification 1887 * @since 9 1888 */ 1889 NOTIFICATION_CONTENT_MULTILINE 1890 } 1891 1892 /** 1893 * Indicates the level of the slot 1894 * 1895 * @enum { number } 1896 * @syscap SystemCapability.Notification.Notification 1897 * @since 9 1898 */ 1899 export enum SlotLevel { 1900 /** 1901 * Indicates that the notification function is disabled. 1902 * 1903 * @syscap SystemCapability.Notification.Notification 1904 * @since 9 1905 */ 1906 LEVEL_NONE = 0, 1907 1908 /** 1909 * Indicates that the notification function is enabled but notification 1910 * icons are not displayed in the status bar, with no banner or prompt tone. 1911 * 1912 * @syscap SystemCapability.Notification.Notification 1913 * @since 9 1914 */ 1915 LEVEL_MIN = 1, 1916 1917 /** 1918 * Indicates that the notification function is enabled and notification 1919 * icons are displayed in the status bar, with no banner or prompt tone. 1920 * 1921 * @syscap SystemCapability.Notification.Notification 1922 * @since 9 1923 */ 1924 LEVEL_LOW = 2, 1925 1926 /** 1927 * Indicates that the notification function is enabled and notification 1928 * icons are displayed in the status bar, with no banner but with a prompt tone. 1929 * 1930 * @syscap SystemCapability.Notification.Notification 1931 * @since 9 1932 */ 1933 LEVEL_DEFAULT = 3, 1934 1935 /** 1936 * Indicates that the notification function is enabled and notification 1937 * icons are displayed in the status bar, with a banner and a prompt tone. 1938 * 1939 * @syscap SystemCapability.Notification.Notification 1940 * @since 9 1941 */ 1942 LEVEL_HIGH = 4 1943 } 1944 1945 /** 1946 * The type of the Do Not Disturb. 1947 * 1948 * @enum { number } 1949 * @syscap SystemCapability.Notification.Notification 1950 * @systemapi 1951 * @since 9 1952 */ 1953 export enum DoNotDisturbType { 1954 /** 1955 * Non do not disturb type notification 1956 * 1957 * @syscap SystemCapability.Notification.Notification 1958 * @systemapi 1959 * @since 9 1960 */ 1961 TYPE_NONE = 0, 1962 1963 /** 1964 * Execute do not disturb once in the set time period (only watch hours and minutes) 1965 * 1966 * @syscap SystemCapability.Notification.Notification 1967 * @systemapi 1968 * @since 9 1969 */ 1970 TYPE_ONCE = 1, 1971 1972 /** 1973 * Execute do not disturb every day with a set time period (only watch hours and minutes) 1974 * 1975 * @syscap SystemCapability.Notification.Notification 1976 * @systemapi 1977 * @since 9 1978 */ 1979 TYPE_DAILY = 2, 1980 1981 /** 1982 * Execute in the set time period (specify the time, month, day and hour) 1983 * 1984 * @syscap SystemCapability.Notification.Notification 1985 * @systemapi 1986 * @since 9 1987 */ 1988 TYPE_CLEARLY = 3 1989 } 1990 1991 /** 1992 * Describes a DoNotDisturbDate instance. 1993 * 1994 * @typedef DoNotDisturbDate 1995 * @syscap SystemCapability.Notification.Notification 1996 * @systemapi 1997 * @since 9 1998 */ 1999 export interface DoNotDisturbDate { 2000 /** 2001 * the type of the Do Not Disturb. 2002 * 2003 * @type { DoNotDisturbType } 2004 * @syscap SystemCapability.Notification.Notification 2005 * @systemapi 2006 * @since 9 2007 */ 2008 type: DoNotDisturbType; 2009 2010 /** 2011 * The start time of the Do Not Disturb. 2012 * 2013 * @type { Date } 2014 * @syscap SystemCapability.Notification.Notification 2015 * @systemapi 2016 * @since 9 2017 */ 2018 begin: Date; 2019 2020 /** 2021 * The end time of the Do Not Disturb. 2022 * 2023 * @type { Date } 2024 * @syscap SystemCapability.Notification.Notification 2025 * @systemapi 2026 * @since 9 2027 */ 2028 end: Date; 2029 } 2030 2031 /** 2032 * The remind type of the notification. 2033 * 2034 * @enum { number } 2035 * @syscap SystemCapability.Notification.Notification 2036 * @systemapi 2037 * @since 9 2038 */ 2039 export enum DeviceRemindType { 2040 /** 2041 * The device is not in use, no reminder 2042 * 2043 * @syscap SystemCapability.Notification.Notification 2044 * @systemapi 2045 * @since 9 2046 */ 2047 IDLE_DONOT_REMIND = 0, 2048 2049 /** 2050 * The device is not in use, remind 2051 * 2052 * @syscap SystemCapability.Notification.Notification 2053 * @systemapi 2054 * @since 9 2055 */ 2056 IDLE_REMIND = 1, 2057 2058 /** 2059 * The device is in use, no reminder 2060 * 2061 * @syscap SystemCapability.Notification.Notification 2062 * @systemapi 2063 * @since 9 2064 */ 2065 ACTIVE_DONOT_REMIND = 2, 2066 2067 /** 2068 * The device is in use, reminder 2069 * 2070 * @syscap SystemCapability.Notification.Notification 2071 * @systemapi 2072 * @since 9 2073 */ 2074 ACTIVE_REMIND = 3 2075 } 2076 2077 /** 2078 * Notification source type 2079 * 2080 * @enum { number } 2081 * @syscap SystemCapability.Notification.Notification 2082 * @systemapi 2083 * @since 9 2084 */ 2085 export enum SourceType { 2086 /** 2087 * General notification 2088 * 2089 * @syscap SystemCapability.Notification.Notification 2090 * @systemapi 2091 * @since 9 2092 */ 2093 TYPE_NORMAL = 0, 2094 2095 /** 2096 * Continuous notification 2097 * 2098 * @syscap SystemCapability.Notification.Notification 2099 * @systemapi 2100 * @since 9 2101 */ 2102 TYPE_CONTINUOUS = 1, 2103 2104 /** 2105 * Scheduled notification 2106 * 2107 * @syscap SystemCapability.Notification.Notification 2108 * @systemapi 2109 * @since 9 2110 */ 2111 TYPE_TIMER = 2 2112 } 2113 2114 /** 2115 * Describes a bundleOption in a notification. 2116 * 2117 * @syscap SystemCapability.Notification.Notification 2118 * @since 9 2119 */ 2120 export type BundleOption = _BundleOption; 2121 2122 /** 2123 * Describes an action button displayed in a notification. 2124 * 2125 * @syscap SystemCapability.Notification.Notification 2126 * @since 9 2127 */ 2128 export type NotificationActionButton = _NotificationActionButton; 2129 2130 /** 2131 * Describes a normal text notification. 2132 * 2133 * @syscap SystemCapability.Notification.Notification 2134 * @since 9 2135 */ 2136 export type NotificationBasicContent = _NotificationBasicContent; 2137 2138 /** 2139 * Describes notification types. 2140 * 2141 * @syscap SystemCapability.Notification.Notification 2142 * @since 9 2143 */ 2144 export type NotificationContent = _NotificationContent; 2145 2146 /** 2147 * Describes a long text notification. 2148 * 2149 * @syscap SystemCapability.Notification.Notification 2150 * @since 9 2151 */ 2152 export type NotificationLongTextContent = _NotificationLongTextContent; 2153 2154 /** 2155 * Describes a multi-line text notification. 2156 * 2157 * @syscap SystemCapability.Notification.Notification 2158 * @since 9 2159 */ 2160 export type NotificationMultiLineContent = _NotificationMultiLineContent; 2161 2162 /** 2163 * Describes a picture-attached notification. 2164 * 2165 * @syscap SystemCapability.Notification.Notification 2166 * @since 9 2167 */ 2168 export type NotificationPictureContent = _NotificationPictureContent; 2169 2170 /** 2171 * Describes a NotificationFlags instance. 2172 * 2173 * @syscap SystemCapability.Notification.Notification 2174 * @systemapi 2175 * @since 9 2176 */ 2177 export type NotificationFlags = _NotificationFlags; 2178 2179 /** 2180 * The status of the notification flag. 2181 * 2182 * @syscap SystemCapability.Notification.Notification 2183 * @systemapi 2184 * @since 9 2185 */ 2186 export type NotificationFlagStatus = _NotificationFlagStatus; 2187 2188 /** 2189 * Defines a NotificationRequest instance. 2190 * 2191 * @syscap SystemCapability.Notification.Notification 2192 * @since 9 2193 */ 2194 export type NotificationRequest = _NotificationRequest; 2195 2196 /** 2197 * Describes distributed options. 2198 * 2199 * @syscap SystemCapability.Notification.Notification 2200 * @since 9 2201 */ 2202 export type DistributedOptions = _DistributedOptions; 2203 2204 /** 2205 * Describes a NotificationSlot instance. 2206 * 2207 * @syscap SystemCapability.Notification.Notification 2208 * @since 9 2209 */ 2210 export type NotificationSlot = _NotificationSlot; 2211 2212 /** 2213 * Provides sorting information about an active notification. 2214 * 2215 * @syscap SystemCapability.Notification.Notification 2216 * @systemapi 2217 * @since 9 2218 */ 2219 export type NotificationSorting = _NotificationSorting; 2220 2221 /** 2222 * Describes a NotificationTemplate instance. 2223 * 2224 * @syscap SystemCapability.Notification.Notification 2225 * @since 9 2226 */ 2227 export type NotificationTemplate = _NotificationTemplate; 2228 2229 /** 2230 * Describes a NotificationUserInput instance. 2231 * 2232 * @syscap SystemCapability.Notification.Notification 2233 * @since 9 2234 */ 2235 export type NotificationUserInput = _NotificationUserInput; 2236} 2237 2238export default notificationManager; 2239