@bud-fe/h5-native-bridge 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1945,7 +1945,7 @@ class ToastPlugin {
1945
1945
  "插件未正确初始化"
1946
1946
  );
1947
1947
  }
1948
- if (options.type !== void 0 && typeof options.type !== "string" || options.type !== void 0 && !["none", "success", "fail", "exception"].includes(options.type)) {
1948
+ if (options.type !== void 0 && typeof options.type !== "string" || options.type !== void 0 && !["none", "success", "fail", "exception", "normal"].includes(options.type)) {
1949
1949
  throw createBridgeError(
1950
1950
  BridgeErrorCode.INVALID_ACTION,
1951
1951
  "type参数格式不正确"
@@ -1969,7 +1969,13 @@ class ToastPlugin {
1969
1969
  "duration参数格式不正确"
1970
1970
  );
1971
1971
  }
1972
- const { type, content, duration } = options;
1972
+ if (options.position !== void 0 && typeof options.position !== "string" || options.position !== void 0 && !["top", "bottom", "center"].includes(options.position)) {
1973
+ throw createBridgeError(
1974
+ BridgeErrorCode.INVALID_ACTION,
1975
+ "position参数格式不正确"
1976
+ );
1977
+ }
1978
+ const { type, content, duration, position } = options;
1973
1979
  const callbacks = {
1974
1980
  success: (obj) => {
1975
1981
  resolve(obj);
@@ -1994,7 +2000,8 @@ class ToastPlugin {
1994
2000
  params: {
1995
2001
  type: type || "none",
1996
2002
  content,
1997
- duration: duration || 2e3
2003
+ duration: duration || 2e3,
2004
+ position: position || "center"
1998
2005
  }
1999
2006
  },
2000
2007
  callbacks