问星数据小程序

toast.d.ts 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /// <reference types="miniprogram-api-typings" />
  2. declare type ToastMessage = string | number;
  3. interface ToastOptions {
  4. show?: boolean;
  5. type?: string;
  6. mask?: boolean;
  7. zIndex?: number;
  8. context?:
  9. | WechatMiniprogram.Component.TrivialInstance
  10. | WechatMiniprogram.Page.TrivialInstance;
  11. position?: string;
  12. duration?: number;
  13. selector?: string;
  14. forbidClick?: boolean;
  15. loadingType?: string;
  16. message?: ToastMessage;
  17. onClose?: () => void;
  18. }
  19. declare function Toast(
  20. toastOptions: ToastOptions | ToastMessage
  21. ):
  22. | WechatMiniprogram.Component.Instance<
  23. Record<string, any>,
  24. Record<string, any>,
  25. Record<string, any>,
  26. Record<string, any>,
  27. false
  28. >
  29. | undefined;
  30. declare namespace Toast {
  31. var loading: (
  32. options: string | number | ToastOptions
  33. ) =>
  34. | WechatMiniprogram.Component.Instance<
  35. Record<string, any>,
  36. Record<string, any>,
  37. Record<string, any>,
  38. Record<string, any>,
  39. false
  40. >
  41. | undefined;
  42. var success: (
  43. options: string | number | ToastOptions
  44. ) =>
  45. | WechatMiniprogram.Component.Instance<
  46. Record<string, any>,
  47. Record<string, any>,
  48. Record<string, any>,
  49. Record<string, any>,
  50. false
  51. >
  52. | undefined;
  53. var fail: (
  54. options: string | number | ToastOptions
  55. ) =>
  56. | WechatMiniprogram.Component.Instance<
  57. Record<string, any>,
  58. Record<string, any>,
  59. Record<string, any>,
  60. Record<string, any>,
  61. false
  62. >
  63. | undefined;
  64. var clear: () => void;
  65. var setDefaultOptions: (options: ToastOptions) => void;
  66. var resetDefaultOptions: () => void;
  67. }
  68. export default Toast;