From 09301f970783683cc520f1c67ef1bf6f219d0d8a Mon Sep 17 00:00:00 2001 From: xiongjun_gitee Date: Mon, 4 Jul 2022 11:23:13 +0800 Subject: [PATCH] add onHttpAuthRequest Signed-off-by: xiongjun_gitee --- api/@internal/component/ets/web.d.ts | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 0269b39210..fa6391e1f4 100755 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -338,6 +338,36 @@ declare class HitTestValue { getExtra(): string; } +/** + * Defines the http auth request result, related to {@link onHttpAuthRequest} method. + * @since 9 + */ +declare class WebHttpAuthResult { + /** + * Constructor. + * @since 9 + */ + constructor(); + + /** + * confirm. + * @since 9 + */ + confirm(userName: string, password: string): boolean; + + /** + * cancel. + * @since 9 + */ + cancel(): void; + + /** + * isHttpAuthInfoSaved. + * @since 9 + */ + isHttpAuthInfoSaved(): boolean; +} + /** * Encompassed message information as parameters to {@link onConsole} method. * @since 8 @@ -1279,6 +1309,14 @@ declare class WebAttribute extends CommonMethod { * @since 9 */ onScaleChange(callback: (event: {oldScale: number, newScale: number}) => void): WebAttribute; + + /** + * Triggered when the browser needs credentials from the user. + * @param callback The triggered when the browser needs credentials from the user. + * + * @since 9 + */ + onHttpAuthRequest(callback: (event?: { result: WebHttpAuthResult }) => boolean): WebAttribute; } declare const Web: WebInterface; -- Gitee