UNPKG

dop-sdk

Version:

Mini App SDK for JavaScript by VTB

29 lines 1.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WebviewManager = void 0; var event_types_1 = require("../event-types"); var miniapp_bridge_utils_1 = require("../helpers/utils/miniapp-bridge-utils"); var sdkbridge_1 = require("../sdkbridge"); /** * Class implementing the WebViewConfigProvider interface to manage WebView configurations. */ var WebviewManager = /** @class */ (function () { function WebviewManager() { } /** * Allows or disallows back and forward navigation gestures in the WebView. * @param shouldAllow - A boolean indicating whether the gestures should be allowed. * @returns A promise that resolves to a boolean indicating the success of the operation. */ WebviewManager.prototype.allowBackForwardNavigationGestures = function (shouldAllow) { return (0, sdkbridge_1.getBridge)() .sendToNative(event_types_1.WebConfigEvent.ALLOW_BACK_FORWARD_NAVIGATION_GESTURES, { shouldAllowNavigationGestures: shouldAllow, }) .then(function (response) { return miniapp_bridge_utils_1.MiniAppBridgeUtils.BooleanValue(response); }) .catch(function (error) { return error; }); }; return WebviewManager; }()); exports.WebviewManager = WebviewManager; //# sourceMappingURL=webview-config-provider.js.map