1/* 2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"), 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import Want from './@ohos.app.ability.Want'; 22import wantConstant from './@ohos.app.ability.wantConstant'; 23import type { AsyncCallback } from './@ohos.base'; 24import type insightIntent from './@ohos.app.ability.insightIntent'; 25 26/** 27 * Insight intent driver. 28 * 29 * @namespace insightIntentDriver 30 * @syscap SystemCapability.Ability.AbilityRuntime.Core 31 * @systemapi 32 * @StageModelOnly 33 * @since arkts {'1.1':'11', '1.2':'20'} 34 * @arkts 1.1&1.2 35 */ 36declare namespace insightIntentDriver { 37 /** 38 * Param when execute insight intent. 39 * 40 * @typedef ExecuteParam 41 * @syscap SystemCapability.Ability.AbilityRuntime.Core 42 * @systemapi 43 * @StageModelOnly 44 * @since arkts {'1.1':'11', '1.2':'20'} 45 * @arkts 1.1&1.2 46 */ 47 interface ExecuteParam { 48 /** 49 * Indicates the bundle name. 50 * 51 * @type { string } 52 * @syscap SystemCapability.Ability.AbilityRuntime.Core 53 * @systemapi 54 * @StageModelOnly 55 * @since arkts {'1.1':'11', '1.2':'20'} 56 * @arkts 1.1&1.2 57 */ 58 bundleName: string; 59 60 /** 61 * Indicates the module name. 62 * 63 * @type { string } 64 * @syscap SystemCapability.Ability.AbilityRuntime.Core 65 * @systemapi 66 * @StageModelOnly 67 * @since arkts {'1.1':'11', '1.2':'20'} 68 * @arkts 1.1&1.2 69 */ 70 moduleName: string; 71 72 /** 73 * Indicates the ability name. 74 * 75 * @type { string } 76 * @syscap SystemCapability.Ability.AbilityRuntime.Core 77 * @systemapi 78 * @StageModelOnly 79 * @since arkts {'1.1':'11', '1.2':'20'} 80 * @arkts 1.1&1.2 81 */ 82 abilityName: string; 83 84 /** 85 * Indicates the insight intent name. 86 * 87 * @type { string } 88 * @syscap SystemCapability.Ability.AbilityRuntime.Core 89 * @systemapi 90 * @StageModelOnly 91 * @since arkts {'1.1':'11', '1.2':'20'} 92 * @arkts 1.1&1.2 93 */ 94 insightIntentName: string; 95 96 /** 97 * Indicates the insight intent param. 98 * 99 * @type { Record<string, Object> } 100 * @syscap SystemCapability.Ability.AbilityRuntime.Core 101 * @systemapi 102 * @StageModelOnly 103 * @since arkts {'1.1':'11', '1.2':'20'} 104 * @arkts 1.1&1.2 105 */ 106 insightIntentParam: Record<string, Object>; 107 108 /** 109 * Indicates the execute mode. 110 * 111 * @type { insightIntent.ExecuteMode } 112 * @syscap SystemCapability.Ability.AbilityRuntime.Core 113 * @systemapi 114 * @StageModelOnly 115 * @since arkts {'1.1':'11', '1.2':'20'} 116 * @arkts 1.1&1.2 117 */ 118 executeMode: insightIntent.ExecuteMode; 119 120 /** 121 * Indicates the display Id, only works when executeMode is UIAbility foreground. 122 * 123 * @type { ?number } 124 * @syscap SystemCapability.Ability.AbilityRuntime.Core 125 * @systemapi 126 * @StageModelOnly 127 * @since arkts {'1.1':'12', '1.2':'20'} 128 * @arkts 1.1&1.2 129 */ 130 displayId?: number; 131 132 /** 133 * Indicates the URIs will be authorized to the insight intent executor. 134 * 135 * @type { ?Array<string> } 136 * @syscap SystemCapability.Ability.AbilityRuntime.Core 137 * @systemapi 138 * @stagemodelonly 139 * @since arkts {'1.1':'18', '1.2':'20'} 140 * @arkts 1.1&1.2 141 */ 142 uris?: Array<string>; 143 144 /** 145 * Indicates the URIs read and write permissions which consistent with {@link Want#flags}, 146 * flags must be one of {@link wantConstant#Flags#FLAG_AUTH_READ_URI_PERMISSION}, 147 * {@link wantConstant#Flags#FLAG_AUTH_WRITE_URI_PERMISSION}, 148 * {@link wantConstant#Flags#FLAG_AUTH_READ_URI_PERMISSION}| 149 * {@link wantConstant#Flags#FLAG_AUTH_WRITE_URI_PERMISSION}. 150 * 151 * @type { ?number } 152 * @syscap SystemCapability.Ability.AbilityRuntime.Core 153 * @systemapi 154 * @stagemodelonly 155 * @since arkts {'1.1':'18', '1.2':'20'} 156 * @arkts 1.1&1.2 157 */ 158 flags?: number; 159 } 160 161 /** 162 * Execute insight intent. 163 * If the caller application is in foreground, you can use this method to execute insight intent; 164 * If the caller application is in background, you need to apply for permission: ohos.permission.START_ABILITIES_FROM_BACKGROUND; 165 * If the execute mode is UI_ABILITY_BACKGROUND, you need to apply for permission: ohos.permission.ABILITY_BACKGROUND_COMMUNICATION. 166 * 167 * @permission ohos.permission.EXECUTE_INSIGHT_INTENT 168 * @param { ExecuteParam } param - Execute parameter. 169 * @param { AsyncCallback<insightIntent.ExecuteResult> } callback - The callback of executeIntent. 170 * @throws { BusinessError } 201 - Permission denied. 171 * @throws { BusinessError } 202 - Not system application. 172 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 173 * 2. Incorrect parameter types. 174 * @throws { BusinessError } 16000001 - The specified ability does not exist. 175 * @throws { BusinessError } 16000002 - Incorrect ability type. 176 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 177 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 178 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 179 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 180 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 181 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 182 * @throws { BusinessError } 16000011 - The context does not exist. 183 * @throws { BusinessError } 16000012 - The application is controlled. 184 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 185 * @throws { BusinessError } 16000050 - Internal error. 186 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 187 * @throws { BusinessError } 16000055 - Installation-free timed out. 188 * @syscap SystemCapability.Ability.AbilityRuntime.Core 189 * @systemapi 190 * @StageModelOnly 191 * @since arkts {'1.1':'11', '1.2':'20'} 192 * @arkts 1.1&1.2 193 */ 194 function execute(param: ExecuteParam, callback: AsyncCallback<insightIntent.ExecuteResult>): void; 195 196 /** 197 * Execute insight intent. 198 * If the caller application is in foreground, you can use this method to execute insight intent; 199 * If the caller application is in background, you need to apply for permission: ohos.permission.START_ABILITIES_FROM_BACKGROUND; 200 * If the execute mode is UI_ABILITY_BACKGROUND, you need to apply for permission: ohos.permission.ABILITY_BACKGROUND_COMMUNICATION. 201 * 202 * @permission ohos.permission.EXECUTE_INSIGHT_INTENT 203 * @param { ExecuteParam } param - Execute parameter. 204 * @returns { Promise<insightIntent.ExecuteResult> } Returns the execute result. 205 * @throws { BusinessError } 201 - Permission denied. 206 * @throws { BusinessError } 202 - Not system application. 207 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 208 * 2. Incorrect parameter types. 209 * @throws { BusinessError } 16000001 - The specified ability does not exist. 210 * @throws { BusinessError } 16000002 - Incorrect ability type. 211 * @throws { BusinessError } 16000004 - Cannot start an invisible component. 212 * @throws { BusinessError } 16000005 - The specified process does not have the permission. 213 * @throws { BusinessError } 16000006 - Cross-user operations are not allowed. 214 * @throws { BusinessError } 16000008 - The crowdtesting application expires. 215 * @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode. 216 * @throws { BusinessError } 16000010 - The call with the continuation and prepare continuation flag is forbidden. 217 * @throws { BusinessError } 16000011 - The context does not exist. 218 * @throws { BusinessError } 16000012 - The application is controlled. 219 * @throws { BusinessError } 16000013 - The application is controlled by EDM. 220 * @throws { BusinessError } 16000050 - Internal error. 221 * @throws { BusinessError } 16000053 - The ability is not on the top of the UI. 222 * @throws { BusinessError } 16000055 - Installation-free timed out. 223 * @syscap SystemCapability.Ability.AbilityRuntime.Core 224 * @systemapi 225 * @StageModelOnly 226 * @since arkts {'1.1':'11', '1.2':'20'} 227 * @arkts 1.1&1.2 228 */ 229 function execute(param: ExecuteParam): Promise<insightIntent.ExecuteResult>; 230 231 /** 232 * Enum for intent type. 233 * 234 * @enum { string } 235 * @syscap SystemCapability.Ability.AbilityRuntime.Core 236 * @systemapi 237 * @stagemodelonly 238 * @since 20 239 */ 240 enum InsightIntentType { 241 /** 242 * Link insight intent. 243 * {@link InsightIntentDecorator#InsightIntentLink} 244 * 245 * @syscap SystemCapability.Ability.AbilityRuntime.Core 246 * @systemapi 247 * @stagemodelonly 248 * @since 20 249 */ 250 LINK = '@InsightIntentLink', 251 252 /** 253 * Page insight intent. 254 * {@link InsightIntentDecorator#InsightIntentPage} 255 * 256 * @syscap SystemCapability.Ability.AbilityRuntime.Core 257 * @systemapi 258 * @stagemodelonly 259 * @since 20 260 */ 261 PAGE = '@InsightIntentPage', 262 263 /** 264 * Entry insight intent. 265 * {@link InsightIntentDecorator#InsightIntentEntry} 266 * 267 * @syscap SystemCapability.Ability.AbilityRuntime.Core 268 * @systemapi 269 * @stagemodelonly 270 * @since 20 271 */ 272 ENTRY = '@InsightIntentEntry', 273 274 /** 275 * Function insight intent. 276 * {@link InsightIntentDecorator#InsightIntentFunction} 277 * 278 * @syscap SystemCapability.Ability.AbilityRuntime.Core 279 * @systemapi 280 * @stagemodelonly 281 * @since 20 282 */ 283 FUNCTION = '@InsightIntentFunctionMethod', 284 285 /** 286 * Form insight intent. 287 * {@link InsightIntentDecorator#InsightIntentForm} 288 * 289 * @syscap SystemCapability.Ability.AbilityRuntime.Core 290 * @systemapi 291 * @stagemodelonly 292 * @since 20 293 */ 294 FORM = '@InsightIntentForm', 295 } 296 297 /** 298 * The insight intent information. 299 * 300 * @interface InsightIntentInfo 301 * @syscap SystemCapability.Ability.AbilityRuntime.Core 302 * @systemapi 303 * @stagemodelonly 304 * @since 20 305 */ 306 interface InsightIntentInfo { 307 /** 308 * The bundle name. 309 * 310 * @type { string } 311 * @readonly 312 * @syscap SystemCapability.Ability.AbilityRuntime.Core 313 * @systemapi 314 * @stagemodelonly 315 * @since 20 316 */ 317 readonly bundleName: string; 318 319 /** 320 * The module name. 321 * 322 * @type { string } 323 * @readonly 324 * @syscap SystemCapability.Ability.AbilityRuntime.Core 325 * @systemapi 326 * @stagemodelonly 327 * @since 20 328 */ 329 readonly moduleName: string; 330 331 /** 332 * The intent name. 333 * 334 * @type { string } 335 * @readonly 336 * @syscap SystemCapability.Ability.AbilityRuntime.Core 337 * @systemapi 338 * @stagemodelonly 339 * @since 20 340 */ 341 readonly intentName: string; 342 343 /** 344 * The intent domain. 345 * 346 * @type { string } 347 * @readonly 348 * @syscap SystemCapability.Ability.AbilityRuntime.Core 349 * @systemapi 350 * @stagemodelonly 351 * @since 20 352 */ 353 readonly domain: string; 354 355 /** 356 * The intent version. 357 * 358 * @type { string } 359 * @readonly 360 * @syscap SystemCapability.Ability.AbilityRuntime.Core 361 * @systemapi 362 * @stagemodelonly 363 * @since 20 364 */ 365 readonly intentVersion: string; 366 367 /** 368 * The intent display name. 369 * 370 * @type { string } 371 * @readonly 372 * @syscap SystemCapability.Ability.AbilityRuntime.Core 373 * @systemapi 374 * @stagemodelonly 375 * @since 20 376 */ 377 readonly displayName: string; 378 379 /** 380 * The intent display description. 381 * 382 * @type { string } 383 * @readonly 384 * @syscap SystemCapability.Ability.AbilityRuntime.Core 385 * @systemapi 386 * @stagemodelonly 387 * @since 20 388 */ 389 readonly displayDescription: string; 390 391 /** 392 * The intent schema. 393 * 394 * @type { string } 395 * @readonly 396 * @syscap SystemCapability.Ability.AbilityRuntime.Core 397 * @systemapi 398 * @stagemodelonly 399 * @since 20 400 */ 401 readonly schema: string; 402 403 /** 404 * The intent icon. 405 * 406 * @type { string } 407 * @readonly 408 * @syscap SystemCapability.Ability.AbilityRuntime.Core 409 * @systemapi 410 * @stagemodelonly 411 * @since 20 412 */ 413 readonly icon: string; 414 415 /** 416 * The intent large language model description. 417 * 418 * @type { string } 419 * @readonly 420 * @syscap SystemCapability.Ability.AbilityRuntime.Core 421 * @systemapi 422 * @stagemodelonly 423 * @since 20 424 */ 425 readonly llmDescription: string; 426 427 /** 428 * The intent keywords. 429 * 430 * @type { string[] } 431 * @readonly 432 * @syscap SystemCapability.Ability.AbilityRuntime.Core 433 * @systemapi 434 * @stagemodelonly 435 * @since 20 436 */ 437 readonly keywords: string[]; 438 439 /** 440 * The intent type. 441 * 442 * @type { InsightIntentType } 443 * @readonly 444 * @syscap SystemCapability.Ability.AbilityRuntime.Core 445 * @systemapi 446 * @stagemodelonly 447 * @since 20 448 */ 449 readonly intentType: InsightIntentType; 450 451 /** 452 * The sub intent information. 453 * If the intentType is "@InsightIntentLink", subIntentInfo is a LinkIntentInfo. 454 * If the intentType is "@InsightIntentPage", subIntentInfo is a PageIntentInfo. 455 * If the intentType is "@InsightIntentFunctionMethod", subIntentInfo is a FunctionIntentInfo. 456 * If the intentType is "@InsightIntentForm", subIntentInfo is a FormIntentInfo. 457 * If the intentType is "@InsightIntentEntry", subIntentInfo is a EntryIntentInfo. 458 * 459 * @type { LinkIntentInfo | PageIntentInfo | FunctionIntentInfo | FormIntentInfo | EntryIntentInfo } 460 * @readonly 461 * @syscap SystemCapability.Ability.AbilityRuntime.Core 462 * @systemapi 463 * @stagemodelonly 464 * @since 20 465 */ 466 readonly subIntentInfo: LinkIntentInfo | PageIntentInfo | FunctionIntentInfo | FormIntentInfo | EntryIntentInfo; 467 468 /** 469 * The insight intent parameters. 470 * 471 * @type { Record<string, Object> } 472 * @readonly 473 * @syscap SystemCapability.Ability.AbilityRuntime.Core 474 * @systemapi 475 * @stagemodelonly 476 * @since 20 477 */ 478 readonly parameters: Record<string, Object>; 479 480 /** 481 * The type definition of the result returned by intent call. 482 * 483 * @type { Record<string, Object> } 484 * @readonly 485 * @syscap SystemCapability.Ability.AbilityRuntime.Core 486 * @systemapi 487 * @stagemodelonly 488 * @since 20 489 */ 490 readonly result: Record<string, Object>; 491 492 /** 493 * The entity informations. 494 * 495 * @type { Array<EntityInfo> } 496 * @readonly 497 * @syscap SystemCapability.Ability.AbilityRuntime.Core 498 * @systemapi 499 * @stagemodelonly 500 * @since 20 501 */ 502 readonly entities: Array<EntityInfo>; 503 } 504 505 /** 506 * The link intent information. 507 * 508 * @interface LinkIntentInfo 509 * @syscap SystemCapability.Ability.AbilityRuntime.Core 510 * @systemapi 511 * @stagemodelonly 512 * @since 20 513 */ 514 interface LinkIntentInfo { 515 /** 516 * The uri. 517 * 518 * @type { string } 519 * @readonly 520 * @syscap SystemCapability.Ability.AbilityRuntime.Core 521 * @systemapi 522 * @stagemodelonly 523 * @since 20 524 */ 525 readonly uri: string; 526 } 527 528 /** 529 * The page intent information. 530 * 531 * @interface LinkIntentInfo 532 * @syscap SystemCapability.Ability.AbilityRuntime.Core 533 * @systemapi 534 * @stagemodelonly 535 * @since 20 536 */ 537 interface PageIntentInfo { 538 /** 539 * The uiability. 540 * 541 * @type { string } 542 * @readonly 543 * @syscap SystemCapability.Ability.AbilityRuntime.Core 544 * @systemapi 545 * @stagemodelonly 546 * @since 20 547 */ 548 readonly uiAbility: string; 549 550 /** 551 * The page path. 552 * 553 * @type { string } 554 * @readonly 555 * @syscap SystemCapability.Ability.AbilityRuntime.Core 556 * @systemapi 557 * @stagemodelonly 558 * @since 20 559 */ 560 readonly pagePath: string; 561 562 /** 563 * The navigationId. 564 * 565 * @type { string } 566 * @readonly 567 * @syscap SystemCapability.Ability.AbilityRuntime.Core 568 * @systemapi 569 * @stagemodelonly 570 * @since 20 571 */ 572 readonly navigationId: string; 573 574 /** 575 * The navigation destination name. 576 * 577 * @type { string } 578 * @readonly 579 * @syscap SystemCapability.Ability.AbilityRuntime.Core 580 * @systemapi 581 * @stagemodelonly 582 * @since 20 583 */ 584 readonly navDestinationName: string; 585 } 586 587 /** 588 * The function intent information. 589 * 590 * @interface FunctionIntentInfo 591 * @syscap SystemCapability.Ability.AbilityRuntime.Core 592 * @systemapi 593 * @stagemodelonly 594 * @since 20 595 */ 596 interface FunctionIntentInfo {} 597 598 /** 599 * The form intent information. 600 * 601 * @interface FormIntentInfo 602 * @syscap SystemCapability.Ability.AbilityRuntime.Core 603 * @systemapi 604 * @stagemodelonly 605 * @since 20 606 */ 607 interface FormIntentInfo { 608 /** 609 * The form extension ability name. 610 * 611 * @type { string } 612 * @readonly 613 * @syscap SystemCapability.Ability.AbilityRuntime.Core 614 * @systemapi 615 * @stagemodelonly 616 * @since 20 617 */ 618 readonly abilityName: string; 619 620 /** 621 * The form name of the form extension ability. 622 * 623 * @type { string } 624 * @readonly 625 * @syscap SystemCapability.Ability.AbilityRuntime.Core 626 * @systemapi 627 * @stagemodelonly 628 * @since 20 629 */ 630 readonly formName: string; 631 } 632 633 /** 634 * The form intent information. 635 * 636 * @interface EntryIntentInfo 637 * @syscap SystemCapability.Ability.AbilityRuntime.Core 638 * @systemapi 639 * @stagemodelonly 640 * @since 20 641 */ 642 interface EntryIntentInfo { 643 /** 644 * The ability name. 645 * 646 * @type { string } 647 * @readonly 648 * @syscap SystemCapability.Ability.AbilityRuntime.Core 649 * @systemapi 650 * @stagemodelonly 651 * @since 20 652 */ 653 readonly abilityName: string; 654 655 /** 656 * The execute mode. 657 * 658 * @type { insightIntent.ExecuteMode[] } 659 * @readonly 660 * @syscap SystemCapability.Ability.AbilityRuntime.Core 661 * @systemapi 662 * @stagemodelonly 663 * @since 20 664 */ 665 readonly executeMode: insightIntent.ExecuteMode[]; 666 } 667 668 /** 669 * Enum for get insight intent flag. 670 * 671 * @enum { number } 672 * @syscap SystemCapability.Ability.AbilityRuntime.Core 673 * @systemapi 674 * @stagemodelonly 675 * @since 20 676 */ 677 enum GetInsightIntentFlag { 678 /** 679 * Get full insight intent. 680 * 681 * @syscap SystemCapability.Ability.AbilityRuntime.Core 682 * @systemapi 683 * @stagemodelonly 684 * @since 20 685 */ 686 GET_FULL_INSIGHT_INTENT = 0x00000001, 687 688 /** 689 * Get summary insight intent. 690 * 691 * @syscap SystemCapability.Ability.AbilityRuntime.Core 692 * @systemapi 693 * @stagemodelonly 694 * @since 20 695 */ 696 GET_SUMMARY_INSIGHT_INTENT = 0x00000002, 697 698 /** 699 * Get entities info. 700 * 701 * @syscap SystemCapability.Ability.AbilityRuntime.Core 702 * @systemapi 703 * @stagemodelonly 704 * @since 20 705 */ 706 GET_ENTITY_INFO = 0x00000004, 707 } 708 709 /** 710 * The entity information. 711 * 712 * @interface EntityInfo 713 * @syscap SystemCapability.Ability.AbilityRuntime.Core 714 * @systemapi 715 * @stagemodelonly 716 * @since 20 717 */ 718 interface EntityInfo { 719 /** 720 * The entity class name. 721 * 722 * @type { string } 723 * @readonly 724 * @syscap SystemCapability.Ability.AbilityRuntime.Core 725 * @systemapi 726 * @stagemodelonly 727 * @since 20 728 */ 729 readonly className: string; 730 731 /** 732 * The entity Id. 733 * 734 * @type { string } 735 * @readonly 736 * @syscap SystemCapability.Ability.AbilityRuntime.Core 737 * @systemapi 738 * @stagemodelonly 739 * @since 20 740 */ 741 readonly entityId: string; 742 743 /** 744 * The entity category. 745 * 746 * @type { string } 747 * @readonly 748 * @syscap SystemCapability.Ability.AbilityRuntime.Core 749 * @systemapi 750 * @stagemodelonly 751 * @since 20 752 */ 753 readonly entityCategory: string; 754 755 /** 756 * The parameters of intent entity. 757 * 758 * @type { Record<string, Object> } 759 * @readonly 760 * @syscap SystemCapability.Ability.AbilityRuntime.Core 761 * @systemapi 762 * @stagemodelonly 763 * @since 20 764 */ 765 readonly parameters: Record<string, Object>; 766 767 /** 768 * The entity class name of parent. 769 * 770 * @type { string } 771 * @readonly 772 * @syscap SystemCapability.Ability.AbilityRuntime.Core 773 * @systemapi 774 * @stagemodelonly 775 * @since 20 776 */ 777 readonly parentClassName: string; 778 } 779 780 /** 781 * Get all insight intent information. 782 * 783 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 784 * @param { number } intentFlags - The flags of get insight intent information. 785 * @returns { Promise<Array<InsightIntentInfo>> } Returns the insight intent information. 786 * @throws { BusinessError } 201 - Permission denied. 787 * @throws { BusinessError } 202 - Not system application. 788 * @throws { BusinessError } 16000050 - Internal error. Possible causes: 1. Failed to connect to the system service; 789 * 2. The system service failed to communicate with dependency module. 790 * @syscap SystemCapability.Ability.AbilityRuntime.Core 791 * @systemapi 792 * @stagemodelonly 793 * @since 20 794 */ 795 function getAllInsightIntentInfo(intentFlags: number): Promise<Array<InsightIntentInfo>>; 796 797 /** 798 * Get insight intent information by bundle name. 799 * 800 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 801 * @param { string } bundleName - The specified bundle name. 802 * @param { number } intentFlags - The flags of get insight intent information. 803 * @returns { Promise<Array<InsightIntentInfo>> } Returns the insight intent information. 804 * @throws { BusinessError } 201 - Permission denied. 805 * @throws { BusinessError } 202 - Not system application. 806 * @throws { BusinessError } 16000050 - Internal error. Possible causes: 1. Failed to connect to the system service; 807 * 2. The system service failed to communicate with dependency module. 808 * @syscap SystemCapability.Ability.AbilityRuntime.Core 809 * @systemapi 810 * @stagemodelonly 811 * @since 20 812 */ 813 function getInsightIntentInfoByBundleName(bundleName: string, intentFlags: number): Promise<Array<InsightIntentInfo>>; 814 815 /** 816 * Get insight intent information by intent name. 817 * 818 * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED 819 * @param { string } bundleName - The specified bundle name. 820 * @param { string } moduleName - The specified module name. 821 * @param { string } intentName - The specified intent name. 822 * @param { number } intentFlags - The flags of get insight intent information. 823 * @returns { Promise<InsightIntentInfo> } Returns the insight intent information. 824 * @throws { BusinessError } 201 - Permission denied. 825 * @throws { BusinessError } 202 - Not system application. 826 * @throws { BusinessError } 16000050 - Internal error. Possible causes: 1. Failed to connect to the system service; 827 * 2. The system service failed to communicate with dependency module. 828 * @syscap SystemCapability.Ability.AbilityRuntime.Core 829 * @systemapi 830 * @stagemodelonly 831 * @since 20 832 */ 833 function getInsightIntentInfoByIntentName(bundleName: string, moduleName: string, intentName: string, intentFlags: number): Promise<InsightIntentInfo>; 834} 835 836export default insightIntentDriver; 837