diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 75c3663bbfee391a471319d139b217e70b5d39a2..0ed29b731c42e4f34219450986a34450204c27e8 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -1925,3 +1925,10 @@ declare class WebAttribute extends CommonMethod { declare const Web: WebInterface; declare const WebInstance: WebAttribute; + +declare module "WebView" { + module "WebView" { + // @ts-ignore + export { Header, HitTestType }; + } +} \ No newline at end of file diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 1ef2d8ad7c51ed0f0f31da3b80c89a55affcce0b..5318323139deb476c2d11ec537e7c8286e2aec1c 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -14,81 +14,11 @@ */ /// +/// import {AsyncCallback} from "./basic"; import {Resource} from 'GlobalResource'; - -/** - * Defines the Web's request/response header. - * @since 9 - */ - declare interface HeaderV9 { - /** - * Gets the key of the request/response header. - * @since 9 - */ - headerKey: string; - - /** - * Gets the value of the request/response header. - * @since 9 - */ - headerValue: string; - } - -/** - * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. - * @since 9 - */ - declare enum HitTestTypeV9 { - /** - * The edit text. - * @since 9 - */ - EditText, - - /** - * The email address. - * @since 9 - */ - Email, - - /** - * The HTML::a tag with src=http. - * @since 9 - */ - HttpAnchor, - - /** - * The HTML::a tag with src=http + HTML::img. - * @since 9 - */ - HttpAnchorImg, - - /** - * The HTML::img tag. - * @since 9 - */ - Img, - - /** - * The map address. - * @since 9 - */ - Map, - - /** - * The phone number. - * @since 9 - */ - Phone, - - /** - * Other unknown HitTest. - * @since 9 - */ - Unknown, - } +import {Header, HitTestType} from 'WebView'; /** * Defines the hit test value, related to {@link getHitTestValue} method. @@ -101,7 +31,7 @@ declare interface HitTestValue { * * @since 9 */ - type: HitTestTypeV9; + type: HitTestType; /** * Get the hit test extra data. @@ -613,7 +543,7 @@ declare namespace webview { * Loads the data or URL. * * @param { string | Resource } url - The URL to load. - * @param { Array } [headers] - Additional HTTP request header for URL. + * @param { Array
} [headers] - Additional HTTP request header for URL. * @throws { BusinessError } 401 - Invaild input parameter. * @throws { BusinessError } 17100001 - Init error. * The WebviewController must be associted with a Web component. @@ -622,18 +552,18 @@ declare namespace webview { * * @since 9 */ - loadUrl(url: string | Resource, headers?: Array): void; + loadUrl(url: string | Resource, headers?: Array
): void; /** * Gets the type of HitTest. * * @throws { BusinessError } 17100001 - Init error. * The WebviewController must be associted with a Web component. - * @returns { HitTestTypeV9 } The type of HitTest. + * @returns { HitTestType } The type of HitTest. * * @since 9 */ - getHitTest(): HitTestTypeV9; + getHitTest(): HitTestType; /** * Stores the current page as a web archive.