2022-01-10 15:22:18 +00:00
|
|
|
/*
|
2023-01-18 10:34:36 +00:00
|
|
|
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
|
2022-01-10 15:22:18 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* @kit ArkUI
|
|
|
|
*/
|
|
|
|
|
2023-04-04 02:17:06 +00:00
|
|
|
import { AsyncCallback } from './@ohos.base';
|
2022-12-14 03:13:53 +00:00
|
|
|
import Want from './@ohos.app.ability.Want';
|
2022-01-10 15:22:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin component template property.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @interface PluginComponentTemplate
|
2022-03-02 11:32:45 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component template property.
|
|
|
|
*
|
|
|
|
* @interface PluginComponentTemplate
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
interface PluginComponentTemplate {
|
2024-01-23 08:45:39 +00:00
|
|
|
/**
|
|
|
|
* Defines the source
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines the source
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
source: string;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the ability
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines the ability
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
ability: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin component manager interface.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @namespace pluginComponentManager
|
2022-03-02 11:32:45 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component manager interface.
|
|
|
|
*
|
|
|
|
* @namespace pluginComponentManager
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
declare namespace pluginComponentManager {
|
2024-01-23 08:45:39 +00:00
|
|
|
/**
|
|
|
|
* Defines KVObject
|
|
|
|
*
|
2024-07-24 08:02:26 +00:00
|
|
|
* @typedef { object } KVObject
|
2024-01-23 08:45:39 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines KVObject
|
|
|
|
*
|
2024-07-24 08:02:26 +00:00
|
|
|
* @typedef { object } KVObject
|
2024-07-16 04:01:05 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-01-18 10:34:36 +00:00
|
|
|
type KVObject = { [key: string]: number | string | boolean | [] | KVObject }
|
2022-01-10 15:22:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin component push parameters.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @interface PushParameters
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component push parameters.
|
|
|
|
*
|
|
|
|
* @interface PushParameters
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
interface PushParameters {
|
2024-01-23 08:45:39 +00:00
|
|
|
/**
|
|
|
|
* Defines want.
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines want.
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
want: Want;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines name.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines name.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
name: string;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
data: KVObject;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines extraData.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines extraData.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
extraData: KVObject;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines jsonPath.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines jsonPath.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
jsonPath?: string;
|
|
|
|
}
|
|
|
|
|
2022-12-16 08:06:13 +00:00
|
|
|
/**
|
2023-07-06 09:26:10 +00:00
|
|
|
* Plugin component push parameters which is used in push function.
|
|
|
|
*
|
|
|
|
* @interface PushParameterForStage
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
interface PushParameterForStage {
|
2024-01-23 08:45:39 +00:00
|
|
|
/**
|
|
|
|
* Defines owner.
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
owner: Want;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines target.
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-01-18 10:34:36 +00:00
|
|
|
target: Want;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines name.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
name: string;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
data: KVObject;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines extraData.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
extraData: KVObject;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines jsonPath.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
jsonPath?: string;
|
|
|
|
}
|
|
|
|
|
2022-01-10 15:22:18 +00:00
|
|
|
/**
|
|
|
|
* Plugin component request parameters.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @interface RequestParameters
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component request parameters.
|
|
|
|
*
|
|
|
|
* @interface RequestParameters
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
interface RequestParameters {
|
2024-01-23 08:45:39 +00:00
|
|
|
/**
|
|
|
|
* Defines want.
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines want.
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
want: Want;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines name.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines name.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
name: string;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
data: KVObject;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines jsonPath.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines jsonPath.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
jsonPath?: string;
|
|
|
|
}
|
|
|
|
|
2022-12-16 08:06:13 +00:00
|
|
|
/**
|
2023-07-06 09:26:10 +00:00
|
|
|
* Plugin component request parameters which is used in request function.
|
|
|
|
*
|
|
|
|
* @interface RequestParameterForStage
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
interface RequestParameterForStage {
|
2024-01-23 08:45:39 +00:00
|
|
|
/**
|
|
|
|
* Defines owner.
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
owner: Want;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines target.
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-01-18 10:34:36 +00:00
|
|
|
target: Want;
|
2024-01-23 08:45:39 +00:00
|
|
|
/**
|
|
|
|
* Defines name.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
name: string;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
data: KVObject;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines jsonPath.
|
|
|
|
*
|
2024-01-23 09:42:45 +00:00
|
|
|
* @type { ?string }
|
2024-01-23 08:45:39 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
jsonPath?: string;
|
|
|
|
}
|
|
|
|
|
2022-01-10 15:22:18 +00:00
|
|
|
/**
|
|
|
|
* Plugin component request callback parameters.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @interface RequestCallbackParameters
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component request callback parameters.
|
|
|
|
*
|
|
|
|
* @interface RequestCallbackParameters
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
interface RequestCallbackParameters {
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines componentTemplate.
|
|
|
|
*
|
|
|
|
* @type { PluginComponentTemplate }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines componentTemplate.
|
|
|
|
*
|
|
|
|
* @type { PluginComponentTemplate }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
componentTemplate: PluginComponentTemplate;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
data: KVObject;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines extraData.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines extraData.
|
|
|
|
*
|
|
|
|
* @type { KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
extraData: KVObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin component request event result value.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @interface RequestEventResult
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component request event result value.
|
|
|
|
*
|
|
|
|
* @interface RequestEventResult
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
interface RequestEventResult {
|
2024-01-23 08:45:39 +00:00
|
|
|
/**
|
|
|
|
* Defines template.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines template.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
template?: string;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { ?KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines data.
|
|
|
|
*
|
|
|
|
* @type { ?KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
data?: KVObject;
|
2024-01-23 08:45:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines extraData.
|
|
|
|
*
|
|
|
|
* @type { ?KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Defines extraData.
|
|
|
|
*
|
|
|
|
* @type { ?KVObject }
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
extraData?: KVObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin component push event callback.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
2024-07-24 08:02:26 +00:00
|
|
|
* @typedef { function } OnPushEventCallback
|
2023-07-06 09:26:10 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component push event callback.
|
|
|
|
*
|
2024-07-24 08:02:26 +00:00
|
|
|
* @typedef { function } OnPushEventCallback
|
2024-07-16 04:01:05 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
type OnPushEventCallback = (source: Want, template: PluginComponentTemplate, data: KVObject,
|
|
|
|
extraData: KVObject) => void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin component request event callback.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
2024-07-24 08:02:26 +00:00
|
|
|
* @typedef { function } OnRequestEventCallback
|
2023-07-06 09:26:10 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component request event callback.
|
|
|
|
*
|
2024-07-24 08:02:26 +00:00
|
|
|
* @typedef { function } OnRequestEventCallback
|
2024-11-21 09:50:05 +00:00
|
|
|
* @returns { RequestEventResult } Returns the RequestEventResult.
|
2024-07-16 04:01:05 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
type OnRequestEventCallback = (source: Want, name: string, data: KVObject) => RequestEventResult;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin component push method.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @param { PushParameters } param
|
|
|
|
* @param { AsyncCallback<void> } callback
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component push method.
|
|
|
|
*
|
|
|
|
* @param { PushParameters } param
|
|
|
|
* @param { AsyncCallback<void> } callback
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
function push(param: PushParameters, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plugin component request method.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @param { RequestParameters } param
|
|
|
|
* @param { AsyncCallback<RequestCallbackParameters> } callback
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component request method.
|
|
|
|
*
|
|
|
|
* @param { RequestParameters } param
|
|
|
|
* @param { AsyncCallback<RequestCallbackParameters> } callback
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
function request(param: RequestParameters, callback: AsyncCallback<RequestCallbackParameters>): void;
|
|
|
|
|
2022-12-16 08:06:13 +00:00
|
|
|
/**
|
2023-07-06 09:26:10 +00:00
|
|
|
* Plugin component push method used to send the information of the template it provides.
|
|
|
|
*
|
|
|
|
* @param { PushParameterForStage } param - Plugin component push parameters for stage.
|
|
|
|
* @param { AsyncCallback<void> } callback - Plugin component push event callback.
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
|
|
|
*/
|
2022-12-16 08:06:13 +00:00
|
|
|
function push(param: PushParameterForStage, callback: AsyncCallback<void>): void;
|
|
|
|
|
|
|
|
/**
|
2023-01-18 10:34:36 +00:00
|
|
|
* Plugin component request method used to send a request for the information of the template it wants.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @param { RequestParameterForStage } param - Plugin component request parameters for stage.
|
2023-01-18 10:34:36 +00:00
|
|
|
* @param { AsyncCallback<RequestCallbackParameters> } callback - Plugin component request event callback.
|
2023-07-06 09:26:10 +00:00
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @systemapi
|
2022-12-16 08:06:13 +00:00
|
|
|
* @StageModelOnly
|
|
|
|
* @since 9
|
|
|
|
*/
|
|
|
|
function request(param: RequestParameterForStage, callback: AsyncCallback<RequestCallbackParameters>): void;
|
|
|
|
|
2022-01-10 15:22:18 +00:00
|
|
|
/**
|
|
|
|
* Plugin component event listener.
|
2023-07-06 09:26:10 +00:00
|
|
|
*
|
|
|
|
* @param { string } eventType
|
|
|
|
* @param { OnPushEventCallback | OnRequestEventCallback } callback
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
2022-01-10 15:22:18 +00:00
|
|
|
* @since 8
|
|
|
|
*/
|
2024-07-16 04:01:05 +00:00
|
|
|
/**
|
|
|
|
* Plugin component event listener.
|
|
|
|
*
|
|
|
|
* @param { string } eventType
|
|
|
|
* @param { OnPushEventCallback | OnRequestEventCallback } callback
|
|
|
|
* @syscap SystemCapability.ArkUI.ArkUI.Full
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-01-10 15:22:18 +00:00
|
|
|
function on(eventType: string, callback: OnPushEventCallback | OnRequestEventCallback): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default pluginComponentManager;
|
2023-12-26 01:57:28 +00:00
|
|
|
export type { PluginComponentTemplate };
|