mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-07 06:03:30 +00:00
[webview]Supports custom text selection menus
Signed-off-by: yushihao4 <yushihao4@huawei.com>
This commit is contained in:
parent
b5091888cf
commit
96ba57e9eb
48
api/@internal/component/ets/web.d.ts
vendored
48
api/@internal/component/ets/web.d.ts
vendored
@ -7091,6 +7091,16 @@ declare class WebAttribute extends CommonMethod<WebAttribute> {
|
||||
* @since 12
|
||||
*/
|
||||
onRenderProcessResponding(callback: OnRenderProcessRespondingCallback): WebAttribute;
|
||||
|
||||
/**
|
||||
* Set the custom text menu.
|
||||
*
|
||||
* @param { Array<ExpandedMenuItemOptions> } expandedMenuOptions - Customize text menu options.
|
||||
* @returns { WebAttribute }
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @since 12
|
||||
*/
|
||||
selectionMenuOptions(expandedMenuOptions: Array<ExpandedMenuItemOptions>): WebAttribute;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -7198,3 +7208,41 @@ declare interface SslErrorEvent {
|
||||
*/
|
||||
isMainFrame: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the menu item option.
|
||||
*
|
||||
* @interface ExpandedMenuItemOptions
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
declare interface ExpandedMenuItemOptions {
|
||||
/**
|
||||
* Customize what the menu displays.
|
||||
*
|
||||
* @type { ResourceStr }
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
content: ResourceStr;
|
||||
/**
|
||||
* Customize the icon before the menu displays content.
|
||||
*
|
||||
* @type { ?ResourceStr }
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
startIcon?: ResourceStr;
|
||||
/**
|
||||
* Get the selected text information.
|
||||
*
|
||||
* @type { function }
|
||||
* @syscap SystemCapability.Web.Webview.Core
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
action: (selectedText: {plainText: string}) => void;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user