dialog.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /// <reference types="miniprogram-api-typings" />
  2. interface DialogOptions {
  3. lang?: string;
  4. show?: boolean;
  5. title?: string;
  6. width?: string | number | null;
  7. zIndex?: number;
  8. theme?: string;
  9. context?:
  10. | WechatMiniprogram.Page.TrivialInstance
  11. | WechatMiniprogram.Component.TrivialInstance;
  12. message?: string;
  13. overlay?: boolean;
  14. selector?: string;
  15. ariaLabel?: string;
  16. className?: string;
  17. customStyle?: string;
  18. transition?: string;
  19. asyncClose?: boolean;
  20. businessId?: number;
  21. sessionFrom?: string;
  22. overlayStyle?: string;
  23. appParameter?: string;
  24. messageAlign?: string;
  25. sendMessageImg?: string;
  26. showMessageCard?: boolean;
  27. sendMessagePath?: string;
  28. sendMessageTitle?: string;
  29. confirmButtonText?: string;
  30. cancelButtonText?: string;
  31. showConfirmButton?: boolean;
  32. showCancelButton?: boolean;
  33. closeOnClickOverlay?: boolean;
  34. confirmButtonOpenType?: string;
  35. }
  36. declare const Dialog: {
  37. (options: DialogOptions): Promise<
  38. WechatMiniprogram.Component.Instance<
  39. Record<string, any>,
  40. Record<string, any>,
  41. Record<string, any>,
  42. Record<string, any>,
  43. false
  44. >
  45. >;
  46. alert(
  47. options: DialogOptions
  48. ): Promise<
  49. WechatMiniprogram.Component.Instance<
  50. Record<string, any>,
  51. Record<string, any>,
  52. Record<string, any>,
  53. Record<string, any>,
  54. false
  55. >
  56. >;
  57. confirm(
  58. options: DialogOptions
  59. ): Promise<
  60. WechatMiniprogram.Component.Instance<
  61. Record<string, any>,
  62. Record<string, any>,
  63. Record<string, any>,
  64. Record<string, any>,
  65. false
  66. >
  67. >;
  68. close(): void;
  69. stopLoading(): void;
  70. currentOptions: DialogOptions;
  71. defaultOptions: DialogOptions;
  72. setDefaultOptions(options: DialogOptions): void;
  73. resetDefaultOptions(): void;
  74. };
  75. export default Dialog;