1/* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16const __prompt__ = requireInternal('promptAction'); 17 18const showToast = function showToast(options) { 19 return __prompt__.showToast(options); 20}; 21 22const showDialog = function showDialog(options, callback) { 23 if (callback === undefined) { 24 return __prompt__.showDialog(options); 25 } 26 return __prompt__.showDialog(options, callback); 27}; 28 29const showActionMenu = function showActionMenu(options, callback) { 30 if (callback === undefined) { 31 return __prompt__.showActionMenu(options); 32 } 33 return __prompt__.showActionMenu(options, callback); 34}; 35 36const openCustomDialog = function openCustomDialog(content, options) { 37 if (options === undefined) { 38 return __prompt__.openCustomDialog(content); 39 } 40 return __prompt__.openCustomDialog(content, options); 41}; 42 43const updateCustomDialog = function updateCustomDialog(content, options) { 44 return __prompt__.updateCustomDialog(content, options); 45}; 46 47const closeCustomDialog = function closeCustomDialog(content) { 48 return __prompt__.closeCustomDialog(content); 49}; 50 51let LevelMode; 52(function (LevelMode) { 53 LevelMode[LevelMode.OVERLAY = 0] = 'OVERLAY'; 54 LevelMode[LevelMode.EMBEDDED = 1] = 'EMBEDDED'; 55})(LevelMode || (LevelMode = {})); 56 57let ImmersiveMode; 58(function (ImmersiveMode) { 59 ImmersiveMode[ImmersiveMode.DEFAULT = 0] = 'DEFAULT'; 60 ImmersiveMode[ImmersiveMode.EXTEND = 1] = 'EXTEND'; 61})(ImmersiveMode || (ImmersiveMode = {})); 62 63export default { 64 showToast, 65 showDialog, 66 openCustomDialog, 67 updateCustomDialog, 68 closeCustomDialog, 69 showActionMenu, 70 ToastShowMode: __prompt__.ToastShowMode, 71 LevelMode, 72 ImmersiveMode 73};