From 1d6531529642bb8e1eac5173dd9a585f83b7bf2b Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Wed, 15 Sep 2021 20:05:13 +0800 Subject: [PATCH 1/2] zhongjianfei@huawei.com Signed-off-by: zhongjianfei Change-Id: Idb68055f994f7e2d5f9a49e707a6f104e25f02dc --- api/@internal/ets/lifecycle.d.ts | 67 +++++++++----------------------- 1 file changed, 19 insertions(+), 48 deletions(-) diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 96929a8a53..9de0222be0 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + import { Want } from "../ability/want"; import { ResultSet } from "../data/rdb/resultSet"; import { AbilityInfo } from "../bundle/abilityInfo"; @@ -22,8 +22,8 @@ import dataAbility from "../@ohos.data.dataAbility"; import formBindingData from "../@ohos.ability.formBindingData"; import formManager from "../@ohos.ability.formManager"; import rdb from "../@ohos.data.rdb"; -import rpc from "../@ohos.rpc"; import resourceManager from "../@ohos.resourceManager"; +import { PacMap } from "../ability/dataAbilityHelper"; /** * interface of form lifecycle. @@ -40,7 +40,7 @@ export declare interface LifecycleForm { * @devices phone, tablet * @since 7 * @sysCap AAFwk - * @param intent Indicates the detailed information for creating a {@link formBindingData.FormBindingData}. + * @param want Indicates the detailed information for creating a {@link formBindingData.FormBindingData}. * The {@code Want} object must include the form ID, form name, and grid style of the form, * which can be obtained from {@link formManager.FormParam#IDENTITY_KEY}, * {@link formManager.FormParam#NAME_KEY}, and {@link formManager.FormParam#DIMENSION_KEY}, @@ -64,13 +64,10 @@ export declare interface LifecycleForm { /** * Called to notify the form provider to update a specified form. * - *

The Service ability must have been started but not been destroyed, that is, {@link #startAbility} has been - * called but {@link #terminateSelf} has not.

- * * @devices phone, tablet * @since 7 * @sysCap AAFwk - * @param formId Indicates the ID of the deleted form. + * @param formId Indicates the ID of the form to update. * @return - */ onUpdate?(formId: string): void; @@ -87,7 +84,7 @@ export declare interface LifecycleForm { * and {@link #FORM_INVISIBLE} means that the form becomes invisible. * @return - */ - onVisibilityChanged?(newStatus: { [key: number]: number }): void; + onVisibilityChanged?(newStatus: { [key: string]: number }): void; /** * Called when a specified message event defined by the form provider is triggered. This method is valid only for @@ -253,7 +250,6 @@ export declare interface LifecycleApp { * @devices phone, tablet * @since 7 * @sysCap AAFwk - * @param data Indicates the user data to restore. * @return - */ onRemoteTerminated?(): void; @@ -293,43 +289,6 @@ export declare interface LifecycleService { */ onCommand?(want: Want, startId: number): void; - /** - * Called back when a Service ability is first connected to an ability. - * - * @devices phone, tablet - * @since 7 - * @sysCap AAFwk - * @param want Indicates connection information about the Service ability. - * @return Returns the proxy of the Service ability. - */ - onConnect?(want: Want): rpc.RemoteObject; - - /** - * Called back when all abilities connected to a Service ability are disconnected. - * - * @devices phone, tablet - * @since 7 - * @sysCap AAFwk - * @param want Indicates disconnection information about the Service ability. - * @return - - */ - onDisconnect?(want: Want): void; - - /** - * Called when a new client attempts to connect to a Service ability after all previous client connections to it - * are disconnected. - * - *

The Service ability must have been started but not been destroyed, that is, {@link #startAbility} has been - * called but {@link #terminateSelf} has not.

- * - * @devices phone, tablet - * @since 7 - * @sysCap AAFwk - * @param want Indicates the want of the Service ability being connected. - * @return - - */ - onReconnect?(want: Want): void; - /** * Called back before an ability is destroyed. * @@ -417,6 +376,18 @@ export declare interface LifecycleData { */ normalizeUri?(uri: string): string; + /** + * Inserts multiple data records into the database. This method should be implemented by a Data ability. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param uri Indicates the position where the data is to insert. + * @param valueBuckets Indicates the data to insert. + * @return Returns the number of data records inserted. + */ + batchInsert?(uri: string, valueBuckets: Array): number; + /** * Converts the given normalized {@code uri} generated by {@link #normalizeUri(uri)} into a denormalized one. * The default implementation of this method returns the original uri passed to it. @@ -485,7 +456,7 @@ export declare interface LifecycleData { * @param extras Indicates the parameter transferred by the method. * @return Returns the result of the method. */ - call?(method: string, arg: string, extras: Object): Object; + call?(method: string, arg: string, extras: PacMap): PacMap; /** * Called to carry {@code AbilityInfo} to this ability after the ability is initialized. @@ -511,4 +482,4 @@ export declare interface LifecycleData { * @return Returns the MIME type that matches the data specified by {@code uri}. */ getType?(uri: string): string; -} +} \ No newline at end of file -- Gitee From 0463b1df49a8e91a1c7828581108a0fce368142d Mon Sep 17 00:00:00 2001 From: zhongjianfei Date: Fri, 17 Sep 2021 21:02:12 +0800 Subject: [PATCH 2/2] zhongjianfei@huawei.com Signed-off-by: zhongjianfei Change-Id: Ica0a44b6a60dce9ecd2973087163284e39a87424 --- api/@internal/component/ets/textarea.d.ts | 1 - api/@internal/component/ets/textinput.d.ts | 43 ++++++++-------------- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/api/@internal/component/ets/textarea.d.ts b/api/@internal/component/ets/textarea.d.ts index 91fb656edf..b2cf605b34 100644 --- a/api/@internal/component/ets/textarea.d.ts +++ b/api/@internal/component/ets/textarea.d.ts @@ -31,7 +31,6 @@ declare class TextAreaAttribute extends CommonMethod { placeholderFont(value:{ size: number, weight: FontWeight, fontFamily: string | Resource, style: FontStyle }): T; textAlign(value: TextAlign): T; caretColor(value: Color): T; - correction(value: boolean): T; onChange(callback: (value: string) => void): T; } diff --git a/api/@internal/component/ets/textinput.d.ts b/api/@internal/component/ets/textinput.d.ts index 60a367e5d3..99fb150c81 100644 --- a/api/@internal/component/ets/textinput.d.ts +++ b/api/@internal/component/ets/textinput.d.ts @@ -16,30 +16,19 @@ import {CommonMethod, Color, Resource} from "./common"; import {FontWeight, FontStyle} from "./text"; -export declare enum TextInputType { - BEGIN = 0, - TEXT = BEGIN, - MULTILINE = 1, - NUMBER = 2, - PHONE = 3, - DATETIME = 4, - EMAIL_ADDRESS = 5, - URL = 6, - VISIBLE_PASSWORD = 7, - END +export declare enum InputType { + Normal, + Number, + Email, + Password, } -export declare enum TextInputAction { - BEGIN = 0, - UNSPECIFIED = BEGIN, - NONE = 1, - GO = 2, - SEARCH = 3, - SEND = 4, - NEXT = 5, - DONE = 6, - PREVIOUS = 7, - END = PREVIOUS +export declare enum EnterKeyType { + Go, + Search, + Send, + Next, + Done, } export declare class TextInputExtend extends TextInputAttribute { @@ -53,15 +42,13 @@ interface TextInput extends TextInputAttribute { } declare class TextInputAttribute extends CommonMethod { - textInputType(value: TextInputType): T; + type(value: InputType): T; placeholderColor(value: Color): T; - placeholderFont(value: {size: number, weight: FontWeight, fontFamily: string | Resource, style: FontStyle}): T; - textInputAction(value: TextInputAction): T; - inputFilter(value: boolean): T; + placeholderFont(value: { size?: number | string, weight?: number | FontWeight, family?: string, style?: FontStyle}): T; + enterKeyType(value: EnterKeyType): T; caretColor(value: Color): T; - correction(value: boolean): T; onEditChanged(callback: (isEditing: boolean) => void): T; - onSubmit(callback: (enterKey: TextInputAction) => void): T; + onSubmit(callback: (enterKey: EnterKeyType) => void): T; onChange(callback: (value: string) => void): T; } -- Gitee