1/* 2 * Copyright (c) 2021-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 16/** 17 * @file The subscriber of common event 18 * @kit BasicServicesKit 19 */ 20 21/*** if arkts 1.1 */ 22import { AsyncCallback } from './../@ohos.base'; 23import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; 24/*** endif */ 25/*** if arkts 1.2 */ 26import { AsyncCallback } from './../@ohos.base'; 27import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; 28/*** endif */ 29 30/** 31 * The CommonEventSubscriber module provides APIs for describing the common event subscriber. 32 * 33 * @interface CommonEventSubscriber 34 * @syscap SystemCapability.Notification.CommonEvent 35 * @since 7 36 */ 37/** 38 * The CommonEventSubscriber module provides APIs for describing the common event subscriber. 39 * 40 * @interface CommonEventSubscriber 41 * @syscap SystemCapability.Notification.CommonEvent 42 * @atomicservice 43 * @since arkts {'1.1':'11', '1.2':'20'} 44 * @arkts 1.1&1.2 45 */ 46export interface CommonEventSubscriber { 47 /** 48 * Obtains the result code of an ordered common event. This API uses an asynchronous callback to return the result. 49 * 50 * @param { AsyncCallback<number> } callback - Callback used to return the result. 51 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 52 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 53 * @syscap SystemCapability.Notification.CommonEvent 54 * @since 7 55 */ 56 /** 57 * Obtains the result code of an ordered common event. This API uses an asynchronous callback to return the result. 58 * 59 * @param { AsyncCallback<number> } callback - Callback used to return the result. 60 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 61 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 62 * @syscap SystemCapability.Notification.CommonEvent 63 * @atomicservice 64 * @since arkts {'1.1':'11', '1.2':'20'} 65 * @arkts 1.1&1.2 66 */ 67 getCode(callback: AsyncCallback<number>): void; 68 69 /** 70 * Obtains the result code of an ordered common event. This API uses a promise to return the result. 71 * 72 * @returns { Promise<number> } Promise used to return the result. 73 * @syscap SystemCapability.Notification.CommonEvent 74 * @since 7 75 */ 76 /** 77 * Obtains the result code of an ordered common event. This API uses a promise to return the result. 78 * 79 * @returns { Promise<number> } Promise used to return the result. 80 * @syscap SystemCapability.Notification.CommonEvent 81 * @atomicservice 82 * @since arkts {'1.1':'11', '1.2':'20'} 83 * @arkts 1.1&1.2 84 */ 85 getCode(): Promise<number>; 86 87 /** 88 * Obtains the result code of an ordered common event. 89 * 90 * @returns { number } Common event code. 91 * @syscap SystemCapability.Notification.CommonEvent 92 * @since 10 93 */ 94 /** 95 * Obtains the result code of an ordered common event. 96 * 97 * @returns { number } Common event code. 98 * @syscap SystemCapability.Notification.CommonEvent 99 * @atomicservice 100 * @since arkts {'1.1':'11', '1.2':'20'} 101 * @arkts 1.1&1.2 102 */ 103 getCodeSync(): number; 104 105 /** 106 * Sets the result code of an ordered common event. This API uses an asynchronous callback to return the result. 107 * 108 * @param { number } code - Common event code. 109 * @param { AsyncCallback<void> } callback - Callback used to return the result. 110 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 111 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 112 * @syscap SystemCapability.Notification.CommonEvent 113 * @since 7 114 */ 115 /** 116 * Sets the result code of an ordered common event. This API uses an asynchronous callback to return the result. 117 * 118 * @param { number } code - Common event code. 119 * @param { AsyncCallback<void> } callback - Callback used to return the result. 120 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 121 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 122 * @syscap SystemCapability.Notification.CommonEvent 123 * @atomicservice 124 * @since arkts {'1.1':'11', '1.2':'20'} 125 * @arkts 1.1&1.2 126 */ 127 setCode(code: number, callback: AsyncCallback<void>): void; 128 129 /** 130 * Sets the result code of an ordered common event. This API uses a promise to return the result. 131 * 132 * @param { number } code - Common event code. 133 * @returns { Promise<void> } Promise that returns no value. 134 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 135 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 136 * @syscap SystemCapability.Notification.CommonEvent 137 * @since 7 138 */ 139 /** 140 * Sets the result code of an ordered common event. This API uses a promise to return the result. 141 * 142 * @param { number } code - Common event code. 143 * @returns { Promise<void> } Promise that returns no value. 144 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 145 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 146 * @syscap SystemCapability.Notification.CommonEvent 147 * @atomicservice 148 * @since arkts {'1.1':'11', '1.2':'20'} 149 * @arkts 1.1&1.2 150 */ 151 setCode(code: number): Promise<void>; 152 153 /** 154 * Sets the result code of an ordered common event. 155 * 156 * @param { number } code - Common event code. 157 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 158 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 159 * @syscap SystemCapability.Notification.CommonEvent 160 * @since 10 161 */ 162 /** 163 * Sets the result code of an ordered common event. 164 * 165 * @param { number } code - Common event code. 166 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 167 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 168 * @syscap SystemCapability.Notification.CommonEvent 169 * @atomicservice 170 * @since arkts {'1.1':'11', '1.2':'20'} 171 * @arkts 1.1&1.2 172 */ 173 setCodeSync(code: number): void; 174 175 /** 176 * Obtains the result data of an ordered common event. This API uses an asynchronous callback to return the result. 177 * 178 * @param { AsyncCallback<string> } callback - Callback used to return the result. 179 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 180 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 181 * @syscap SystemCapability.Notification.CommonEvent 182 * @since 7 183 */ 184 /** 185 * Obtains the result data of an ordered common event. This API uses an asynchronous callback to return the result. 186 * 187 * @param { AsyncCallback<string> } callback - Callback used to return the result. 188 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 189 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 190 * @syscap SystemCapability.Notification.CommonEvent 191 * @atomicservice 192 * @since arkts {'1.1':'11', '1.2':'20'} 193 * @arkts 1.1&1.2 194 */ 195 getData(callback: AsyncCallback<string>): void; 196 197 /** 198 * Obtains the result data of an ordered common event. This API uses a promise to return the result. 199 * 200 * @returns { Promise<string> } Promise used to return the result. 201 * @syscap SystemCapability.Notification.CommonEvent 202 * @since 7 203 */ 204 /** 205 * Obtains the result data of an ordered common event. This API uses a promise to return the result. 206 * 207 * @returns { Promise<string> } Promise used to return the result. 208 * @syscap SystemCapability.Notification.CommonEvent 209 * @atomicservice 210 * @since arkts {'1.1':'11', '1.2':'20'} 211 * @arkts 1.1&1.2 212 */ 213 getData(): Promise<string>; 214 215 /** 216 * Obtains the result data of an ordered common event. 217 * 218 * @returns { string } Common event data. 219 * @syscap SystemCapability.Notification.CommonEvent 220 * @since 10 221 */ 222 /** 223 * Obtains the result data of an ordered common event. 224 * 225 * @returns { string } Common event data. 226 * @syscap SystemCapability.Notification.CommonEvent 227 * @atomicservice 228 * @since arkts {'1.1':'11', '1.2':'20'} 229 * @arkts 1.1&1.2 230 */ 231 getDataSync(): string; 232 233 /** 234 * Sets the result data for an ordered common event. This API uses an asynchronous callback to return the result. 235 * 236 * @param { string } data - Common event data. 237 * @param { AsyncCallback<void> } callback - Callback used to return the result. 238 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 239 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 240 * @syscap SystemCapability.Notification.CommonEvent 241 * @since 7 242 */ 243 /** 244 * Sets the result data for an ordered common event. This API uses an asynchronous callback to return the result. 245 * 246 * @param { string } data - Common event data. 247 * @param { AsyncCallback<void> } callback - Callback used to return the result. 248 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 249 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 250 * @syscap SystemCapability.Notification.CommonEvent 251 * @atomicservice 252 * @since arkts {'1.1':'11', '1.2':'20'} 253 * @arkts 1.1&1.2 254 */ 255 setData(data: string, callback: AsyncCallback<void>): void; 256 257 /** 258 * Sets the result data for an ordered common event. This API uses a promise to return the result. 259 * 260 * @param { string } data - Common event data. 261 * @returns { Promise<void> } Promise that returns no value. 262 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 263 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 264 * @syscap SystemCapability.Notification.CommonEvent 265 * @since 7 266 */ 267 /** 268 * Sets the result data for an ordered common event. This API uses a promise to return the result. 269 * 270 * @param { string } data - Common event data. 271 * @returns { Promise<void> } Promise that returns no value. 272 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 273 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 274 * @syscap SystemCapability.Notification.CommonEvent 275 * @atomicservice 276 * @since arkts {'1.1':'11', '1.2':'20'} 277 * @arkts 1.1&1.2 278 */ 279 setData(data: string): Promise<void>; 280 281 /** 282 * Sets the result data for an ordered common event. 283 * 284 * @param { string } data - Common event data. 285 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 286 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 287 * @syscap SystemCapability.Notification.CommonEvent 288 * @since 10 289 */ 290 /** 291 * Sets the result data for an ordered common event. 292 * 293 * @param { string } data - Common event data. 294 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 295 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 296 * @syscap SystemCapability.Notification.CommonEvent 297 * @atomicservice 298 * @since arkts {'1.1':'11', '1.2':'20'} 299 * @arkts 1.1&1.2 300 */ 301 setDataSync(data: string): void; 302 303 /** 304 * Sets the result code and data of an ordered common event. This API uses an asynchronous callback to return the result. 305 * 306 * @param { number } code - Common event code. 307 * @param { string } data - Common event data. 308 * @param { AsyncCallback<void> } callback - Callback used to return the result. 309 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 310 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 311 * @syscap SystemCapability.Notification.CommonEvent 312 * @since 7 313 */ 314 /** 315 * Sets the result code and data of an ordered common event. This API uses an asynchronous callback to return the result. 316 * 317 * @param { number } code - Common event code. 318 * @param { string } data - Common event data. 319 * @param { AsyncCallback<void> } callback - Callback used to return the result. 320 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 321 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 322 * @syscap SystemCapability.Notification.CommonEvent 323 * @atomicservice 324 * @since arkts {'1.1':'11', '1.2':'20'} 325 * @arkts 1.1&1.2 326 */ 327 setCodeAndData(code: number, data: string, callback: AsyncCallback<void>): void; 328 329 /** 330 * Sets the result code and data of an ordered common event. This API uses a promise to return the result. 331 * 332 * @param { number } code - Common event code. 333 * @param { string } data - Common event data. 334 * @returns { Promise<void> } The promise returned by the function. 335 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 336 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 337 * @syscap SystemCapability.Notification.CommonEvent 338 * @since 7 339 */ 340 /** 341 * Sets the result code and data of an ordered common event. This API uses a promise to return the result. 342 * 343 * @param { number } code - Common event code. 344 * @param { string } data - Common event data. 345 * @returns { Promise<void> } The promise returned by the function. 346 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 347 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 348 * @syscap SystemCapability.Notification.CommonEvent 349 * @atomicservice 350 * @since arkts {'1.1':'11', '1.2':'20'} 351 * @arkts 1.1&1.2 352 */ 353 setCodeAndData(code: number, data: string): Promise<void>; 354 355 /** 356 * Sets the result code and data of an ordered common event. 357 * 358 * @param { number } code - Common event code. 359 * @param { string } data - Common event data. 360 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 361 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 362 * @syscap SystemCapability.Notification.CommonEvent 363 * @since 10 364 */ 365 /** 366 * Sets the result code and data of an ordered common event. 367 * 368 * @param { number } code - Common event code. 369 * @param { string } data - Common event data. 370 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 371 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 372 * @syscap SystemCapability.Notification.CommonEvent 373 * @atomicservice 374 * @since arkts {'1.1':'11', '1.2':'20'} 375 * @arkts 1.1&1.2 376 */ 377 setCodeAndDataSync(code: number, data: string): void; 378 379 /** 380 * Checks whether the current common event is an ordered common event. This API uses an asynchronous callback to return the result. 381 * 382 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. Returns true if the common event is an ordered one; 383 * returns false otherwise. 384 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 385 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 386 * @syscap SystemCapability.Notification.CommonEvent 387 * @since arkts {'1.1':'7', '1.2':'20'} 388 * @arkts 1.1&1.2 389 */ 390 isOrderedCommonEvent(callback: AsyncCallback<boolean>): void; 391 392 /** 393 * Checks whether the current common event is an ordered common event. This API uses a promise to return the result. 394 * 395 * @returns { Promise<boolean> } Promise used to return the result. Returns true if the common event is an ordered one; returns false otherwise. 396 * @syscap SystemCapability.Notification.CommonEvent 397 * @since arkts {'1.1':'7', '1.2':'20'} 398 * @arkts 1.1&1.2 399 */ 400 isOrderedCommonEvent(): Promise<boolean>; 401 402 /** 403 * Checks whether the current common event is an ordered common event. 404 * 405 * @returns { boolean } Returns true if the common event is an ordered one; returns false otherwise. 406 * @syscap SystemCapability.Notification.CommonEvent 407 * @since arkts {'1.1':'10', '1.2':'20'} 408 * @arkts 1.1&1.2 409 */ 410 isOrderedCommonEventSync(): boolean; 411 412 /** 413 * Checks whether a common event is a sticky one. This API uses an asynchronous callback to return the result. 414 * 415 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. Returns true if the common event is a sticky one; returns false otherwise. 416 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 417 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 418 * @syscap SystemCapability.Notification.CommonEvent 419 * @since arkts {'1.1':'7', '1.2':'20'} 420 * @arkts 1.1&1.2 421 */ 422 isStickyCommonEvent(callback: AsyncCallback<boolean>): void; 423 424 /** 425 * Checks whether a common event is a sticky one. This API uses a promise to return the result. 426 * 427 * @returns { Promise<boolean> } Promise used to return the result. Returns true if the common event is a sticky one; returns false otherwise. 428 * @syscap SystemCapability.Notification.CommonEvent 429 * @since arkts {'1.1':'7', '1.2':'20'} 430 * @arkts 1.1&1.2 431 */ 432 isStickyCommonEvent(): Promise<boolean>; 433 434 /** 435 * Checks whether a common event is a sticky one. 436 * 437 * @returns { boolean } Returns true if the common event is a sticky one; returns false otherwise. 438 * @syscap SystemCapability.Notification.CommonEvent 439 * @since arkts {'1.1':'10', '1.2':'20'} 440 * @arkts 1.1&1.2 441 */ 442 isStickyCommonEventSync(): boolean; 443 444 /** 445 * Aborts an ordered common event when used with finishCommonEvent. After the abort, the common event is not sent to the 446 * next subscriber. This API uses an asynchronous callback to return the result. 447 * 448 * @param { AsyncCallback<void> } callback - Callback used to return the result. 449 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 450 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 451 * @syscap SystemCapability.Notification.CommonEvent 452 * @since arkts {'1.1':'7', '1.2':'20'} 453 * @arkts 1.1&1.2 454 */ 455 abortCommonEvent(callback: AsyncCallback<void>): void; 456 457 /** 458 * Aborts an ordered common event when used with finishCommonEvent. After the abort, the common event is not sent to the 459 * next subscriber. This API uses a promise to return the result. 460 * 461 * @returns { Promise<void> } Promise that returns no value. 462 * @syscap SystemCapability.Notification.CommonEvent 463 * @since arkts {'1.1':'7', '1.2':'20'} 464 * @arkts 1.1&1.2 465 */ 466 abortCommonEvent(): Promise<void>; 467 468 /** 469 * Aborts an ordered common event when used with finishCommonEvent. After the abort, the common event is not sent to the next subscriber. 470 * 471 * @syscap SystemCapability.Notification.CommonEvent 472 * @since arkts {'1.1':'10', '1.2':'20'} 473 * @arkts 1.1&1.2 474 */ 475 abortCommonEventSync(): void; 476 477 /** 478 * Clears the aborted state of an ordered common event when used with finishCommonEvent. 479 * After the clearance, the common event is sent to the next subscriber. This API uses an asynchronous callback to return the result. 480 * 481 * @param { AsyncCallback<void> } callback - Callback used to return the result. 482 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 483 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 484 * @syscap SystemCapability.Notification.CommonEvent 485 * @since arkts {'1.1':'7', '1.2':'20'} 486 * @arkts 1.1&1.2 487 */ 488 clearAbortCommonEvent(callback: AsyncCallback<void>): void; 489 490 /** 491 * Clears the aborted state of an ordered common event when used with finishCommonEvent. 492 * After the clearance, the common event is sent to the next subscriber. This API uses a promise to return the result. 493 * 494 * @returns { Promise<void> } Promise that returns no value. 495 * @syscap SystemCapability.Notification.CommonEvent 496 * @since arkts {'1.1':'7', '1.2':'20'} 497 * @arkts 1.1&1.2 498 */ 499 clearAbortCommonEvent(): Promise<void>; 500 501 /** 502 * Clears the aborted state of an ordered common event when used with finishCommonEvent.After the clearance, the common event is sent to the next subscriber. 503 * 504 * @syscap SystemCapability.Notification.CommonEvent 505 * @since arkts {'1.1':'10', '1.2':'20'} 506 * @arkts 1.1&1.2 507 */ 508 clearAbortCommonEventSync(): void; 509 510 /** 511 * Checks whether this ordered common event should be aborted. This API uses an asynchronous callback to return the result. 512 * 513 * @param { AsyncCallback<boolean> } callback - Callback used to return the result. Returns true if the ordered common event 514 * is in the aborted state; returns false otherwise. 515 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 516 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 517 * @syscap SystemCapability.Notification.CommonEvent 518 * @since arkts {'1.1':'7', '1.2':'20'} 519 * @arkts 1.1&1.2 520 */ 521 getAbortCommonEvent(callback: AsyncCallback<boolean>): void; 522 523 /** 524 * Checks whether this ordered common event should be aborted. This API uses a promise to return the result. 525 * 526 * @returns { Promise<boolean> } Checks whether this ordered common event should be aborted. This API uses a promise to return the result. 527 * @syscap SystemCapability.Notification.CommonEvent 528 * @since arkts {'1.1':'7', '1.2':'20'} 529 * @arkts 1.1&1.2 530 */ 531 getAbortCommonEvent(): Promise<boolean>; 532 533 /** 534 * Checks whether this ordered common event should be aborted. 535 * 536 * @returns { boolean } Returns true if the ordered common event is in the aborted state; returns false otherwise. 537 * @syscap SystemCapability.Notification.CommonEvent 538 * @since arkts {'1.1':'10', '1.2':'20'} 539 * @arkts 1.1&1.2 540 */ 541 getAbortCommonEventSync(): boolean; 542 543 /** 544 * Obtains the subscriber information. This API uses an asynchronous callback to return the result. 545 * 546 * @param { AsyncCallback<CommonEventSubscribeInfo> } callback - Callback used to return the result. 547 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 548 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 549 * @syscap SystemCapability.Notification.CommonEvent 550 * @since 7 551 */ 552 /** 553 * Obtains the subscriber information. This API uses an asynchronous callback to return the result. 554 * 555 * @param { AsyncCallback<CommonEventSubscribeInfo> } callback - Callback used to return the result. 556 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 557 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 558 * @syscap SystemCapability.Notification.CommonEvent 559 * @crossplatform 560 * @atomicservice 561 * @since arkts {'1.1':'11', '1.2':'20'} 562 * @arkts 1.1&1.2 563 */ 564 getSubscribeInfo(callback: AsyncCallback<CommonEventSubscribeInfo>): void; 565 566 /** 567 * Obtains the subscriber information. This API uses a promise to return the result. 568 * 569 * @returns { Promise<CommonEventSubscribeInfo> } Promise used to return the result. 570 * @syscap SystemCapability.Notification.CommonEvent 571 * @since 7 572 */ 573 /** 574 * Obtains the subscriber information. This API uses a promise to return the result. 575 * 576 * @returns { Promise<CommonEventSubscribeInfo> } Promise used to return the result. 577 * @syscap SystemCapability.Notification.CommonEvent 578 * @crossplatform 579 * @atomicservice 580 * @since arkts {'1.1':'11', '1.2':'20'} 581 * @arkts 1.1&1.2 582 */ 583 getSubscribeInfo(): Promise<CommonEventSubscribeInfo>; 584 585 /** 586 * Obtains the subscriber information. 587 * 588 * @returns { CommonEventSubscribeInfo } Subscriber information. 589 * @syscap SystemCapability.Notification.CommonEvent 590 * @since 10 591 */ 592 /** 593 * Obtains the subscriber information. 594 * 595 * @returns { CommonEventSubscribeInfo } Subscriber information. 596 * @syscap SystemCapability.Notification.CommonEvent 597 * @atomicservice 598 * @since arkts {'1.1':'11', '1.2':'20'} 599 * @arkts 1.1&1.2 600 */ 601 getSubscribeInfoSync(): CommonEventSubscribeInfo; 602 603 /** 604 * Finishes this ordered common event. This API uses an asynchronous callback to return the result. 605 * 606 * @param { AsyncCallback<void> } callback - Callback used to return the result. 607 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 608 * <br>2. Incorrect parameter types. 3. Parameter verification failed. 609 * @syscap SystemCapability.Notification.CommonEvent 610 * @since arkts {'1.1':'9', '1.2':'20'} 611 * @arkts 1.1&1.2 612 */ 613 finishCommonEvent(callback: AsyncCallback<void>): void; 614 615 /** 616 * Finishes this ordered common event. This API uses a promise to return the result. 617 * 618 * @returns { Promise<void> } Promise that returns no value. 619 * @syscap SystemCapability.Notification.CommonEvent 620 * @since arkts {'1.1':'9', '1.2':'20'} 621 * @arkts 1.1&1.2 622 */ 623 finishCommonEvent(): Promise<void>; 624} 625