diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index c905bb910f16eef71ac44b4596c2a8866afb0a7c..d008378f4b61b98c8eae7857068cd026f8f27dce 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -6772,6 +6772,57 @@ declare interface OnOverScrollEvent { yOffset: number; } +/** + * Defines the function Triggered when the PDF page scrolling. + * + * @typedef OnPdfScrollEvent + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ +declare interface OnPdfScrollEvent { + + /** + * PDF page url. + * + * @type { string } + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + url:string; +} + +/** + * Defines the function Triggered when the PDF load. + * + * @typedef OnPdfLoadEvent + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ +declare interface OnPdfLoadEvent { + /** + * The PDF page load result. + * + * @type { PdfLoadResult } + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + result: PdfLoadResult; + + /** + * The PDF page url. + * + * @type { string } + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + url: string; +} + /** * Defines the JavaScript object to be injected. * @@ -7024,6 +7075,62 @@ declare enum AudioSessionType { AMBIENT=3 } +/** + * PDF page load result + * + * @enum { number } + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ +declare enum PdfLoadResult { + + /** + * The PDF page load success. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + LOAD_SUCCESS = 0, + + /** + * The error code for web load PDF file failed. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + PARSE_ERROR_FILE = 1, + + /** + * The error code for the PDF format is not support. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + PARSE_ERROR_FORMAT = 2, + + /** + * The error code for the PDF password is wrong. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + PARSE_ERROR_PASSWORD = 3, + + /** + * The error code for the PDF handler process failed. + * + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + PARSE_ERROR_HANDLER = 4 +} + /** * Defines the options of preview menu * @@ -9618,6 +9725,26 @@ declare class WebAttribute extends CommonMethod { */ onOverScroll(callback: Callback): WebAttribute; + /** + * Triggered when the PDF in web page scrolling at bottom with pdf scroll event. + * @param { Callback } callback Function Triggered when the scrolling to bottom. + * @returns { WebAttribute } + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + onPdfScrollAtBottom(callback: Callback): WebAttribute; + + /** + * Triggered when the PDF page load finish. + * @param { Callback } callback + * @returns { WebAttribute } + * @syscap SystemCapability.Web.Webview.Core + * @since 20 + * @arkts 1.1&1.2 + */ + onPdfLoadEvent(callback: Callback): WebAttribute; + /** * Called when received website security risk check result. *