From 358f487c91f8dbe378ab5794c6089bae607f99e5 Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Thu, 23 Jun 2022 20:08:30 +0800 Subject: [PATCH 1/2] change version to 9, and add system annonation to plugin Signed-off-by: Yao yuchi --- api/@internal/component/ets/pattern_lock.d.ts | 30 ++--- .../component/ets/plugin_component.d.ts | 32 ++--- api/@ohos.pluginComponent.d.ts | 122 ++++++++++++++++-- 3 files changed, 140 insertions(+), 44 deletions(-) diff --git a/api/@internal/component/ets/pattern_lock.d.ts b/api/@internal/component/ets/pattern_lock.d.ts index efc54d9d3b..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 @@ -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; diff --git a/api/@internal/component/ets/plugin_component.d.ts b/api/@internal/component/ets/plugin_component.d.ts index 47300deaa7..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 @@ -15,53 +15,55 @@ /** * 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; } /** * 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; } /** * Defines the plugin component attibute functions. - * @since 8 + * @since 9 + * @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 + * @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 f264256223..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 @@ -19,7 +19,8 @@ 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 { source: string; @@ -29,37 +30,95 @@ interface PluginComponentTemplate { /** * Plugin component manager interface. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 8 + * @since 9 + * @systemapi Hide this for inner system use. */ 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 + * @since 9 + * @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 + * @since 9 + * @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 + * @since 9 + * @systemapi Hide this for inner system use. */ interface RequestCallbackParameters { componentTemplate: PluginComponentTemplate; @@ -69,7 +128,8 @@ declare namespace pluginComponentManager { /** * Plugin component request event result value. - * @since 8 + * @since 9 + * @systemapi Hide this for inner system use. */ interface RequestEventResult { template?: string; @@ -79,35 +139,69 @@ 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, extraData: KVObject) => void; /** * 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; + /** + * Plugin component push method. + * @since 9 + * @systemapi Hide this for inner system use. + */ + function push(param: PushParameters): Promise; + /** * Plugin component request method. - * @since 8 + * @since 9 + * @systemapi Hide this for inner system use. */ function request(param: RequestParameters, callback: AsyncCallback): void; /** - * Plugin component event listener. - * @since 8 + * 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. */ 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 From 64d114e3bb76f61aa7274ce67a768f02e21352d8 Mon Sep 17 00:00:00 2001 From: Yao yuchi Date: Thu, 23 Jun 2022 22:27:46 +0800 Subject: [PATCH 2/2] 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