index.d.ts 926 B

12345678910111213141516171819202122
  1. /// <reference types="miniprogram-api-typings" />
  2. /// <reference types="miniprogram-api-typings" />
  3. declare type Context = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
  4. declare type ToastType = 'loading' | 'success' | 'fail';
  5. declare type ToastPositionType = 'top' | 'middle' | 'bottom';
  6. declare type ToastDirectionType = 'row' | 'column';
  7. export declare type ToastOptionsType = {
  8. context?: Context;
  9. selector?: string;
  10. icon?: string;
  11. message?: string;
  12. duration?: number;
  13. theme?: ToastType;
  14. placement?: ToastPositionType;
  15. preventScrollThrough?: boolean;
  16. direction?: ToastDirectionType;
  17. close?: <T = any>() => T;
  18. };
  19. declare function Toast(options: ToastOptionsType): void;
  20. declare function showToast(options?: ToastOptionsType): void;
  21. declare function hideToast(options?: ToastOptionsType): void;
  22. export { Toast as default, showToast, hideToast };