diff --git a/api/@ohos.inputMethod.d.ts b/api/@ohos.inputMethod.d.ts index 7132894c9174754702ae0219f51fbd1b77f36295..3d30601a8c952f002fe00813608a5dfa59de85be 100644 --- a/api/@ohos.inputMethod.d.ts +++ b/api/@ohos.inputMethod.d.ts @@ -21,6 +21,7 @@ import type { Callback, AsyncCallback } from './@ohos.base'; import type { ElementName } from './bundleManager/ElementName'; import InputMethodSubtype from './@ohos.InputMethodSubtype'; import type { PanelInfo } from './@ohos.inputMethod.Panel'; +import type { CustomValueType as _CustomValueType, ExtraConfig as _ExtraConfig } from './inputMethod/common/@extraConfig'; /** * Input method @@ -2369,6 +2370,22 @@ declare namespace inputMethod { */ CHARACTERS } + + /** + * Indicates the possible data types of the custom setting value. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + export type CustomValueType = _CustomValueType; + + /** + * The extra config of edit box. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + export type ExtraConfig = _ExtraConfig; } export default inputMethod; \ No newline at end of file diff --git a/api/@ohos.inputMethodEngine.d.ts b/api/@ohos.inputMethodEngine.d.ts index 8fbd4e93bd750bd2a47f5653dcc82d875711496f..388afab309306e1d040fad66166a7c42bf684f9a 100644 --- a/api/@ohos.inputMethodEngine.d.ts +++ b/api/@ohos.inputMethodEngine.d.ts @@ -19,6 +19,7 @@ */ import type { AsyncCallback, Callback } from './@ohos.base'; import type { KeyEvent as InputKeyEvent } from './@ohos.multimodalInput.keyEvent'; +import type { CustomValueType as _CustomValueType, ExtraConfig as _ExtraConfig } from './inputMethod/common/@extraConfig'; import InputMethodSubtype from './@ohos.InputMethodSubtype'; import BaseContext from './application/BaseContext'; import window from './@ohos.window'; @@ -2452,6 +2453,16 @@ declare namespace inputMethodEngine { * @since 20 */ readonly fluidLightMode?: FluidLightMode; + + /** + * Extra config of edit box. + * + * @type { ?ExtraConfig } + * @readonly + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + readonly extraConfig?: ExtraConfig; } /** @@ -2996,6 +3007,22 @@ declare namespace inputMethodEngine { */ CHARACTERS } + + /** + * Indicates the possible data types of the custom setting value. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + export type CustomValueType = _CustomValueType; + + /** + * The extra config of edit box. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + export type ExtraConfig = _ExtraConfig; } export default inputMethodEngine; diff --git a/api/inputMethod/common/@extraConfig.d.ts b/api/inputMethod/common/@extraConfig.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a50efb0de90c8fc039f6c06fc7550bcbe81cddec --- /dev/null +++ b/api/inputMethod/common/@extraConfig.d.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2025 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 + * + * 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. + */ + +/** + * @file The extra config of edit box. + * @kit IMEKit + */ + +/** + * Indicates the possible data types of the custom setting value. + * + * @typedef { number | string | boolean } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ +export type CustomValueType = number | string | boolean; + +/** + * The extra config of edit box. + * + * @typedef ExtraConfig + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ +export interface ExtraConfig { + /** + *

Indicates extra customized settings.

+ *

The size of all records can not exceed 128KB.

+ * + * @type { Record } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 21 + */ + customSettings: Record; +} \ No newline at end of file