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 18 */ 19 20import { AsyncCallback, Callback } from './@ohos.base'; 21import Want from './@ohos.app.ability.Want'; 22import { WantAgentInfo } from './wantAgent/wantAgentInfo'; 23import { TriggerInfo } from './wantAgent/triggerInfo'; 24 25/** 26 * Provide the method obtain trigger, cancel, and compare and to obtain 27 * the bundle name, UID of an {@link WantAgent} object. 28 * 29 * @namespace wantAgent 30 * @syscap SystemCapability.Ability.AbilityRuntime.Core 31 * @since 7 32 * @deprecated since 9 33 * @useinstead ohos.app.ability.wantAgent/wantAgent 34 */ 35/** 36 * Provide the method obtain trigger, cancel, and compare and to obtain 37 * the bundle name, UID of an {@link WantAgent} object. 38 * 39 * @namespace wantAgent 40 * @syscap SystemCapability.Ability.AbilityRuntime.Core 41 * @atomicservice 42 * @since 12 43 * @deprecated since 9 44 * @useinstead ohos.app.ability.wantAgent/wantAgent 45 */ 46declare namespace wantAgent { 47 /** 48 * Obtains the bundle name of a WantAgent. 49 * 50 * @param { WantAgent } agent - whose bundle name to obtain. 51 * @param { AsyncCallback<string> } callback - A callback method to obtain the package name of the WantAgent instance. 52 * @syscap SystemCapability.Ability.AbilityRuntime.Core 53 * @since 7 54 * @deprecated since 9 55 * @useinstead ohos.app.ability.wantAgent/wantAgent#getBundleName 56 */ 57 /** 58 * Obtains the bundle name of a WantAgent. 59 * 60 * @param { WantAgent } agent - whose bundle name to obtain. 61 * @param { AsyncCallback<string> } callback - A callback method to obtain the package name of the WantAgent instance. 62 * @syscap SystemCapability.Ability.AbilityRuntime.Core 63 * @atomicservice 64 * @since 12 65 * @deprecated since 9 66 * @useinstead ohos.app.ability.wantAgent/wantAgent#getBundleName 67 */ 68 function getBundleName(agent: WantAgent, callback: AsyncCallback<string>): void; 69 70 /** 71 * Obtains the bundle name of a WantAgent. 72 * 73 * @param { WantAgent } agent - whose bundle name to obtain. 74 * @returns { Promise<string> } Returns the bundle name of the {@link WantAgent} if any. 75 * @syscap SystemCapability.Ability.AbilityRuntime.Core 76 * @since 7 77 * @deprecated since 9 78 * @useinstead ohos.app.ability.wantAgent/wantAgent#getBundleName 79 */ 80 /** 81 * Obtains the bundle name of a WantAgent. 82 * 83 * @param { WantAgent } agent - whose bundle name to obtain. 84 * @returns { Promise<string> } Returns the bundle name of the {@link WantAgent} if any. 85 * @syscap SystemCapability.Ability.AbilityRuntime.Core 86 * @atomicservice 87 * @since 12 88 * @deprecated since 9 89 * @useinstead ohos.app.ability.wantAgent/wantAgent#getBundleName 90 */ 91 function getBundleName(agent: WantAgent): Promise<string>; 92 93 /** 94 * Obtains the UID of a WantAgent. 95 * 96 * @param { WantAgent } agent - whose UID to obtain. 97 * @param { AsyncCallback<number> } callback - Create a callback method for WantAgent. 98 * @syscap SystemCapability.Ability.AbilityRuntime.Core 99 * @since 7 100 * @deprecated since 9 101 * @useinstead ohos.app.ability.wantAgent/wantAgent#getUid 102 */ 103 /** 104 * Obtains the UID of a WantAgent. 105 * 106 * @param { WantAgent } agent - whose UID to obtain. 107 * @param { AsyncCallback<number> } callback - Create a callback method for WantAgent. 108 * @syscap SystemCapability.Ability.AbilityRuntime.Core 109 * @atomicservice 110 * @since 12 111 * @deprecated since 9 112 * @useinstead ohos.app.ability.wantAgent/wantAgent#getUid 113 */ 114 function getUid(agent: WantAgent, callback: AsyncCallback<number>): void; 115 116 /** 117 * Obtains the UID of a WantAgent. 118 * 119 * @param { WantAgent } agent - whose UID to obtain. 120 * @returns { Promise<number> } Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. 121 * @syscap SystemCapability.Ability.AbilityRuntime.Core 122 * @since 7 123 * @deprecated since 9 124 * @useinstead ohos.app.ability.wantAgent/wantAgent#getUid 125 */ 126 /** 127 * Obtains the UID of a WantAgent. 128 * 129 * @param { WantAgent } agent - whose UID to obtain. 130 * @returns { Promise<number> } Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. 131 * @syscap SystemCapability.Ability.AbilityRuntime.Core 132 * @atomicservice 133 * @since 12 134 * @deprecated since 9 135 * @useinstead ohos.app.ability.wantAgent/wantAgent#getUid 136 */ 137 function getUid(agent: WantAgent): Promise<number>; 138 139 /** 140 * Obtains the {@link Want} of an {@link WantAgent}. 141 * 142 * @param { WantAgent } agent - Indicates the {@link WantAgent} whose UID is to be obtained. 143 * @param { AsyncCallback<Want> } callback - Obtain the callback method for Want in WantAgent. 144 * @syscap SystemCapability.Ability.AbilityRuntime.Core 145 * @systemapi 146 * @since 7 147 * @deprecated since 9 148 * @useinstead ohos.app.ability.wantAgent/wantAgent#getWant 149 */ 150 function getWant(agent: WantAgent, callback: AsyncCallback<Want>): void; 151 152 /** 153 * Obtains the {@link Want} of an {@link WantAgent}. 154 * 155 * @param { WantAgent } agent - Indicates the {@link WantAgent} whose UID is to be obtained. 156 * @returns { Promise<Want> } Returns the {@link Want} of the {@link WantAgent}. 157 * @syscap SystemCapability.Ability.AbilityRuntime.Core 158 * @systemapi 159 * @since 7 160 * @deprecated since 9 161 * @useinstead ohos.app.ability.wantAgent/wantAgent#getWant 162 */ 163 function getWant(agent: WantAgent): Promise<Want>; 164 165 /** 166 * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. 167 * 168 * @param { WantAgent } agent - to cancel. 169 * @param { AsyncCallback<void> } callback - Cancel the callback method for Want in WantAgent. 170 * @syscap SystemCapability.Ability.AbilityRuntime.Core 171 * @since 7 172 * @deprecated since 9 173 * @useinstead ohos.app.ability.wantAgent/wantAgent#cancel 174 */ 175 /** 176 * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. 177 * 178 * @param { WantAgent } agent - to cancel. 179 * @param { AsyncCallback<void> } callback - Cancel the callback method for Want in WantAgent. 180 * @syscap SystemCapability.Ability.AbilityRuntime.Core 181 * @atomicservice 182 * @since 12 183 * @deprecated since 9 184 * @useinstead ohos.app.ability.wantAgent/wantAgent#cancel 185 */ 186 function cancel(agent: WantAgent, callback: AsyncCallback<void>): void; 187 188 /** 189 * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. 190 * 191 * @param { WantAgent } agent - to cancel. 192 * @returns { Promise<void> } The promise returned by the function. 193 * @syscap SystemCapability.Ability.AbilityRuntime.Core 194 * @since 7 195 * @deprecated since 9 196 * @useinstead ohos.app.ability.wantAgent/wantAgent#cancel 197 */ 198 /** 199 * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. 200 * 201 * @param { WantAgent } agent - to cancel. 202 * @returns { Promise<void> } The promise returned by the function. 203 * @syscap SystemCapability.Ability.AbilityRuntime.Core 204 * @atomicservice 205 * @since 12 206 * @deprecated since 9 207 * @useinstead ohos.app.ability.wantAgent/wantAgent#cancel 208 */ 209 function cancel(agent: WantAgent): Promise<void>; 210 211 /** 212 * Triggers a WantAgent. 213 * 214 * @param { WantAgent } agent - to trigger. 215 * @param { TriggerInfo } triggerInfo - parameters. 216 * @param { Callback<CompleteData> } [callback] - Indicates the callback method to be called after 217 * the {@link WantAgent} is triggered. 218 * @syscap SystemCapability.Ability.AbilityRuntime.Core 219 * @since 7 220 * @deprecated since 9 221 * @useinstead ohos.app.ability.wantAgent/wantAgent#trigger 222 */ 223 /** 224 * Triggers a WantAgent. 225 * 226 * @param { WantAgent } agent - to trigger. 227 * @param { TriggerInfo } triggerInfo - parameters. 228 * @param { Callback<CompleteData> } [callback] - Indicates the callback method to be called after 229 * the {@link WantAgent} is triggered. 230 * @syscap SystemCapability.Ability.AbilityRuntime.Core 231 * @atomicservice 232 * @since 12 233 * @deprecated since 9 234 * @useinstead ohos.app.ability.wantAgent/wantAgent#trigger 235 */ 236 function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void; 237 238 /** 239 * Checks whether two WantAgent objects are equal. 240 * 241 * @param { WantAgent } agent - to compare. 242 * @param { WantAgent } otherAgent - WantAgent Object. 243 * @param { AsyncCallback<boolean> } callback - Callback method for determining whether two WantAgent instances are 244 * equal. 245 * @syscap SystemCapability.Ability.AbilityRuntime.Core 246 * @since 7 247 * @deprecated since 9 248 * @useinstead ohos.app.ability.wantAgent/wantAgent#equal 249 */ 250 /** 251 * Checks whether two WantAgent objects are equal. 252 * 253 * @param { WantAgent } agent - to compare. 254 * @param { WantAgent } otherAgent - WantAgent Object. 255 * @param { AsyncCallback<boolean> } callback - Callback method for determining whether two WantAgent instances are 256 * equal. 257 * @syscap SystemCapability.Ability.AbilityRuntime.Core 258 * @atomicservice 259 * @since 12 260 * @deprecated since 9 261 * @useinstead ohos.app.ability.wantAgent/wantAgent#equal 262 */ 263 function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback<boolean>): void; 264 265 /** 266 * Checks whether two WantAgent objects are equal. 267 * 268 * @param { WantAgent } agent - to compare. 269 * @param { WantAgent } otherAgent - WantAgent Object. 270 * @returns { Promise<boolean> } Returns {@code true} If the two objects are the same; returns {@code false} otherwise. 271 * @syscap SystemCapability.Ability.AbilityRuntime.Core 272 * @since 7 273 * @deprecated since 9 274 * @useinstead ohos.app.ability.wantAgent/wantAgent#equal 275 */ 276 /** 277 * Checks whether two WantAgent objects are equal. 278 * 279 * @param { WantAgent } agent - to compare. 280 * @param { WantAgent } otherAgent - WantAgent Object. 281 * @returns { Promise<boolean> } Returns {@code true} If the two objects are the same; returns {@code false} otherwise. 282 * @syscap SystemCapability.Ability.AbilityRuntime.Core 283 * @atomicservice 284 * @since 12 285 * @deprecated since 9 286 * @useinstead ohos.app.ability.wantAgent/wantAgent#equal 287 */ 288 function equal(agent: WantAgent, otherAgent: WantAgent): Promise<boolean>; 289 290 /** 291 * Obtains a WantAgent object. 292 * 293 * @param { WantAgentInfo } info - about the WantAgent object to obtain. 294 * @param { AsyncCallback<WantAgent> } callback - Callback method for obtaining the user ID of WantAgent instance. 295 * @syscap SystemCapability.Ability.AbilityRuntime.Core 296 * @since 7 297 * @deprecated since 9 298 * @useinstead ohos.app.ability.wantAgent/wantAgent#getWantAgent 299 */ 300 /** 301 * Obtains a WantAgent object. 302 * 303 * @param { WantAgentInfo } info - about the WantAgent object to obtain. 304 * @param { AsyncCallback<WantAgent> } callback - Callback method for obtaining the user ID of WantAgent instance. 305 * @syscap SystemCapability.Ability.AbilityRuntime.Core 306 * @atomicservice 307 * @since 12 308 * @deprecated since 9 309 * @useinstead ohos.app.ability.wantAgent/wantAgent#getWantAgent 310 */ 311 function getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void; 312 313 /** 314 * Obtains a WantAgent object. 315 * 316 * @param { WantAgentInfo } info - about the WantAgent object to obtain. 317 * @returns { Promise<WantAgent> } Returns the created {@link WantAgent} object. 318 * @syscap SystemCapability.Ability.AbilityRuntime.Core 319 * @since 7 320 * @deprecated since 9 321 * @useinstead ohos.app.ability.wantAgent/wantAgent#getWantAgent 322 */ 323 /** 324 * Obtains a WantAgent object. 325 * 326 * @param { WantAgentInfo } info - about the WantAgent object to obtain. 327 * @returns { Promise<WantAgent> } Returns the created {@link WantAgent} object. 328 * @syscap SystemCapability.Ability.AbilityRuntime.Core 329 * @atomicservice 330 * @since 12 331 * @deprecated since 9 332 * @useinstead ohos.app.ability.wantAgent/wantAgent#getWantAgent 333 */ 334 function getWantAgent(info: WantAgentInfo): Promise<WantAgent>; 335 336 /** 337 * Enumerates flags for using a WantAgent. 338 * 339 * @enum { number } 340 * @syscap SystemCapability.Ability.AbilityRuntime.Core 341 * @since 7 342 * @deprecated since 9 343 * @useinstead ohos.app.ability.wantAgent/wantAgent#WantAgentFlags 344 */ 345 /** 346 * Enumerates flags for using a WantAgent. 347 * 348 * @enum { number } 349 * @syscap SystemCapability.Ability.AbilityRuntime.Core 350 * @atomicservice 351 * @since 12 352 * @deprecated since 9 353 * @useinstead ohos.app.ability.wantAgent/wantAgent#WantAgentFlags 354 */ 355 export enum WantAgentFlags { 356 /** 357 * Indicates that the WantAgent can be used only once. 358 * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 359 * 360 * @syscap SystemCapability.Ability.AbilityRuntime.Core 361 * @since 7 362 * @deprecated since 9 363 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#ONE_TIME_FLAG 364 */ 365 /** 366 * Indicates that the WantAgent can be used only once. 367 * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 368 * 369 * @syscap SystemCapability.Ability.AbilityRuntime.Core 370 * @atomicservice 371 * @since 12 372 * @deprecated since 9 373 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#ONE_TIME_FLAG 374 */ 375 ONE_TIME_FLAG = 0, 376 377 /** 378 * Indicates that null is returned if the WantAgent does not exist. 379 * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 380 * 381 * @syscap SystemCapability.Ability.AbilityRuntime.Core 382 * @since 7 383 * @deprecated since 9 384 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#NO_BUILD_FLAG 385 */ 386 /** 387 * Indicates that null is returned if the WantAgent does not exist. 388 * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 389 * 390 * @syscap SystemCapability.Ability.AbilityRuntime.Core 391 * @atomicservice 392 * @since 12 393 * @deprecated since 9 394 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#NO_BUILD_FLAG 395 */ 396 NO_BUILD_FLAG, 397 398 /** 399 * Indicates that the existing WantAgent should be canceled before a new object is generated. 400 * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 401 * 402 * @syscap SystemCapability.Ability.AbilityRuntime.Core 403 * @since 7 404 * @deprecated since 9 405 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#CANCEL_PRESENT_FLAG 406 */ 407 /** 408 * Indicates that the existing WantAgent should be canceled before a new object is generated. 409 * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 410 * 411 * @syscap SystemCapability.Ability.AbilityRuntime.Core 412 * @atomicservice 413 * @since 12 414 * @deprecated since 9 415 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#CANCEL_PRESENT_FLAG 416 */ 417 CANCEL_PRESENT_FLAG, 418 419 /** 420 * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object. 421 * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 422 * 423 * @syscap SystemCapability.Ability.AbilityRuntime.Core 424 * @since 7 425 * @deprecated since 9 426 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#UPDATE_PRESENT_FLAG 427 */ 428 /** 429 * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object. 430 * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 431 * 432 * @syscap SystemCapability.Ability.AbilityRuntime.Core 433 * @atomicservice 434 * @since 12 435 * @deprecated since 9 436 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#UPDATE_PRESENT_FLAG 437 */ 438 UPDATE_PRESENT_FLAG, 439 440 /** 441 * Indicates that the created WantAgent should be immutable. 442 * 443 * @syscap SystemCapability.Ability.AbilityRuntime.Core 444 * @since 7 445 * @deprecated since 9 446 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#CONSTANT_FLAG 447 */ 448 /** 449 * Indicates that the created WantAgent should be immutable. 450 * 451 * @syscap SystemCapability.Ability.AbilityRuntime.Core 452 * @atomicservice 453 * @since 12 454 * @deprecated since 9 455 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#CONSTANT_FLAG 456 */ 457 CONSTANT_FLAG, 458 459 /** 460 * Indicates that the current value of element can be replaced when the WantAgent is triggered. 461 * 462 * @syscap SystemCapability.Ability.AbilityRuntime.Core 463 * @since 7 464 * @deprecated since 9 465 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ELEMENT 466 */ 467 /** 468 * Indicates that the current value of element can be replaced when the WantAgent is triggered. 469 * 470 * @syscap SystemCapability.Ability.AbilityRuntime.Core 471 * @atomicservice 472 * @since 12 473 * @deprecated since 9 474 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ELEMENT 475 */ 476 REPLACE_ELEMENT, 477 478 /** 479 * Indicates that the current value of action can be replaced when the WantAgent is triggered. 480 * 481 * @syscap SystemCapability.Ability.AbilityRuntime.Core 482 * @since 7 483 * @deprecated since 9 484 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ACTION 485 */ 486 /** 487 * Indicates that the current value of action can be replaced when the WantAgent is triggered. 488 * 489 * @syscap SystemCapability.Ability.AbilityRuntime.Core 490 * @atomicservice 491 * @since 12 492 * @deprecated since 9 493 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ACTION 494 */ 495 REPLACE_ACTION, 496 497 /** 498 * Indicates that the current value of uri can be replaced when the WantAgent is triggered. 499 * 500 * @syscap SystemCapability.Ability.AbilityRuntime.Core 501 * @since 7 502 * @deprecated since 9 503 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_URI 504 */ 505 /** 506 * Indicates that the current value of uri can be replaced when the WantAgent is triggered. 507 * 508 * @syscap SystemCapability.Ability.AbilityRuntime.Core 509 * @atomicservice 510 * @since 12 511 * @deprecated since 9 512 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_URI 513 */ 514 REPLACE_URI, 515 516 /** 517 * Indicates that the current value of entities can be replaced when the WantAgent is triggered. 518 * 519 * @syscap SystemCapability.Ability.AbilityRuntime.Core 520 * @since 7 521 * @deprecated since 9 522 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ENTITIES 523 */ 524 /** 525 * Indicates that the current value of entities can be replaced when the WantAgent is triggered. 526 * 527 * @syscap SystemCapability.Ability.AbilityRuntime.Core 528 * @atomicservice 529 * @since 12 530 * @deprecated since 9 531 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ENTITIES 532 */ 533 REPLACE_ENTITIES, 534 535 /** 536 * Indicates that the current value of packageName can be replaced when the WantAgent is triggered. 537 * 538 * @syscap SystemCapability.Ability.AbilityRuntime.Core 539 * @since 7 540 * @deprecated since 9 541 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_BUNDLE 542 */ 543 /** 544 * Indicates that the current value of packageName can be replaced when the WantAgent is triggered. 545 * 546 * @syscap SystemCapability.Ability.AbilityRuntime.Core 547 * @atomicservice 548 * @since 12 549 * @deprecated since 9 550 * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_BUNDLE 551 */ 552 REPLACE_BUNDLE 553 } 554 555 /** 556 * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event. 557 * 558 * @enum { number } 559 * @syscap SystemCapability.Ability.AbilityRuntime.Core 560 * @since 7 561 * @deprecated since 9 562 * @useinstead ohos.app.ability.wantAgent/wantAgent#OperationType 563 */ 564 /** 565 * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event. 566 * 567 * @enum { number } 568 * @syscap SystemCapability.Ability.AbilityRuntime.Core 569 * @atomicservice 570 * @since 12 571 * @deprecated since 9 572 * @useinstead ohos.app.ability.wantAgent/wantAgent#OperationType 573 */ 574 export enum OperationType { 575 /** 576 * Unknown operation. 577 * 578 * @syscap SystemCapability.Ability.AbilityRuntime.Core 579 * @since 7 580 * @deprecated since 9 581 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#UNKNOWN_TYPE 582 */ 583 /** 584 * Unknown operation. 585 * 586 * @syscap SystemCapability.Ability.AbilityRuntime.Core 587 * @atomicservice 588 * @since 12 589 * @deprecated since 9 590 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#UNKNOWN_TYPE 591 */ 592 UNKNOWN_TYPE = 0, 593 594 /** 595 * Starts an ability with a UI. 596 * 597 * @syscap SystemCapability.Ability.AbilityRuntime.Core 598 * @since 7 599 * @deprecated since 9 600 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_ABILITY 601 */ 602 /** 603 * Starts an ability with a UI. 604 * 605 * @syscap SystemCapability.Ability.AbilityRuntime.Core 606 * @atomicservice 607 * @since 12 608 * @deprecated since 9 609 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_ABILITY 610 */ 611 START_ABILITY, 612 613 /** 614 * Starts multiple abilities with a UI. 615 * 616 * @syscap SystemCapability.Ability.AbilityRuntime.Core 617 * @since 7 618 * @deprecated since 9 619 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_ABILITIES 620 */ 621 /** 622 * Starts multiple abilities with a UI. 623 * 624 * @syscap SystemCapability.Ability.AbilityRuntime.Core 625 * @atomicservice 626 * @since 12 627 * @deprecated since 9 628 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_ABILITIES 629 */ 630 START_ABILITIES, 631 632 /** 633 * Starts an ability without a UI. 634 * 635 * @syscap SystemCapability.Ability.AbilityRuntime.Core 636 * @since 7 637 * @deprecated since 9 638 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_SERVICE 639 */ 640 /** 641 * Starts an ability without a UI. 642 * 643 * @syscap SystemCapability.Ability.AbilityRuntime.Core 644 * @atomicservice 645 * @since 12 646 * @deprecated since 9 647 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_SERVICE 648 */ 649 START_SERVICE, 650 651 /** 652 * Sends a common event. 653 * 654 * @syscap SystemCapability.Ability.AbilityRuntime.Core 655 * @since 7 656 * @deprecated since 9 657 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#SEND_COMMON_EVENT 658 */ 659 /** 660 * Sends a common event. 661 * 662 * @syscap SystemCapability.Ability.AbilityRuntime.Core 663 * @atomicservice 664 * @since 12 665 * @deprecated since 9 666 * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#SEND_COMMON_EVENT 667 */ 668 SEND_COMMON_EVENT 669 } 670 671 /** 672 * Describes the data returned by after wantAgent.trigger is called. 673 * 674 * @typedef CompleteData 675 * @syscap SystemCapability.Ability.AbilityRuntime.Core 676 * @since 7 677 * @deprecated since 9 678 * @useinstead ohos.app.ability.wantAgent/wantAgent#CompleteData 679 */ 680 /** 681 * Describes the data returned by after wantAgent.trigger is called. 682 * 683 * @typedef CompleteData 684 * @syscap SystemCapability.Ability.AbilityRuntime.Core 685 * @atomicservice 686 * @since 12 687 * @deprecated since 9 688 * @useinstead ohos.app.ability.wantAgent/wantAgent#CompleteData 689 */ 690 export interface CompleteData { 691 /** 692 * Triggered WantAgent. 693 * 694 * @type { WantAgent } 695 * @syscap SystemCapability.Ability.AbilityRuntime.Core 696 * @since 7 697 * @deprecated since 9 698 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#info 699 */ 700 /** 701 * Triggered WantAgent. 702 * 703 * @type { WantAgent } 704 * @syscap SystemCapability.Ability.AbilityRuntime.Core 705 * @atomicservice 706 * @since 12 707 * @deprecated since 9 708 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#info 709 */ 710 info: WantAgent; 711 712 /** 713 * Existing Want that is triggered. 714 * 715 * @type { Want } 716 * @syscap SystemCapability.Ability.AbilityRuntime.Core 717 * @since 7 718 * @deprecated since 9 719 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#want 720 */ 721 /** 722 * Existing Want that is triggered. 723 * 724 * @type { Want } 725 * @syscap SystemCapability.Ability.AbilityRuntime.Core 726 * @atomicservice 727 * @since 12 728 * @deprecated since 9 729 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#want 730 */ 731 want: Want; 732 733 /** 734 * Request code used to trigger the WantAgent. 735 * 736 * @type { number } 737 * @syscap SystemCapability.Ability.AbilityRuntime.Core 738 * @since 7 739 * @deprecated since 9 740 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#finalCode 741 */ 742 /** 743 * Request code used to trigger the WantAgent. 744 * 745 * @type { number } 746 * @syscap SystemCapability.Ability.AbilityRuntime.Core 747 * @atomicservice 748 * @since 12 749 * @deprecated since 9 750 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#finalCode 751 */ 752 finalCode: number; 753 754 /** 755 * Final data collected by the common event. 756 * 757 * @type { string } 758 * @syscap SystemCapability.Ability.AbilityRuntime.Core 759 * @since 7 760 * @deprecated since 9 761 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#finalData 762 */ 763 /** 764 * Final data collected by the common event. 765 * 766 * @type { string } 767 * @syscap SystemCapability.Ability.AbilityRuntime.Core 768 * @atomicservice 769 * @since 12 770 * @deprecated since 9 771 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#finalData 772 */ 773 finalData: string; 774 775 /** 776 * Extra data collected by the common event. 777 * 778 * @type { ?object } 779 * @syscap SystemCapability.Ability.AbilityRuntime.Core 780 * @since 7 781 * @deprecated since 9 782 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#extraInfo 783 */ 784 /** 785 * Extra data collected by the common event. 786 * 787 * @type { ?object } 788 * @syscap SystemCapability.Ability.AbilityRuntime.Core 789 * @atomicservice 790 * @since 12 791 * @deprecated since 9 792 * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#extraInfo 793 */ 794 extraInfo?: { [key: string]: any }; 795 } 796} 797 798/** 799 * WantAgent object. 800 * 801 * @typedef { object } 802 * @syscap SystemCapability.Ability.AbilityRuntime.Core 803 * @since 7 804 */ 805/** 806 * WantAgent object. 807 * 808 * @typedef { object } 809 * @syscap SystemCapability.Ability.AbilityRuntime.Core 810 * @atomicservice 811 * @since 12 812 */ 813export type WantAgent = object; 814 815export default wantAgent; 816