161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci */ 1961847f8eSopenharmony_ci 2061847f8eSopenharmony_ciimport { AsyncCallback, Callback } from './@ohos.base'; 2161847f8eSopenharmony_ciimport Want from './@ohos.app.ability.Want'; 2261847f8eSopenharmony_ciimport { WantAgentInfo } from './wantAgent/wantAgentInfo'; 2361847f8eSopenharmony_ciimport { TriggerInfo } from './wantAgent/triggerInfo'; 2461847f8eSopenharmony_ci 2561847f8eSopenharmony_ci/** 2661847f8eSopenharmony_ci * Provide the method obtain trigger, cancel, and compare and to obtain 2761847f8eSopenharmony_ci * the bundle name, UID of an {@link WantAgent} object. 2861847f8eSopenharmony_ci * 2961847f8eSopenharmony_ci * @namespace wantAgent 3061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 3161847f8eSopenharmony_ci * @since 7 3261847f8eSopenharmony_ci * @deprecated since 9 3361847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent 3461847f8eSopenharmony_ci */ 3561847f8eSopenharmony_ci/** 3661847f8eSopenharmony_ci * Provide the method obtain trigger, cancel, and compare and to obtain 3761847f8eSopenharmony_ci * the bundle name, UID of an {@link WantAgent} object. 3861847f8eSopenharmony_ci * 3961847f8eSopenharmony_ci * @namespace wantAgent 4061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 4161847f8eSopenharmony_ci * @atomicservice 4261847f8eSopenharmony_ci * @since 12 4361847f8eSopenharmony_ci * @deprecated since 9 4461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent 4561847f8eSopenharmony_ci */ 4661847f8eSopenharmony_cideclare namespace wantAgent { 4761847f8eSopenharmony_ci /** 4861847f8eSopenharmony_ci * Obtains the bundle name of a WantAgent. 4961847f8eSopenharmony_ci * 5061847f8eSopenharmony_ci * @param { WantAgent } agent - whose bundle name to obtain. 5161847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - A callback method to obtain the package name of the WantAgent instance. 5261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 5361847f8eSopenharmony_ci * @since 7 5461847f8eSopenharmony_ci * @deprecated since 9 5561847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getBundleName 5661847f8eSopenharmony_ci */ 5761847f8eSopenharmony_ci /** 5861847f8eSopenharmony_ci * Obtains the bundle name of a WantAgent. 5961847f8eSopenharmony_ci * 6061847f8eSopenharmony_ci * @param { WantAgent } agent - whose bundle name to obtain. 6161847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback - A callback method to obtain the package name of the WantAgent instance. 6261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 6361847f8eSopenharmony_ci * @atomicservice 6461847f8eSopenharmony_ci * @since 12 6561847f8eSopenharmony_ci * @deprecated since 9 6661847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getBundleName 6761847f8eSopenharmony_ci */ 6861847f8eSopenharmony_ci function getBundleName(agent: WantAgent, callback: AsyncCallback<string>): void; 6961847f8eSopenharmony_ci 7061847f8eSopenharmony_ci /** 7161847f8eSopenharmony_ci * Obtains the bundle name of a WantAgent. 7261847f8eSopenharmony_ci * 7361847f8eSopenharmony_ci * @param { WantAgent } agent - whose bundle name to obtain. 7461847f8eSopenharmony_ci * @returns { Promise<string> } Returns the bundle name of the {@link WantAgent} if any. 7561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 7661847f8eSopenharmony_ci * @since 7 7761847f8eSopenharmony_ci * @deprecated since 9 7861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getBundleName 7961847f8eSopenharmony_ci */ 8061847f8eSopenharmony_ci /** 8161847f8eSopenharmony_ci * Obtains the bundle name of a WantAgent. 8261847f8eSopenharmony_ci * 8361847f8eSopenharmony_ci * @param { WantAgent } agent - whose bundle name to obtain. 8461847f8eSopenharmony_ci * @returns { Promise<string> } Returns the bundle name of the {@link WantAgent} if any. 8561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 8661847f8eSopenharmony_ci * @atomicservice 8761847f8eSopenharmony_ci * @since 12 8861847f8eSopenharmony_ci * @deprecated since 9 8961847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getBundleName 9061847f8eSopenharmony_ci */ 9161847f8eSopenharmony_ci function getBundleName(agent: WantAgent): Promise<string>; 9261847f8eSopenharmony_ci 9361847f8eSopenharmony_ci /** 9461847f8eSopenharmony_ci * Obtains the UID of a WantAgent. 9561847f8eSopenharmony_ci * 9661847f8eSopenharmony_ci * @param { WantAgent } agent - whose UID to obtain. 9761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - Create a callback method for WantAgent. 9861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 9961847f8eSopenharmony_ci * @since 7 10061847f8eSopenharmony_ci * @deprecated since 9 10161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getUid 10261847f8eSopenharmony_ci */ 10361847f8eSopenharmony_ci /** 10461847f8eSopenharmony_ci * Obtains the UID of a WantAgent. 10561847f8eSopenharmony_ci * 10661847f8eSopenharmony_ci * @param { WantAgent } agent - whose UID to obtain. 10761847f8eSopenharmony_ci * @param { AsyncCallback<number> } callback - Create a callback method for WantAgent. 10861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 10961847f8eSopenharmony_ci * @atomicservice 11061847f8eSopenharmony_ci * @since 12 11161847f8eSopenharmony_ci * @deprecated since 9 11261847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getUid 11361847f8eSopenharmony_ci */ 11461847f8eSopenharmony_ci function getUid(agent: WantAgent, callback: AsyncCallback<number>): void; 11561847f8eSopenharmony_ci 11661847f8eSopenharmony_ci /** 11761847f8eSopenharmony_ci * Obtains the UID of a WantAgent. 11861847f8eSopenharmony_ci * 11961847f8eSopenharmony_ci * @param { WantAgent } agent - whose UID to obtain. 12061847f8eSopenharmony_ci * @returns { Promise<number> } Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. 12161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 12261847f8eSopenharmony_ci * @since 7 12361847f8eSopenharmony_ci * @deprecated since 9 12461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getUid 12561847f8eSopenharmony_ci */ 12661847f8eSopenharmony_ci /** 12761847f8eSopenharmony_ci * Obtains the UID of a WantAgent. 12861847f8eSopenharmony_ci * 12961847f8eSopenharmony_ci * @param { WantAgent } agent - whose UID to obtain. 13061847f8eSopenharmony_ci * @returns { Promise<number> } Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. 13161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 13261847f8eSopenharmony_ci * @atomicservice 13361847f8eSopenharmony_ci * @since 12 13461847f8eSopenharmony_ci * @deprecated since 9 13561847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getUid 13661847f8eSopenharmony_ci */ 13761847f8eSopenharmony_ci function getUid(agent: WantAgent): Promise<number>; 13861847f8eSopenharmony_ci 13961847f8eSopenharmony_ci /** 14061847f8eSopenharmony_ci * Obtains the {@link Want} of an {@link WantAgent}. 14161847f8eSopenharmony_ci * 14261847f8eSopenharmony_ci * @param { WantAgent } agent - Indicates the {@link WantAgent} whose UID is to be obtained. 14361847f8eSopenharmony_ci * @param { AsyncCallback<Want> } callback - Obtain the callback method for Want in WantAgent. 14461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 14561847f8eSopenharmony_ci * @systemapi 14661847f8eSopenharmony_ci * @since 7 14761847f8eSopenharmony_ci * @deprecated since 9 14861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getWant 14961847f8eSopenharmony_ci */ 15061847f8eSopenharmony_ci function getWant(agent: WantAgent, callback: AsyncCallback<Want>): void; 15161847f8eSopenharmony_ci 15261847f8eSopenharmony_ci /** 15361847f8eSopenharmony_ci * Obtains the {@link Want} of an {@link WantAgent}. 15461847f8eSopenharmony_ci * 15561847f8eSopenharmony_ci * @param { WantAgent } agent - Indicates the {@link WantAgent} whose UID is to be obtained. 15661847f8eSopenharmony_ci * @returns { Promise<Want> } Returns the {@link Want} of the {@link WantAgent}. 15761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 15861847f8eSopenharmony_ci * @systemapi 15961847f8eSopenharmony_ci * @since 7 16061847f8eSopenharmony_ci * @deprecated since 9 16161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getWant 16261847f8eSopenharmony_ci */ 16361847f8eSopenharmony_ci function getWant(agent: WantAgent): Promise<Want>; 16461847f8eSopenharmony_ci 16561847f8eSopenharmony_ci /** 16661847f8eSopenharmony_ci * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. 16761847f8eSopenharmony_ci * 16861847f8eSopenharmony_ci * @param { WantAgent } agent - to cancel. 16961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Cancel the callback method for Want in WantAgent. 17061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 17161847f8eSopenharmony_ci * @since 7 17261847f8eSopenharmony_ci * @deprecated since 9 17361847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#cancel 17461847f8eSopenharmony_ci */ 17561847f8eSopenharmony_ci /** 17661847f8eSopenharmony_ci * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. 17761847f8eSopenharmony_ci * 17861847f8eSopenharmony_ci * @param { WantAgent } agent - to cancel. 17961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback - Cancel the callback method for Want in WantAgent. 18061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 18161847f8eSopenharmony_ci * @atomicservice 18261847f8eSopenharmony_ci * @since 12 18361847f8eSopenharmony_ci * @deprecated since 9 18461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#cancel 18561847f8eSopenharmony_ci */ 18661847f8eSopenharmony_ci function cancel(agent: WantAgent, callback: AsyncCallback<void>): void; 18761847f8eSopenharmony_ci 18861847f8eSopenharmony_ci /** 18961847f8eSopenharmony_ci * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. 19061847f8eSopenharmony_ci * 19161847f8eSopenharmony_ci * @param { WantAgent } agent - to cancel. 19261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 19361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 19461847f8eSopenharmony_ci * @since 7 19561847f8eSopenharmony_ci * @deprecated since 9 19661847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#cancel 19761847f8eSopenharmony_ci */ 19861847f8eSopenharmony_ci /** 19961847f8eSopenharmony_ci * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. 20061847f8eSopenharmony_ci * 20161847f8eSopenharmony_ci * @param { WantAgent } agent - to cancel. 20261847f8eSopenharmony_ci * @returns { Promise<void> } The promise returned by the function. 20361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 20461847f8eSopenharmony_ci * @atomicservice 20561847f8eSopenharmony_ci * @since 12 20661847f8eSopenharmony_ci * @deprecated since 9 20761847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#cancel 20861847f8eSopenharmony_ci */ 20961847f8eSopenharmony_ci function cancel(agent: WantAgent): Promise<void>; 21061847f8eSopenharmony_ci 21161847f8eSopenharmony_ci /** 21261847f8eSopenharmony_ci * Triggers a WantAgent. 21361847f8eSopenharmony_ci * 21461847f8eSopenharmony_ci * @param { WantAgent } agent - to trigger. 21561847f8eSopenharmony_ci * @param { TriggerInfo } triggerInfo - parameters. 21661847f8eSopenharmony_ci * @param { Callback<CompleteData> } [callback] - Indicates the callback method to be called after 21761847f8eSopenharmony_ci * the {@link WantAgent} is triggered. 21861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 21961847f8eSopenharmony_ci * @since 7 22061847f8eSopenharmony_ci * @deprecated since 9 22161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#trigger 22261847f8eSopenharmony_ci */ 22361847f8eSopenharmony_ci /** 22461847f8eSopenharmony_ci * Triggers a WantAgent. 22561847f8eSopenharmony_ci * 22661847f8eSopenharmony_ci * @param { WantAgent } agent - to trigger. 22761847f8eSopenharmony_ci * @param { TriggerInfo } triggerInfo - parameters. 22861847f8eSopenharmony_ci * @param { Callback<CompleteData> } [callback] - Indicates the callback method to be called after 22961847f8eSopenharmony_ci * the {@link WantAgent} is triggered. 23061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 23161847f8eSopenharmony_ci * @atomicservice 23261847f8eSopenharmony_ci * @since 12 23361847f8eSopenharmony_ci * @deprecated since 9 23461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#trigger 23561847f8eSopenharmony_ci */ 23661847f8eSopenharmony_ci function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void; 23761847f8eSopenharmony_ci 23861847f8eSopenharmony_ci /** 23961847f8eSopenharmony_ci * Checks whether two WantAgent objects are equal. 24061847f8eSopenharmony_ci * 24161847f8eSopenharmony_ci * @param { WantAgent } agent - to compare. 24261847f8eSopenharmony_ci * @param { WantAgent } otherAgent - WantAgent Object. 24361847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Callback method for determining whether two WantAgent instances are 24461847f8eSopenharmony_ci * equal. 24561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 24661847f8eSopenharmony_ci * @since 7 24761847f8eSopenharmony_ci * @deprecated since 9 24861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#equal 24961847f8eSopenharmony_ci */ 25061847f8eSopenharmony_ci /** 25161847f8eSopenharmony_ci * Checks whether two WantAgent objects are equal. 25261847f8eSopenharmony_ci * 25361847f8eSopenharmony_ci * @param { WantAgent } agent - to compare. 25461847f8eSopenharmony_ci * @param { WantAgent } otherAgent - WantAgent Object. 25561847f8eSopenharmony_ci * @param { AsyncCallback<boolean> } callback - Callback method for determining whether two WantAgent instances are 25661847f8eSopenharmony_ci * equal. 25761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 25861847f8eSopenharmony_ci * @atomicservice 25961847f8eSopenharmony_ci * @since 12 26061847f8eSopenharmony_ci * @deprecated since 9 26161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#equal 26261847f8eSopenharmony_ci */ 26361847f8eSopenharmony_ci function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback<boolean>): void; 26461847f8eSopenharmony_ci 26561847f8eSopenharmony_ci /** 26661847f8eSopenharmony_ci * Checks whether two WantAgent objects are equal. 26761847f8eSopenharmony_ci * 26861847f8eSopenharmony_ci * @param { WantAgent } agent - to compare. 26961847f8eSopenharmony_ci * @param { WantAgent } otherAgent - WantAgent Object. 27061847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns {@code true} If the two objects are the same; returns {@code false} otherwise. 27161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 27261847f8eSopenharmony_ci * @since 7 27361847f8eSopenharmony_ci * @deprecated since 9 27461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#equal 27561847f8eSopenharmony_ci */ 27661847f8eSopenharmony_ci /** 27761847f8eSopenharmony_ci * Checks whether two WantAgent objects are equal. 27861847f8eSopenharmony_ci * 27961847f8eSopenharmony_ci * @param { WantAgent } agent - to compare. 28061847f8eSopenharmony_ci * @param { WantAgent } otherAgent - WantAgent Object. 28161847f8eSopenharmony_ci * @returns { Promise<boolean> } Returns {@code true} If the two objects are the same; returns {@code false} otherwise. 28261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 28361847f8eSopenharmony_ci * @atomicservice 28461847f8eSopenharmony_ci * @since 12 28561847f8eSopenharmony_ci * @deprecated since 9 28661847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#equal 28761847f8eSopenharmony_ci */ 28861847f8eSopenharmony_ci function equal(agent: WantAgent, otherAgent: WantAgent): Promise<boolean>; 28961847f8eSopenharmony_ci 29061847f8eSopenharmony_ci /** 29161847f8eSopenharmony_ci * Obtains a WantAgent object. 29261847f8eSopenharmony_ci * 29361847f8eSopenharmony_ci * @param { WantAgentInfo } info - about the WantAgent object to obtain. 29461847f8eSopenharmony_ci * @param { AsyncCallback<WantAgent> } callback - Callback method for obtaining the user ID of WantAgent instance. 29561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 29661847f8eSopenharmony_ci * @since 7 29761847f8eSopenharmony_ci * @deprecated since 9 29861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getWantAgent 29961847f8eSopenharmony_ci */ 30061847f8eSopenharmony_ci /** 30161847f8eSopenharmony_ci * Obtains a WantAgent object. 30261847f8eSopenharmony_ci * 30361847f8eSopenharmony_ci * @param { WantAgentInfo } info - about the WantAgent object to obtain. 30461847f8eSopenharmony_ci * @param { AsyncCallback<WantAgent> } callback - Callback method for obtaining the user ID of WantAgent instance. 30561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 30661847f8eSopenharmony_ci * @atomicservice 30761847f8eSopenharmony_ci * @since 12 30861847f8eSopenharmony_ci * @deprecated since 9 30961847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getWantAgent 31061847f8eSopenharmony_ci */ 31161847f8eSopenharmony_ci function getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void; 31261847f8eSopenharmony_ci 31361847f8eSopenharmony_ci /** 31461847f8eSopenharmony_ci * Obtains a WantAgent object. 31561847f8eSopenharmony_ci * 31661847f8eSopenharmony_ci * @param { WantAgentInfo } info - about the WantAgent object to obtain. 31761847f8eSopenharmony_ci * @returns { Promise<WantAgent> } Returns the created {@link WantAgent} object. 31861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 31961847f8eSopenharmony_ci * @since 7 32061847f8eSopenharmony_ci * @deprecated since 9 32161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getWantAgent 32261847f8eSopenharmony_ci */ 32361847f8eSopenharmony_ci /** 32461847f8eSopenharmony_ci * Obtains a WantAgent object. 32561847f8eSopenharmony_ci * 32661847f8eSopenharmony_ci * @param { WantAgentInfo } info - about the WantAgent object to obtain. 32761847f8eSopenharmony_ci * @returns { Promise<WantAgent> } Returns the created {@link WantAgent} object. 32861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 32961847f8eSopenharmony_ci * @atomicservice 33061847f8eSopenharmony_ci * @since 12 33161847f8eSopenharmony_ci * @deprecated since 9 33261847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#getWantAgent 33361847f8eSopenharmony_ci */ 33461847f8eSopenharmony_ci function getWantAgent(info: WantAgentInfo): Promise<WantAgent>; 33561847f8eSopenharmony_ci 33661847f8eSopenharmony_ci /** 33761847f8eSopenharmony_ci * Enumerates flags for using a WantAgent. 33861847f8eSopenharmony_ci * 33961847f8eSopenharmony_ci * @enum { number } 34061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 34161847f8eSopenharmony_ci * @since 7 34261847f8eSopenharmony_ci * @deprecated since 9 34361847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#WantAgentFlags 34461847f8eSopenharmony_ci */ 34561847f8eSopenharmony_ci /** 34661847f8eSopenharmony_ci * Enumerates flags for using a WantAgent. 34761847f8eSopenharmony_ci * 34861847f8eSopenharmony_ci * @enum { number } 34961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 35061847f8eSopenharmony_ci * @atomicservice 35161847f8eSopenharmony_ci * @since 12 35261847f8eSopenharmony_ci * @deprecated since 9 35361847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#WantAgentFlags 35461847f8eSopenharmony_ci */ 35561847f8eSopenharmony_ci export enum WantAgentFlags { 35661847f8eSopenharmony_ci /** 35761847f8eSopenharmony_ci * Indicates that the WantAgent can be used only once. 35861847f8eSopenharmony_ci * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 35961847f8eSopenharmony_ci * 36061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 36161847f8eSopenharmony_ci * @since 7 36261847f8eSopenharmony_ci * @deprecated since 9 36361847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#ONE_TIME_FLAG 36461847f8eSopenharmony_ci */ 36561847f8eSopenharmony_ci /** 36661847f8eSopenharmony_ci * Indicates that the WantAgent can be used only once. 36761847f8eSopenharmony_ci * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 36861847f8eSopenharmony_ci * 36961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 37061847f8eSopenharmony_ci * @atomicservice 37161847f8eSopenharmony_ci * @since 12 37261847f8eSopenharmony_ci * @deprecated since 9 37361847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#ONE_TIME_FLAG 37461847f8eSopenharmony_ci */ 37561847f8eSopenharmony_ci ONE_TIME_FLAG = 0, 37661847f8eSopenharmony_ci 37761847f8eSopenharmony_ci /** 37861847f8eSopenharmony_ci * Indicates that null is returned if the WantAgent does not exist. 37961847f8eSopenharmony_ci * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 38061847f8eSopenharmony_ci * 38161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 38261847f8eSopenharmony_ci * @since 7 38361847f8eSopenharmony_ci * @deprecated since 9 38461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#NO_BUILD_FLAG 38561847f8eSopenharmony_ci */ 38661847f8eSopenharmony_ci /** 38761847f8eSopenharmony_ci * Indicates that null is returned if the WantAgent does not exist. 38861847f8eSopenharmony_ci * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 38961847f8eSopenharmony_ci * 39061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 39161847f8eSopenharmony_ci * @atomicservice 39261847f8eSopenharmony_ci * @since 12 39361847f8eSopenharmony_ci * @deprecated since 9 39461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#NO_BUILD_FLAG 39561847f8eSopenharmony_ci */ 39661847f8eSopenharmony_ci NO_BUILD_FLAG, 39761847f8eSopenharmony_ci 39861847f8eSopenharmony_ci /** 39961847f8eSopenharmony_ci * Indicates that the existing WantAgent should be canceled before a new object is generated. 40061847f8eSopenharmony_ci * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 40161847f8eSopenharmony_ci * 40261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 40361847f8eSopenharmony_ci * @since 7 40461847f8eSopenharmony_ci * @deprecated since 9 40561847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#CANCEL_PRESENT_FLAG 40661847f8eSopenharmony_ci */ 40761847f8eSopenharmony_ci /** 40861847f8eSopenharmony_ci * Indicates that the existing WantAgent should be canceled before a new object is generated. 40961847f8eSopenharmony_ci * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 41061847f8eSopenharmony_ci * 41161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 41261847f8eSopenharmony_ci * @atomicservice 41361847f8eSopenharmony_ci * @since 12 41461847f8eSopenharmony_ci * @deprecated since 9 41561847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#CANCEL_PRESENT_FLAG 41661847f8eSopenharmony_ci */ 41761847f8eSopenharmony_ci CANCEL_PRESENT_FLAG, 41861847f8eSopenharmony_ci 41961847f8eSopenharmony_ci /** 42061847f8eSopenharmony_ci * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object. 42161847f8eSopenharmony_ci * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 42261847f8eSopenharmony_ci * 42361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 42461847f8eSopenharmony_ci * @since 7 42561847f8eSopenharmony_ci * @deprecated since 9 42661847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#UPDATE_PRESENT_FLAG 42761847f8eSopenharmony_ci */ 42861847f8eSopenharmony_ci /** 42961847f8eSopenharmony_ci * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object. 43061847f8eSopenharmony_ci * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. 43161847f8eSopenharmony_ci * 43261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 43361847f8eSopenharmony_ci * @atomicservice 43461847f8eSopenharmony_ci * @since 12 43561847f8eSopenharmony_ci * @deprecated since 9 43661847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#UPDATE_PRESENT_FLAG 43761847f8eSopenharmony_ci */ 43861847f8eSopenharmony_ci UPDATE_PRESENT_FLAG, 43961847f8eSopenharmony_ci 44061847f8eSopenharmony_ci /** 44161847f8eSopenharmony_ci * Indicates that the created WantAgent should be immutable. 44261847f8eSopenharmony_ci * 44361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 44461847f8eSopenharmony_ci * @since 7 44561847f8eSopenharmony_ci * @deprecated since 9 44661847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#CONSTANT_FLAG 44761847f8eSopenharmony_ci */ 44861847f8eSopenharmony_ci /** 44961847f8eSopenharmony_ci * Indicates that the created WantAgent should be immutable. 45061847f8eSopenharmony_ci * 45161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 45261847f8eSopenharmony_ci * @atomicservice 45361847f8eSopenharmony_ci * @since 12 45461847f8eSopenharmony_ci * @deprecated since 9 45561847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#CONSTANT_FLAG 45661847f8eSopenharmony_ci */ 45761847f8eSopenharmony_ci CONSTANT_FLAG, 45861847f8eSopenharmony_ci 45961847f8eSopenharmony_ci /** 46061847f8eSopenharmony_ci * Indicates that the current value of element can be replaced when the WantAgent is triggered. 46161847f8eSopenharmony_ci * 46261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 46361847f8eSopenharmony_ci * @since 7 46461847f8eSopenharmony_ci * @deprecated since 9 46561847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ELEMENT 46661847f8eSopenharmony_ci */ 46761847f8eSopenharmony_ci /** 46861847f8eSopenharmony_ci * Indicates that the current value of element can be replaced when the WantAgent is triggered. 46961847f8eSopenharmony_ci * 47061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 47161847f8eSopenharmony_ci * @atomicservice 47261847f8eSopenharmony_ci * @since 12 47361847f8eSopenharmony_ci * @deprecated since 9 47461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ELEMENT 47561847f8eSopenharmony_ci */ 47661847f8eSopenharmony_ci REPLACE_ELEMENT, 47761847f8eSopenharmony_ci 47861847f8eSopenharmony_ci /** 47961847f8eSopenharmony_ci * Indicates that the current value of action can be replaced when the WantAgent is triggered. 48061847f8eSopenharmony_ci * 48161847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 48261847f8eSopenharmony_ci * @since 7 48361847f8eSopenharmony_ci * @deprecated since 9 48461847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ACTION 48561847f8eSopenharmony_ci */ 48661847f8eSopenharmony_ci /** 48761847f8eSopenharmony_ci * Indicates that the current value of action can be replaced when the WantAgent is triggered. 48861847f8eSopenharmony_ci * 48961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 49061847f8eSopenharmony_ci * @atomicservice 49161847f8eSopenharmony_ci * @since 12 49261847f8eSopenharmony_ci * @deprecated since 9 49361847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ACTION 49461847f8eSopenharmony_ci */ 49561847f8eSopenharmony_ci REPLACE_ACTION, 49661847f8eSopenharmony_ci 49761847f8eSopenharmony_ci /** 49861847f8eSopenharmony_ci * Indicates that the current value of uri can be replaced when the WantAgent is triggered. 49961847f8eSopenharmony_ci * 50061847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 50161847f8eSopenharmony_ci * @since 7 50261847f8eSopenharmony_ci * @deprecated since 9 50361847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_URI 50461847f8eSopenharmony_ci */ 50561847f8eSopenharmony_ci /** 50661847f8eSopenharmony_ci * Indicates that the current value of uri can be replaced when the WantAgent is triggered. 50761847f8eSopenharmony_ci * 50861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 50961847f8eSopenharmony_ci * @atomicservice 51061847f8eSopenharmony_ci * @since 12 51161847f8eSopenharmony_ci * @deprecated since 9 51261847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_URI 51361847f8eSopenharmony_ci */ 51461847f8eSopenharmony_ci REPLACE_URI, 51561847f8eSopenharmony_ci 51661847f8eSopenharmony_ci /** 51761847f8eSopenharmony_ci * Indicates that the current value of entities can be replaced when the WantAgent is triggered. 51861847f8eSopenharmony_ci * 51961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 52061847f8eSopenharmony_ci * @since 7 52161847f8eSopenharmony_ci * @deprecated since 9 52261847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ENTITIES 52361847f8eSopenharmony_ci */ 52461847f8eSopenharmony_ci /** 52561847f8eSopenharmony_ci * Indicates that the current value of entities can be replaced when the WantAgent is triggered. 52661847f8eSopenharmony_ci * 52761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 52861847f8eSopenharmony_ci * @atomicservice 52961847f8eSopenharmony_ci * @since 12 53061847f8eSopenharmony_ci * @deprecated since 9 53161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_ENTITIES 53261847f8eSopenharmony_ci */ 53361847f8eSopenharmony_ci REPLACE_ENTITIES, 53461847f8eSopenharmony_ci 53561847f8eSopenharmony_ci /** 53661847f8eSopenharmony_ci * Indicates that the current value of packageName can be replaced when the WantAgent is triggered. 53761847f8eSopenharmony_ci * 53861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 53961847f8eSopenharmony_ci * @since 7 54061847f8eSopenharmony_ci * @deprecated since 9 54161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_BUNDLE 54261847f8eSopenharmony_ci */ 54361847f8eSopenharmony_ci /** 54461847f8eSopenharmony_ci * Indicates that the current value of packageName can be replaced when the WantAgent is triggered. 54561847f8eSopenharmony_ci * 54661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 54761847f8eSopenharmony_ci * @atomicservice 54861847f8eSopenharmony_ci * @since 12 54961847f8eSopenharmony_ci * @deprecated since 9 55061847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.WantAgentFlags#REPLACE_BUNDLE 55161847f8eSopenharmony_ci */ 55261847f8eSopenharmony_ci REPLACE_BUNDLE 55361847f8eSopenharmony_ci } 55461847f8eSopenharmony_ci 55561847f8eSopenharmony_ci /** 55661847f8eSopenharmony_ci * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event. 55761847f8eSopenharmony_ci * 55861847f8eSopenharmony_ci * @enum { number } 55961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 56061847f8eSopenharmony_ci * @since 7 56161847f8eSopenharmony_ci * @deprecated since 9 56261847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#OperationType 56361847f8eSopenharmony_ci */ 56461847f8eSopenharmony_ci /** 56561847f8eSopenharmony_ci * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event. 56661847f8eSopenharmony_ci * 56761847f8eSopenharmony_ci * @enum { number } 56861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 56961847f8eSopenharmony_ci * @atomicservice 57061847f8eSopenharmony_ci * @since 12 57161847f8eSopenharmony_ci * @deprecated since 9 57261847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#OperationType 57361847f8eSopenharmony_ci */ 57461847f8eSopenharmony_ci export enum OperationType { 57561847f8eSopenharmony_ci /** 57661847f8eSopenharmony_ci * Unknown operation. 57761847f8eSopenharmony_ci * 57861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 57961847f8eSopenharmony_ci * @since 7 58061847f8eSopenharmony_ci * @deprecated since 9 58161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#UNKNOWN_TYPE 58261847f8eSopenharmony_ci */ 58361847f8eSopenharmony_ci /** 58461847f8eSopenharmony_ci * Unknown operation. 58561847f8eSopenharmony_ci * 58661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 58761847f8eSopenharmony_ci * @atomicservice 58861847f8eSopenharmony_ci * @since 12 58961847f8eSopenharmony_ci * @deprecated since 9 59061847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#UNKNOWN_TYPE 59161847f8eSopenharmony_ci */ 59261847f8eSopenharmony_ci UNKNOWN_TYPE = 0, 59361847f8eSopenharmony_ci 59461847f8eSopenharmony_ci /** 59561847f8eSopenharmony_ci * Starts an ability with a UI. 59661847f8eSopenharmony_ci * 59761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 59861847f8eSopenharmony_ci * @since 7 59961847f8eSopenharmony_ci * @deprecated since 9 60061847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_ABILITY 60161847f8eSopenharmony_ci */ 60261847f8eSopenharmony_ci /** 60361847f8eSopenharmony_ci * Starts an ability with a UI. 60461847f8eSopenharmony_ci * 60561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 60661847f8eSopenharmony_ci * @atomicservice 60761847f8eSopenharmony_ci * @since 12 60861847f8eSopenharmony_ci * @deprecated since 9 60961847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_ABILITY 61061847f8eSopenharmony_ci */ 61161847f8eSopenharmony_ci START_ABILITY, 61261847f8eSopenharmony_ci 61361847f8eSopenharmony_ci /** 61461847f8eSopenharmony_ci * Starts multiple abilities with a UI. 61561847f8eSopenharmony_ci * 61661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 61761847f8eSopenharmony_ci * @since 7 61861847f8eSopenharmony_ci * @deprecated since 9 61961847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_ABILITIES 62061847f8eSopenharmony_ci */ 62161847f8eSopenharmony_ci /** 62261847f8eSopenharmony_ci * Starts multiple abilities with a UI. 62361847f8eSopenharmony_ci * 62461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 62561847f8eSopenharmony_ci * @atomicservice 62661847f8eSopenharmony_ci * @since 12 62761847f8eSopenharmony_ci * @deprecated since 9 62861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_ABILITIES 62961847f8eSopenharmony_ci */ 63061847f8eSopenharmony_ci START_ABILITIES, 63161847f8eSopenharmony_ci 63261847f8eSopenharmony_ci /** 63361847f8eSopenharmony_ci * Starts an ability without a UI. 63461847f8eSopenharmony_ci * 63561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 63661847f8eSopenharmony_ci * @since 7 63761847f8eSopenharmony_ci * @deprecated since 9 63861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_SERVICE 63961847f8eSopenharmony_ci */ 64061847f8eSopenharmony_ci /** 64161847f8eSopenharmony_ci * Starts an ability without a UI. 64261847f8eSopenharmony_ci * 64361847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 64461847f8eSopenharmony_ci * @atomicservice 64561847f8eSopenharmony_ci * @since 12 64661847f8eSopenharmony_ci * @deprecated since 9 64761847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#START_SERVICE 64861847f8eSopenharmony_ci */ 64961847f8eSopenharmony_ci START_SERVICE, 65061847f8eSopenharmony_ci 65161847f8eSopenharmony_ci /** 65261847f8eSopenharmony_ci * Sends a common event. 65361847f8eSopenharmony_ci * 65461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 65561847f8eSopenharmony_ci * @since 7 65661847f8eSopenharmony_ci * @deprecated since 9 65761847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#SEND_COMMON_EVENT 65861847f8eSopenharmony_ci */ 65961847f8eSopenharmony_ci /** 66061847f8eSopenharmony_ci * Sends a common event. 66161847f8eSopenharmony_ci * 66261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 66361847f8eSopenharmony_ci * @atomicservice 66461847f8eSopenharmony_ci * @since 12 66561847f8eSopenharmony_ci * @deprecated since 9 66661847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.OperationType#SEND_COMMON_EVENT 66761847f8eSopenharmony_ci */ 66861847f8eSopenharmony_ci SEND_COMMON_EVENT 66961847f8eSopenharmony_ci } 67061847f8eSopenharmony_ci 67161847f8eSopenharmony_ci /** 67261847f8eSopenharmony_ci * Describes the data returned by after wantAgent.trigger is called. 67361847f8eSopenharmony_ci * 67461847f8eSopenharmony_ci * @typedef CompleteData 67561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 67661847f8eSopenharmony_ci * @since 7 67761847f8eSopenharmony_ci * @deprecated since 9 67861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#CompleteData 67961847f8eSopenharmony_ci */ 68061847f8eSopenharmony_ci /** 68161847f8eSopenharmony_ci * Describes the data returned by after wantAgent.trigger is called. 68261847f8eSopenharmony_ci * 68361847f8eSopenharmony_ci * @typedef CompleteData 68461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 68561847f8eSopenharmony_ci * @atomicservice 68661847f8eSopenharmony_ci * @since 12 68761847f8eSopenharmony_ci * @deprecated since 9 68861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent#CompleteData 68961847f8eSopenharmony_ci */ 69061847f8eSopenharmony_ci export interface CompleteData { 69161847f8eSopenharmony_ci /** 69261847f8eSopenharmony_ci * Triggered WantAgent. 69361847f8eSopenharmony_ci * 69461847f8eSopenharmony_ci * @type { WantAgent } 69561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 69661847f8eSopenharmony_ci * @since 7 69761847f8eSopenharmony_ci * @deprecated since 9 69861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#info 69961847f8eSopenharmony_ci */ 70061847f8eSopenharmony_ci /** 70161847f8eSopenharmony_ci * Triggered WantAgent. 70261847f8eSopenharmony_ci * 70361847f8eSopenharmony_ci * @type { WantAgent } 70461847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 70561847f8eSopenharmony_ci * @atomicservice 70661847f8eSopenharmony_ci * @since 12 70761847f8eSopenharmony_ci * @deprecated since 9 70861847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#info 70961847f8eSopenharmony_ci */ 71061847f8eSopenharmony_ci info: WantAgent; 71161847f8eSopenharmony_ci 71261847f8eSopenharmony_ci /** 71361847f8eSopenharmony_ci * Existing Want that is triggered. 71461847f8eSopenharmony_ci * 71561847f8eSopenharmony_ci * @type { Want } 71661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 71761847f8eSopenharmony_ci * @since 7 71861847f8eSopenharmony_ci * @deprecated since 9 71961847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#want 72061847f8eSopenharmony_ci */ 72161847f8eSopenharmony_ci /** 72261847f8eSopenharmony_ci * Existing Want that is triggered. 72361847f8eSopenharmony_ci * 72461847f8eSopenharmony_ci * @type { Want } 72561847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 72661847f8eSopenharmony_ci * @atomicservice 72761847f8eSopenharmony_ci * @since 12 72861847f8eSopenharmony_ci * @deprecated since 9 72961847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#want 73061847f8eSopenharmony_ci */ 73161847f8eSopenharmony_ci want: Want; 73261847f8eSopenharmony_ci 73361847f8eSopenharmony_ci /** 73461847f8eSopenharmony_ci * Request code used to trigger the WantAgent. 73561847f8eSopenharmony_ci * 73661847f8eSopenharmony_ci * @type { number } 73761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 73861847f8eSopenharmony_ci * @since 7 73961847f8eSopenharmony_ci * @deprecated since 9 74061847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#finalCode 74161847f8eSopenharmony_ci */ 74261847f8eSopenharmony_ci /** 74361847f8eSopenharmony_ci * Request code used to trigger the WantAgent. 74461847f8eSopenharmony_ci * 74561847f8eSopenharmony_ci * @type { number } 74661847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 74761847f8eSopenharmony_ci * @atomicservice 74861847f8eSopenharmony_ci * @since 12 74961847f8eSopenharmony_ci * @deprecated since 9 75061847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#finalCode 75161847f8eSopenharmony_ci */ 75261847f8eSopenharmony_ci finalCode: number; 75361847f8eSopenharmony_ci 75461847f8eSopenharmony_ci /** 75561847f8eSopenharmony_ci * Final data collected by the common event. 75661847f8eSopenharmony_ci * 75761847f8eSopenharmony_ci * @type { string } 75861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 75961847f8eSopenharmony_ci * @since 7 76061847f8eSopenharmony_ci * @deprecated since 9 76161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#finalData 76261847f8eSopenharmony_ci */ 76361847f8eSopenharmony_ci /** 76461847f8eSopenharmony_ci * Final data collected by the common event. 76561847f8eSopenharmony_ci * 76661847f8eSopenharmony_ci * @type { string } 76761847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 76861847f8eSopenharmony_ci * @atomicservice 76961847f8eSopenharmony_ci * @since 12 77061847f8eSopenharmony_ci * @deprecated since 9 77161847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#finalData 77261847f8eSopenharmony_ci */ 77361847f8eSopenharmony_ci finalData: string; 77461847f8eSopenharmony_ci 77561847f8eSopenharmony_ci /** 77661847f8eSopenharmony_ci * Extra data collected by the common event. 77761847f8eSopenharmony_ci * 77861847f8eSopenharmony_ci * @type { ?object } 77961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 78061847f8eSopenharmony_ci * @since 7 78161847f8eSopenharmony_ci * @deprecated since 9 78261847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#extraInfo 78361847f8eSopenharmony_ci */ 78461847f8eSopenharmony_ci /** 78561847f8eSopenharmony_ci * Extra data collected by the common event. 78661847f8eSopenharmony_ci * 78761847f8eSopenharmony_ci * @type { ?object } 78861847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 78961847f8eSopenharmony_ci * @atomicservice 79061847f8eSopenharmony_ci * @since 12 79161847f8eSopenharmony_ci * @deprecated since 9 79261847f8eSopenharmony_ci * @useinstead ohos.app.ability.wantAgent/wantAgent.CompleteData#extraInfo 79361847f8eSopenharmony_ci */ 79461847f8eSopenharmony_ci extraInfo?: { [key: string]: any }; 79561847f8eSopenharmony_ci } 79661847f8eSopenharmony_ci} 79761847f8eSopenharmony_ci 79861847f8eSopenharmony_ci/** 79961847f8eSopenharmony_ci * WantAgent object. 80061847f8eSopenharmony_ci * 80161847f8eSopenharmony_ci * @typedef { object } 80261847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 80361847f8eSopenharmony_ci * @since 7 80461847f8eSopenharmony_ci */ 80561847f8eSopenharmony_ci/** 80661847f8eSopenharmony_ci * WantAgent object. 80761847f8eSopenharmony_ci * 80861847f8eSopenharmony_ci * @typedef { object } 80961847f8eSopenharmony_ci * @syscap SystemCapability.Ability.AbilityRuntime.Core 81061847f8eSopenharmony_ci * @atomicservice 81161847f8eSopenharmony_ci * @since 12 81261847f8eSopenharmony_ci */ 81361847f8eSopenharmony_ciexport type WantAgent = object; 81461847f8eSopenharmony_ci 81561847f8eSopenharmony_ciexport default wantAgent; 816