# Types

> phone | 2in1 | tablet | tv | wearable

本文档提供 ArkWeb 组件中使用的类型定义，包括 Web 控制器及各类事件回调函数类型。其中，WebviewController 用于控制 Web 组件的行为；各类回调函数类型为开发者提供 Web 组件运行过程中多种事件场景的事件监听和处理能力。
> 说明
>
> * 该组件从API version 8开始支持。后续版本如有新增内容，则采用上角标单独标记该内容的起始版本。
>
> * 示例效果请以真机运行为准。

## WebviewController^9+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type WebviewController = import('../api/@ohos.web.webview').default.WebviewController

提供Web控制器的方法。

**系统能力：** SystemCapability.Web.Webview.Core

|类型|说明|
|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------|
|[import('../api/@ohos.web.webview').default.WebviewController](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-apis-webview-webviewcontroller)|通过WebviewController可以控制Web组件各种行为。一个WebviewController对象只能控制一个Web组件，且必须在Web组件和WebviewController绑定后，才能调用WebviewController上的方法（静态方法除外）。|

## OnAdsBlockedCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+

type OnAdsBlockedCallback = (details: AdsBlockedDetails) => void

当页面发生广告过滤时触发此回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:------|:--------------------------------------------------------------------------------------------------------------------------------------|:-|:--------------|
|details|[AdsBlockedDetails](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#adsblockeddetails12)|是|发生广告拦截时，广告资源信息。|

## OnSslErrorEventCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnSslErrorEventCallback = (sslErrorEvent: SslErrorEvent) => void

用户加载资源时发生SSL错误时触发的回调，返回SSL错误详细信息。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:------------|:------------------------------------------------------------------------------------------------------------------------------|:-|:----------------------|
|sslErrorEvent|[SslErrorEvent](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#sslerrorevent12)|是|用户加载资源时发生SSL错误时传递的详细信息。|

## OnVerifyPinCallback^22+^

> phone 22+ | 2in1 22+ | tablet 22+ | tv 22+ | wearable 22+

type OnVerifyPinCallback = (verifyPinEvent: VerifyPinEvent) => void

需要用户进行PIN码认证时触发的回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:-------------|:--------------------------------------------------------------------------------------------------------------------------------|:-|:--------------------|
|verifyPinEvent|[VerifyPinEvent](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#verifypinevent22)|是|需要用户进行PIN码认证时触发的回调详情。|

## OnContextMenuHideCallback^11+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnContextMenuHideCallback = () => void

上下文菜单自定义隐藏的回调。

**系统能力：** SystemCapability.Web.Webview.Core

## OnRenderProcessNotRespondingCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnRenderProcessNotRespondingCallback = (data : RenderProcessNotRespondingData) => void

渲染进程无响应时触发的回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:---|:----------------------------------------------------------------------------------------------------------------------------------------------------------------|:-|:------------|
|data|[RenderProcessNotRespondingData](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#renderprocessnotrespondingdata12)|是|渲染进程无响应的详细信息。|

## OnRenderProcessRespondingCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnRenderProcessRespondingCallback = () => void

渲染进程由无响应状态变回正常运行状态时触发该回调。

**系统能力：** SystemCapability.Web.Webview.Core

## OnViewportFitChangedCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+

type OnViewportFitChangedCallback = (viewportFit: ViewportFit) => void

网页meta中viewport-fit配置项更改时触发的回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:----------|:--------------------------------------------------------------------------------------------------------------------------|:-|:--------------------------|
|viewportFit|[ViewportFit](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-e#viewportfit12)|是|网页meta中viewport-fit配置的视口类型。|

## OnNativeEmbedVisibilityChangeCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnNativeEmbedVisibilityChangeCallback = (nativeEmbedVisibilityInfo: NativeEmbedVisibilityInfo) => void

当同层标签可见性变化时触发该回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------|:-|:--------------|
|nativeEmbedVisibilityInfo|[NativeEmbedVisibilityInfo](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#nativeembedvisibilityinfo12)|是|提供同层标签可见性变化的信息。|

## OnFullScreenEnterCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnFullScreenEnterCallback = (event: FullScreenEnterEvent) => void

Web组件进入全屏时触发的回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:----|:--------------------------------------------------------------------------------------------------------------------------------------------|:-|:----------------|
|event|[FullScreenEnterEvent](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#fullscreenenterevent12)|是|Web组件进入全屏的回调事件详情。|

## OnFirstMeaningfulPaintCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnFirstMeaningfulPaintCallback = (firstMeaningfulPaint: [FirstMeaningfulPaint](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#firstmeaningfulpaint12)) => void

网页首次绘制页面主要内容度量的回调，当网页加载完页面主要内容时会触发此回调。与OnLargestContentfulPaintCallback关注最大内容元素绘制时间、OnFirstScreenPaintCallback关注首屏可见内容渲染完成相比，本回调更关注主要内容是否加载完成，适合评估用户可见内容的加载体验。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:-------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|:-|:---------------|
|firstMeaningfulPaint|[FirstMeaningfulPaint](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#firstmeaningfulpaint12)|是|绘制页面主要内容度量的详细信息。|

## OnLargestContentfulPaintCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnLargestContentfulPaintCallback = (largestContentfulPaint: [LargestContentfulPaint](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#largestcontentfulpaint12)) => void

当网页绘制最大内容区域时触发的回调，用于获取最大内容绘制的性能度量信息。适用于需要监控网页加载性能、优化页面渲染速度等场景。与OnFirstMeaningfulPaintCallback关注主要内容加载完成、OnFirstScreenPaintCallback关注首屏可见内容渲染完成相比，本回调关注最大内容元素的绘制时间，适合评估页面渲染完成度和性能瓶颈。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:---------------------|:------------------------------------------------------------------------------------------------------------------------------------------------|:-|:-----------------|
|largestContentfulPaint|[LargestContentfulPaint](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#largestcontentfulpaint12)|是|网页绘制页面最大内容度量的详细信息。|

## OnNavigationEntryCommittedCallback^11+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnNavigationEntryCommittedCallback = (loadCommittedDetails: [LoadCommittedDetails](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#loadcommitteddetails11)) => void

导航条目提交时触发的回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:-------------------|:--------------------------------------------------------------------------------------------------------------------------------------------|:-|:---------------|
|loadCommittedDetails|[LoadCommittedDetails](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#loadcommitteddetails11)|是|提供已提交跳转的网页的详细信息。|

## OnSafeBrowsingCheckResultCallback^11+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnSafeBrowsingCheckResultCallback = (threatType: ThreatType) => void

网站安全风险检查触发的回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:---------|:------------------------------------------------------------------------------------------------------------------------|:-|:------------|
|threatType|[ThreatType](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-e#threattype11)|是|定义网站threat类型。|

## OnIntelligentTrackingPreventionCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+

type OnIntelligentTrackingPreventionCallback = (details: IntelligentTrackingPreventionDetails) => void

当跟踪者cookie被拦截时触发的回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-|:--------------|
|details|[IntelligentTrackingPreventionDetails](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#intelligenttrackingpreventiondetails12)|是|提供智能防跟踪拦截的详细信息。|

## OnOverrideUrlLoadingCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type OnOverrideUrlLoadingCallback = (webResourceRequest: WebResourceRequest) => boolean

用于拦截URL加载请求的回调，可阻止特定URL的加载或进行自定义处理。适用于需要拦截广告、阻止恶意网站跳转等场景。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:-----------------|:------------------------------------------------------------------------------------------------------------------------------------|:-|:----------|
|webResourceRequest|[WebResourceRequest](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-webresourcerequest)|是|url请求的相关信息。|

**返回值：**

|类型|说明|
|:------|:-----------------------|
|boolean|返回true表示阻止此次加载，否则允许此次加载。|

## WebKeyboardCallback^12+^

> phone 12+ | 2in1 13+ | tablet 12+ | tv 19+ | wearable 18+

type WebKeyboardCallback = (keyboardCallbackInfo: WebKeyboardCallbackInfo) => WebKeyboardOptions

拦截网页可编辑元素拉起软键盘的回调，一般在点击网页input标签时触发。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:-------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------|:-|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|keyboardCallbackInfo|[WebKeyboardCallbackInfo](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#webkeyboardcallbackinfo12)|是|拦截网页拉起软键盘回调通知的入参，其中包括[WebKeyboardController](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-webkeyboardcontroller)、可编辑元素的属性。|

**返回值：**

|类型|说明|
|:----------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|[WebKeyboardOptions](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#webkeyboardoptions12)|回调函数通过返回[WebKeyboardOptions](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#webkeyboardoptions12)来决定ArkWeb内核拉起不同类型的软键盘。|

## OnOverrideErrorPageCallback^20+^

> phone 20+ | 2in1 20+ | tablet 20+ | tv 20+ | wearable 20+

type OnOverrideErrorPageCallback = (errorPageEvent: OnErrorReceiveEvent) => string

onOverrideErrorPage的回调函数，网页加载失败时触发。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:-------------|:------------------------------------------------------------------------------------------------------------------------------------------|:-|:----------------|
|errorPageEvent|[OnErrorReceiveEvent](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#onerrorreceiveevent12)|是|网页加载遇到错误时返回的相关信息。|

**返回值：**

|类型|说明|
|:-----|:--------------------|
|string|返回以Base64编码的HTML文本内容。|

## MouseInfoCallback^20+^

> phone 20+ | 2in1 20+ | tablet 20+ | tv 20+ | wearable 20+

type MouseInfoCallback = (event: NativeEmbedMouseInfo) => void

当鼠标/触摸板单击到同层标签时触发此回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:----|:--------------------------------------------------------------------------------------------------------------------------------------------|:-|:------------------------|
|event|[NativeEmbedMouseInfo](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#nativeembedmouseinfo20)|是|提供鼠标/触摸板在同层标签上单击或长按的详细信息。|

**示例：**

完整示例代码参考[onNativeEmbedMouseEvent](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-events#onnativeembedmouseevent20)。

## OnNativeEmbedObjectParamChangeCallback^21+^

> phone 21+ | 2in1 21+ | tablet 21+ | tv 21+ | wearable 21+

type OnNativeEmbedObjectParamChangeCallback = (event: NativeEmbedParamDataInfo) => void

增加、修改或删除同层渲染object标签内嵌param元素时触发此回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:----|:----------------------------------------------------------------------------------------------------------------------------------------------------|:-|:------------------------|
|event|[NativeEmbedParamDataInfo](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#nativeembedparamdatainfo21)|是|object标签内嵌param元素的详细变化信息。|

**示例：**

完整示例代码参考[onNativeEmbedObjectParamChange](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-events#onnativeembedobjectparamchange21)。

## OnDetectBlankScreenCallback^22+^

> phone 22+ | 2in1 22+ | tablet 22+ | tv 22+ | wearable 22+

type OnDetectBlankScreenCallback = (event: BlankScreenDetectionEventInfo) => void

检测到白屏时触发此回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:----|:--------------------------------------------------------------------------------------------------------------------------------------------------------------|:-|:-----------|
|event|[BlankScreenDetectionEventInfo](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#blankscreendetectioneventinfo22)|是|检测到白屏时的详细信息。|

**示例：**

完整示例代码参考[onDetectedBlankScreen](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-events#ondetectedblankscreen22)。

## OnCameraCaptureStateChangeCallback^23+^

> phone 23+ | 2in1 23+ | tablet 23+ | tv 23+ | wearable 23+

type OnCameraCaptureStateChangeCallback = (event: CameraCaptureStateChangeInfo) => void

当页面摄像设备状态发生改变时触发此回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:----|:------------------------------------------------------------------------------------------------------------------------------------------------------------|:-|:---------------------------|
|event|[CameraCaptureStateChangeInfo](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#cameracapturestatechangeinfo23)|是|网页摄像头状态发生改变时，返回原来的状态和改变后的状态。|

## OnMicrophoneCaptureStateChangeCallback^23+^

> phone 23+ | 2in1 23+ | tablet 23+ | tv 23+ | wearable 23+

type OnMicrophoneCaptureStateChangeCallback = (event: MicrophoneCaptureStateChangeInfo) => void

当页面麦克风状态发生改变时触发此回调。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:----|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-|:---------------------------|
|event|[MicrophoneCaptureStateChangeInfo](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#microphonecapturestatechangeinfo23)|是|网页麦克风状态发生改变时，返回原来的状态和改变后的状态。|

## TextSelectionChangeCallback^23+^

> phone 23+ | 2in1 23+ | tablet 23+ | tv 23+ | wearable 23+

type TextSelectionChangeCallback = (selectionText: string) => void

onTextSelectionChange的回调，选区内容改变时触发。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:------------|:-----|:-|:---------|
|selectionText|string|是|返回所选文本的内容。|

**示例：**

完整示例代码参考[onTextSelectionChange](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-events#ontextselectionchange23)。

## OnFirstScreenPaintCallback^23+^

> phone 23+ | 2in1 23+ | tablet 23+ | tv 23+ | wearable 23+

type OnFirstScreenPaintCallback = (firstScreenPaint: FirstScreenPaint) => void

检测到首屏渲染结束时会触发此回调。与OnFirstMeaningfulPaintCallback关注主要内容加载完成、OnLargestContentfulPaintCallback关注最大内容元素绘制时间相比，本回调更关注首屏可见内容的渲染完成时间，适合评估用户首次视觉体验。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:---------------|:------------------------------------------------------------------------------------------------------------------------------------|:-|:-------------|
|firstScreenPaint|[FirstScreenPaint](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-i#firstscreenpaint23)|是|检测到首屏渲染时的详细信息。|

**示例：**

完整示例代码参考[onFirstScreenPaint](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-events#onfirstscreenpaint23)。

## OnCreateAISession

> phone 26.0.0+ | 2in1 26.0.0+ | tablet 26.0.0+ | tv 26.0.0+ | wearable 26.0.0+

type OnCreateAISession = (id: string, params: string, result: OnAISessionCallback) => boolean

AI会话创建回调函数类型。允许自定义模型初始化和结果处理。

**起始版本：** 26.0.0

**模型约束：** 此接口仅可在Stage模型下使用。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:-----|:------------------------------------------|:-|:-----------------------|
|id|string|是|会话任务ID。|
|params|string|是|会话创建时传递的上下文数据，JSON字符串格式。|
|result|[OnAISessionCallback](#onaisessioncallback)|是|用于通知系统会话创建结果的回调函数。|

**返回值：**

|类型|说明|
|:------|:----------------------------------------|
|boolean|true表示使用自定义逻辑，跳过系统默认行为；false表示继续执行系统默认逻辑。|

## OnExecuteAIAction

> phone 26.0.0+ | 2in1 26.0.0+ | tablet 26.0.0+ | tv 26.0.0+ | wearable 26.0.0+

type OnExecuteAIAction = (id: string, params: string, result: OnAISessionCallback) => void

AI会话执行操作回调函数类型。用于自定义实现AI模型执行。

**起始版本：** 26.0.0

**模型约束：** 此接口仅可在Stage模型下使用。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:-----|:------------------------------------------|:-|:-----------------------|
|id|string|是|会话任务ID。|
|params|string|是|执行操作时传递的上下文数据，JSON字符串格式。|
|result|[OnAISessionCallback](#onaisessioncallback)|是|用于通知系统操作执行结果的回调函数。|

## OnDestroyAISession

> phone 26.0.0+ | 2in1 26.0.0+ | tablet 26.0.0+ | tv 26.0.0+ | wearable 26.0.0+

type OnDestroyAISession = (id: string) => void

AI会话销毁回调函数类型。用于清理与自定义AI模型关联的资源。

**起始版本：** 26.0.0

**模型约束：** 此接口仅可在Stage模型下使用。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:--|:-----|:-|:------|
|id|string|是|会话任务ID。|

## OnAISessionCallback

> phone 26.0.0+ | 2in1 26.0.0+ | tablet 26.0.0+ | tv 26.0.0+ | wearable 26.0.0+

type OnAISessionCallback = (state: AISessionResultType, content: string) => void

AI会话操作结果回调函数类型。用于报告会话创建或执行的结果。

**起始版本：** 26.0.0

**模型约束：** 此接口仅可在Stage模型下使用。

**系统能力：** SystemCapability.Web.Webview.Core

**参数：**

|参数名|类型|必填|说明|
|:------|:----------------------------------------------------------------------------------------------------------------------------------------|:-|:---------------------------------|
|state|[AISessionResultType](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-e#aisessionresulttype)|是|AI会话创建或执行的状态结果。|
|content|string|是|AI会话的响应内容，文本或JSON格式，包含AI模型生成的回复内容。|

## OnInputmethodAttachedCallback

> phone 26.0.0+ | 2in1 26.0.0+ | tablet 26.0.0+ | tv 26.0.0+ | wearable 26.0.0+

type OnInputmethodAttachedCallback = () => void;

当检测到输入法绑定成功时，会触发此回调。

**起始版本：** 26.0.0

**模型约束：** 此接口仅可在Stage模型下使用

**系统能力：** SystemCapability.Web.Webview.Core

**示例：**

完整示例代码参考[onInputmethodAttached](https://developer.huawei.com/consumer/cn/doc/harmonyos-references/arkts-basic-components-web-events#oninputmethodattached)。

