From 4bc453ea393e2ab1142d1b0fe1a3e9664d473fb4 Mon Sep 17 00:00:00 2001 From: lixingchi1 Date: Wed, 19 Jan 2022 14:58:15 +0800 Subject: [PATCH] fixed 770f93b from https://gitee.com/lixingchi1/interface_sdk-js/pulls/386 lixingchi1@huawei.com Signed-off-by: lixingchi1 --- api/@internal/component/ets/web.d.ts | 37 ++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index a45cfc58a7..636060804a 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -1,21 +1,29 @@ declare class WebController { + /** + * Constructor. + * @since 8 + */ constructor(); + /** * Means to load a piece of code and execute JS code in the context of the currently displayed page * @since 8 */ evaluateJavaScript(jscode: string); + /** * Indicates that a piece of code is loaded * @since 8 */ loadDataWithBaseURL(value : {baseUrl: string, data: string, mimeType:string, encoding:string, historyUrl: string}); + /** * Load the given URL * @since 8 */ loadUrl(url : string); } + declare interface WebOptions { /** * Set the address of the web page to be displayed @@ -24,31 +32,40 @@ declare interface WebOptions { src: string | Resource; controller: WebController; } -interface Web extends WebAttribute { - (value: WebOptions): Web; + +interface WebInterface { + /** + * Set Value. + * @since 8 + */ + (value: WebOptions): WebAttribute; } -declare class WebAttribute extends CommonMethod { + +declare class WebAttribute extends CommonMethod { /** * Triggered at the end of web page loading * @since 8 */ - onPageFinish(callback: (event?:{ url: string }) => void): T; + onPageFinish(callback: (event?:{ url: string }) => void): WebAttribute; + /** * Get WebView focus callback event * @since 8 */ - onRequestFocus(event: () => void): T; + onRequestFocus(event: () => void): WebAttribute; + /** * Set whether WebView allows JavaScript scripts to execute * @since 8 */ - javaScriptEnabled(value: boolean): T; + javaScriptEnabled(value: boolean): WebAttribute; + /** * Enable or disable local file system access in WebView * @since 8 */ - fileAccessEnabled(value: boolean): T; + fileAccessEnabled(value: boolean): WebAttribute; } -declare class WebExtend extends WebAttribute { -} -declare const Web: Web; + +declare const Web: WebInterface; +declare const WebInstance: WebAttribute; -- Gitee