From fd955245e7d96d655f9ba9d2ebaaf27b9e642cfe Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Wed, 18 May 2022 18:53:01 +0800 Subject: [PATCH 1/7] plugin component sdk Signed-off-by: Yao yuchi --- BUILD.gn | 1 + .../component/ets/plugin_component.d.ts | 14 +-- api/@ohos.pluginComponent.d.ts | 85 ++++++++++++++++++- 3 files changed, 92 insertions(+), 8 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 735000f5be..d797807215 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -75,6 +75,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/page_transition.d.ts", "api/@internal/component/ets/panel.d.ts", "api/@internal/component/ets/path.d.ts", + "api/@internal/component/ets/plugin_component.d.ts", "api/@internal/component/ets/polygon.d.ts", "api/@internal/component/ets/polyline.d.ts", "api/@internal/component/ets/progress.d.ts", diff --git a/api/@internal/component/ets/plugin_component.d.ts b/api/@internal/component/ets/plugin_component.d.ts index 47300deaa7..04c82c423f 100644 --- a/api/@internal/component/ets/plugin_component.d.ts +++ b/api/@internal/component/ets/plugin_component.d.ts @@ -16,16 +16,19 @@ /** * PluginComponentTemplate * @since 8 + * @systemapi Hide this for inner system use. */ interface PluginComponentTemplate { /** * Defines the plugin source name. * @since 8 + * @systemapi Hide this for inner system use. */ source: string; /** * Defines the ability name. * @since 8 + * @systemapi Hide this for inner system use. */ ability: string; } @@ -33,11 +36,13 @@ interface PluginComponentTemplate { /** * Provides plugin component. * @since 8 + * @systemapi Hide this for inner system use. */ interface PluginComponentInterface { /** * Called when setting the plugin. * @since 8 + * @systemapi Hide this for inner system use. */ (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; } @@ -45,23 +50,20 @@ interface PluginComponentInterface { /** * Defines the plugin component attibute functions. * @since 8 + * @systemapi Hide this for inner system use. */ declare class PluginComponentAttribute extends CommonMethod { - /** - * Set pluginComponent size, - * @since 8 - */ - size(value: { width: number; height: number }): PluginComponentAttribute; - /** * pluginComponent onComplete callback, * @since 8 + * @systemapi Hide this for inner system use. */ onComplete(callback: () => void): PluginComponentAttribute; /** * pluginComponent onError callback, * @since 8 + * @systemapi Hide this for inner system use. */ onError(callback: (info: { errcode: number; msg: string }) => void): PluginComponentAttribute; } diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index f264256223..d2f0f1bd01 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -20,6 +20,7 @@ import Want from './@ohos.application.want'; * Plugin component template property. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 + * @systemapi Hide this for inner system use. */ interface PluginComponentTemplate { source: string; @@ -34,32 +35,89 @@ interface PluginComponentTemplate { declare namespace pluginComponentManager { type KVObject = {[key: string]: number | string | boolean | [] | KVObject} + /** + * Plugin component event listener type + * @since 9 + * @systemapi Hide this for inner system use. + */ + export enum EventType { + /** + * Indicates the event type of push. + * @since 9 + */ + EVENT_TYPE_PUSH = "push", + + /** + * Indicates the event type of request. + * @since 9 + */ + EVENT_TYPE_REQUEST = "request" + } + /** * Plugin component push parameters. * @since 8 + * @systemapi Hide this for inner system use. */ interface PushParameters { + /** + * Indicates the want of the caller. + */ + owner: Want; + /** + * Indicates the want of the plugin template App. + */ want: Want; + /** + * Indicates the name of the template. + */ name: string; + /** + * Represents the data passed to the template. + */ data: KVObject; + /** + * Represents extended data passed to the template. + */ extraData: KVObject; + /** + * Represents the path to the template json configuration file. + */ jsonPath?: string; } /** * Plugin component request parameters. * @since 8 + * @systemapi Hide this for inner system use. */ interface RequestParameters { + /** + * Indicates the want of the caller. + */ + owner: Want; + /** + * Indicates the want of the plugin template App. + */ want: Want; + /** + * Indicates the name of the template. + */ name: string; + /** + * Represents the data passed to the template. + */ data: KVObject; + /** + * Represents the path to the template's json configuration file. + */ jsonPath?: string; } /** * Plugin component request callback parameters. * @since 8 + * @systemapi Hide this for inner system use. */ interface RequestCallbackParameters { componentTemplate: PluginComponentTemplate; @@ -70,6 +128,7 @@ declare namespace pluginComponentManager { /** * Plugin component request event result value. * @since 8 + * @systemapi Hide this for inner system use. */ interface RequestEventResult { template?: string; @@ -80,6 +139,7 @@ declare namespace pluginComponentManager { /** * Plugin component push event callback. * @since 8 + * @systemapi Hide this for inner system use. */ type OnPushEventCallback = (source: Want, template: PluginComponentTemplate, data: KVObject, extraData: KVObject) => void; @@ -87,27 +147,48 @@ declare namespace pluginComponentManager { /** * Plugin component request event callback. * @since 8 + * @systemapi Hide this for inner system use. */ - type OnRequestEventCallback = (source: Want, name: string, data: KVObject) => RequestEventResult; /** * Plugin component push method. * @since 8 + * @systemapi Hide this for inner system use. */ function push(param: PushParameters, callback: AsyncCallback): void; + function push(param: PushParameters): Promise; /** * Plugin component request method. * @since 8 + * @systemapi Hide this for inner system use. */ function request(param: RequestParameters, callback: AsyncCallback): void; + function request(param: RequestParameters): Promise; /** - * Plugin component event listener. + * Plugin component on event listener. * @since 8 + * @systemapi Hide this for inner system use. */ function on(eventType: string, callback: OnPushEventCallback | OnRequestEventCallback): void; + + /** + * Plugin component on event listener. + * @param owner Indicates the want of the caller. + * @since 9 + * @systemapi Hide this for inner system use. + */ + function on(owner: Want, eventType: EventType, callback: OnPushEventCallback | OnRequestEventCallback): void; + + /** + * Plugin component cancel event listener. + * @param owner Indicates the want of the caller. + * @since 8 + * @systemapi Hide this for inner system use. + */ + function off(owner: Want, callback: AsyncCallback): void; } export default pluginComponentManager; -- Gitee From c6e5b4a8d33f117020dffe4498b6ee2f1ba1e664 Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Thu, 23 Jun 2022 16:57:56 +0800 Subject: [PATCH 2/7] change api version to 9 and add annotation of system api Signed-off-by: Yao yuchi --- .../component/ets/plugin_component.d.ts | 16 ++++++------- api/@ohos.pluginComponent.d.ts | 24 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/api/@internal/component/ets/plugin_component.d.ts b/api/@internal/component/ets/plugin_component.d.ts index 04c82c423f..a09f5eaf15 100644 --- a/api/@internal/component/ets/plugin_component.d.ts +++ b/api/@internal/component/ets/plugin_component.d.ts @@ -15,19 +15,19 @@ /** * PluginComponentTemplate - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ interface PluginComponentTemplate { /** * Defines the plugin source name. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ source: string; /** * Defines the ability name. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ ability: string; @@ -35,13 +35,13 @@ interface PluginComponentTemplate { /** * Provides plugin component. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ interface PluginComponentInterface { /** * Called when setting the plugin. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; @@ -49,20 +49,20 @@ interface PluginComponentInterface { /** * Defines the plugin component attibute functions. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ declare class PluginComponentAttribute extends CommonMethod { /** * pluginComponent onComplete callback, - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ onComplete(callback: () => void): PluginComponentAttribute; /** * pluginComponent onError callback, - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ onError(callback: (info: { errcode: number; msg: string }) => void): PluginComponentAttribute; diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index d2f0f1bd01..08074f200b 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -19,7 +19,7 @@ import Want from './@ohos.application.want'; /** * Plugin component template property. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ interface PluginComponentTemplate { @@ -30,7 +30,7 @@ interface PluginComponentTemplate { /** * Plugin component manager interface. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 + * @since 9 */ declare namespace pluginComponentManager { type KVObject = {[key: string]: number | string | boolean | [] | KVObject} @@ -56,7 +56,7 @@ declare namespace pluginComponentManager { /** * Plugin component push parameters. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ interface PushParameters { @@ -88,7 +88,7 @@ declare namespace pluginComponentManager { /** * Plugin component request parameters. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ interface RequestParameters { @@ -116,7 +116,7 @@ declare namespace pluginComponentManager { /** * Plugin component request callback parameters. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ interface RequestCallbackParameters { @@ -127,7 +127,7 @@ declare namespace pluginComponentManager { /** * Plugin component request event result value. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ interface RequestEventResult { @@ -138,7 +138,7 @@ declare namespace pluginComponentManager { /** * Plugin component push event callback. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ type OnPushEventCallback = (source: Want, template: PluginComponentTemplate, data: KVObject, @@ -146,14 +146,14 @@ declare namespace pluginComponentManager { /** * Plugin component request event callback. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ type OnRequestEventCallback = (source: Want, name: string, data: KVObject) => RequestEventResult; /** * Plugin component push method. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ function push(param: PushParameters, callback: AsyncCallback): void; @@ -161,7 +161,7 @@ declare namespace pluginComponentManager { /** * Plugin component request method. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ function request(param: RequestParameters, callback: AsyncCallback): void; @@ -169,7 +169,7 @@ declare namespace pluginComponentManager { /** * Plugin component on event listener. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ function on(eventType: string, callback: OnPushEventCallback | OnRequestEventCallback): void; @@ -185,7 +185,7 @@ declare namespace pluginComponentManager { /** * Plugin component cancel event listener. * @param owner Indicates the want of the caller. - * @since 8 + * @since 9 * @systemapi Hide this for inner system use. */ function off(owner: Want, callback: AsyncCallback): void; -- Gitee From 65e174ad52665cc3c253e46f26f8fbdc1ed489d8 Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Thu, 23 Jun 2022 17:16:56 +0800 Subject: [PATCH 3/7] update version to 9 and add systemapi annonation to plugin Signed-off-by: Yao yuchi --- api/@ohos.pluginComponent.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index 08074f200b..4b3c7c0811 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -31,6 +31,7 @@ interface PluginComponentTemplate { * Plugin component manager interface. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 + * @systemapi Hide this for inner system use. */ declare namespace pluginComponentManager { type KVObject = {[key: string]: number | string | boolean | [] | KVObject} -- Gitee From 3b57cf2b4723537eb4a258ad4ba902114bda9358 Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Thu, 23 Jun 2022 17:25:41 +0800 Subject: [PATCH 4/7] change version to 9 for plugin and locker, and add systemapi annonation to plugin Signed-off-by: Yao yuchi --- api/@internal/component/ets/pattern_lock.d.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/api/@internal/component/ets/pattern_lock.d.ts b/api/@internal/component/ets/pattern_lock.d.ts index efc54d9d3b..1433f57130 100644 --- a/api/@internal/component/ets/pattern_lock.d.ts +++ b/api/@internal/component/ets/pattern_lock.d.ts @@ -15,7 +15,7 @@ /** * Provides methods for control pattern lock component. - * @since 8 + * @since 9 */ declare class PatternLockController { /** @@ -31,76 +31,76 @@ declare class PatternLockController { /** * Provides an interface for generating PatternLock. - * @since 8 + * @since 9 */ interface PatternLockInterface { (controller?: PatternLockController): PatternLockAttribute; } /** - * @since 8 + * @since 9 */ declare class PatternLockAttribute extends CommonMethod { /** * The square side length of pattern lock component. - * @since 8 + * @since 9 */ sideLength(value: Length): PatternLockAttribute; /** * Circle radius. - * @since 8 + * @since 9 */ circleRadius(value: Length): PatternLockAttribute; /** * The background color. - * @since 8 + * @since 9 */ backgroundColor(value: ResourceColor): PatternLockAttribute; /** * Regular color. - * @since 8 + * @since 9 */ regularColor(value: ResourceColor): PatternLockAttribute; /** * The color when cell is selected. - * @since 8 + * @since 9 */ selectedColor(value: ResourceColor): PatternLockAttribute; /** * The color when cell is active state. - * @since 8 + * @since 9 */ activeColor(value: ResourceColor): PatternLockAttribute; /** * The path line color. - * @since 8 + * @since 9 */ pathColor(value: ResourceColor): PatternLockAttribute; /** * The path line stroke width. - * @since 8 + * @since 9 */ pathStrokeWidth(value: number | string): PatternLockAttribute; /** * Called when the pattern input completed. - * @since 8 + * @since 9 */ onPatternComplete(callback: (input: Array) => void): PatternLockAttribute; /** * Called when judging whether the input state can be reset by touch pattern lock. - * @since 8 + * @since 9 */ autoReset(value: boolean): PatternLockAttribute; } declare const PatternLock: PatternLockInterface; -declare const PatternLockInstance: PatternLockAttribute; \ No newline at end of file +declare const PatternLockInstance: PatternLockAttribute; -- Gitee From 154c2f7c9d1863b632e1876e2effb30a2fee8bad Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Thu, 23 Jun 2022 17:36:45 +0800 Subject: [PATCH 5/7] change version to 9 for plugin and locker, and add systemapi annonation to plugin Signed-off-by: Yao yuchi --- api/@ohos.pluginComponent.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index 4b3c7c0811..2c63a25c84 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -158,6 +158,12 @@ declare namespace pluginComponentManager { * @systemapi Hide this for inner system use. */ function push(param: PushParameters, callback: AsyncCallback): void; + + /** + * Plugin component push method. + * @since 9 + * @systemapi Hide this for inner system use. + */ function push(param: PushParameters): Promise; /** @@ -166,6 +172,12 @@ declare namespace pluginComponentManager { * @systemapi Hide this for inner system use. */ function request(param: RequestParameters, callback: AsyncCallback): void; + + /** + * Plugin component request method. + * @since 9 + * @systemapi Hide this for inner system use. + */ function request(param: RequestParameters): Promise; /** -- Gitee From d9eeb91e773c5292f181752a17eaf88178421e0d Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Thu, 23 Jun 2022 20:30:30 +0800 Subject: [PATCH 6/7] change version to 9, and add system annonation to plugin Signed-off-by: Yao yuchi --- api/@internal/component/ets/pattern_lock.d.ts | 2 +- api/@internal/component/ets/plugin_component.d.ts | 2 +- api/@ohos.pluginComponent.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@internal/component/ets/pattern_lock.d.ts b/api/@internal/component/ets/pattern_lock.d.ts index 1433f57130..42f74a112a 100644 --- a/api/@internal/component/ets/pattern_lock.d.ts +++ b/api/@internal/component/ets/pattern_lock.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * 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 diff --git a/api/@internal/component/ets/plugin_component.d.ts b/api/@internal/component/ets/plugin_component.d.ts index a09f5eaf15..db32d8d789 100644 --- a/api/@internal/component/ets/plugin_component.d.ts +++ b/api/@internal/component/ets/plugin_component.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * 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 diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index 2c63a25c84..5a555a7415 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * 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 -- Gitee From a6ebdde9eb1b3dc4e673e60dcb90904b29379b69 Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Thu, 23 Jun 2022 22:01:02 +0800 Subject: [PATCH 7/7] update version and annonation of plugin Signed-off-by: Yao yuchi --- .../component/ets/plugin_component.d.ts | 16 +-- api/@ohos.pluginComponent.d.ts | 122 ++---------------- 2 files changed, 22 insertions(+), 116 deletions(-) diff --git a/api/@internal/component/ets/plugin_component.d.ts b/api/@internal/component/ets/plugin_component.d.ts index db32d8d789..08ddae847e 100644 --- a/api/@internal/component/ets/plugin_component.d.ts +++ b/api/@internal/component/ets/plugin_component.d.ts @@ -16,19 +16,19 @@ /** * PluginComponentTemplate * @since 9 - * @systemapi Hide this for inner system use. + * @systemapi */ interface PluginComponentTemplate { /** * Defines the plugin source name. * @since 9 - * @systemapi Hide this for inner system use. + * @systemapi */ source: string; /** * Defines the ability name. * @since 9 - * @systemapi Hide this for inner system use. + * @systemapi */ ability: string; } @@ -36,13 +36,13 @@ interface PluginComponentTemplate { /** * Provides plugin component. * @since 9 - * @systemapi Hide this for inner system use. + * @systemapi */ interface PluginComponentInterface { /** * Called when setting the plugin. * @since 9 - * @systemapi Hide this for inner system use. + * @systemapi */ (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; } @@ -50,20 +50,20 @@ interface PluginComponentInterface { /** * Defines the plugin component attibute functions. * @since 9 - * @systemapi Hide this for inner system use. + * @systemapi */ declare class PluginComponentAttribute extends CommonMethod { /** * pluginComponent onComplete callback, * @since 9 - * @systemapi Hide this for inner system use. + * @systemapi */ onComplete(callback: () => void): PluginComponentAttribute; /** * pluginComponent onError callback, * @since 9 - * @systemapi Hide this for inner system use. + * @systemapi */ onError(callback: (info: { errcode: number; msg: string }) => void): PluginComponentAttribute; } diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index 5a555a7415..f264256223 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 @@ -19,8 +19,7 @@ import Want from './@ohos.application.want'; /** * Plugin component template property. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ interface PluginComponentTemplate { source: string; @@ -30,95 +29,37 @@ interface PluginComponentTemplate { /** * Plugin component manager interface. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ declare namespace pluginComponentManager { type KVObject = {[key: string]: number | string | boolean | [] | KVObject} - /** - * Plugin component event listener type - * @since 9 - * @systemapi Hide this for inner system use. - */ - export enum EventType { - /** - * Indicates the event type of push. - * @since 9 - */ - EVENT_TYPE_PUSH = "push", - - /** - * Indicates the event type of request. - * @since 9 - */ - EVENT_TYPE_REQUEST = "request" - } - /** * Plugin component push parameters. - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ interface PushParameters { - /** - * Indicates the want of the caller. - */ - owner: Want; - /** - * Indicates the want of the plugin template App. - */ want: Want; - /** - * Indicates the name of the template. - */ name: string; - /** - * Represents the data passed to the template. - */ data: KVObject; - /** - * Represents extended data passed to the template. - */ extraData: KVObject; - /** - * Represents the path to the template json configuration file. - */ jsonPath?: string; } /** * Plugin component request parameters. - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ interface RequestParameters { - /** - * Indicates the want of the caller. - */ - owner: Want; - /** - * Indicates the want of the plugin template App. - */ want: Want; - /** - * Indicates the name of the template. - */ name: string; - /** - * Represents the data passed to the template. - */ data: KVObject; - /** - * Represents the path to the template's json configuration file. - */ jsonPath?: string; } /** * Plugin component request callback parameters. - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ interface RequestCallbackParameters { componentTemplate: PluginComponentTemplate; @@ -128,8 +69,7 @@ declare namespace pluginComponentManager { /** * Plugin component request event result value. - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ interface RequestEventResult { template?: string; @@ -139,69 +79,35 @@ declare namespace pluginComponentManager { /** * Plugin component push event callback. - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ type OnPushEventCallback = (source: Want, template: PluginComponentTemplate, data: KVObject, extraData: KVObject) => void; /** * Plugin component request event callback. - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ + type OnRequestEventCallback = (source: Want, name: string, data: KVObject) => RequestEventResult; /** * Plugin component push method. - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ function push(param: PushParameters, callback: AsyncCallback): void; - /** - * Plugin component push method. - * @since 9 - * @systemapi Hide this for inner system use. - */ - function push(param: PushParameters): Promise; - /** * Plugin component request method. - * @since 9 - * @systemapi Hide this for inner system use. + * @since 8 */ function request(param: RequestParameters, callback: AsyncCallback): void; /** - * Plugin component request method. - * @since 9 - * @systemapi Hide this for inner system use. - */ - function request(param: RequestParameters): Promise; - - /** - * Plugin component on event listener. - * @since 9 - * @systemapi Hide this for inner system use. + * Plugin component event listener. + * @since 8 */ function on(eventType: string, callback: OnPushEventCallback | OnRequestEventCallback): void; - - /** - * Plugin component on event listener. - * @param owner Indicates the want of the caller. - * @since 9 - * @systemapi Hide this for inner system use. - */ - function on(owner: Want, eventType: EventType, callback: OnPushEventCallback | OnRequestEventCallback): void; - - /** - * Plugin component cancel event listener. - * @param owner Indicates the want of the caller. - * @since 9 - * @systemapi Hide this for inner system use. - */ - function off(owner: Want, callback: AsyncCallback): void; } export default pluginComponentManager; -- Gitee