alert.d.ts 691 B

123456789101112131415161718192021222324252627282930313233343536
  1. /**
  2. * 弹窗
  3. * @apiName dd.alert
  4. *
  5. * @param message string 是 弹窗内容
  6. * @param title string 否 弹窗标题
  7. * @param button string 否 弹窗按钮
  8. *
  9. * @support
  10. * - IOS v1.3.2
  11. * - Android v1.3.2
  12. *
  13. * @example
  14. * ```typescript
  15. * alert({
  16. * message: 'hello, world!'
  17. * }).then(res => {
  18. * console.log(res)
  19. * }).catch(err => {
  20. * console.error(err)
  21. * })
  22. * ```
  23. */
  24. export interface AlertParams {
  25. message?: string;
  26. title?: string;
  27. button?: string;
  28. }
  29. declare function alert(params: AlertParams): Promise<void>;
  30. declare namespace alert {
  31. var version: {
  32. android: string;
  33. ios: string;
  34. };
  35. }
  36. export default alert;