index.d.ts 969 B

123456789101112131415161718192021222324252627
  1. import React from 'react';
  2. import type { ArgsProps, ConfigOptions, MessageType, TypeOpen } from './interface';
  3. import PurePanel from './PurePanel';
  4. import useMessage from './useMessage';
  5. export type { ArgsProps };
  6. declare function setMessageGlobalConfig(config: ConfigOptions): void;
  7. interface BaseMethods {
  8. open: (config: ArgsProps) => MessageType;
  9. destroy: (key?: React.Key) => void;
  10. config: typeof setMessageGlobalConfig;
  11. useMessage: typeof useMessage;
  12. /** @private Internal Component. Do not use in your production. */
  13. _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
  14. }
  15. interface MessageMethods {
  16. info: TypeOpen;
  17. success: TypeOpen;
  18. error: TypeOpen;
  19. warning: TypeOpen;
  20. loading: TypeOpen;
  21. }
  22. declare const staticMethods: MessageMethods & BaseMethods;
  23. declare const actWrapper: (wrapper: any) => void;
  24. export { actWrapper };
  25. declare const actDestroy: () => void;
  26. export { actDestroy };
  27. export default staticMethods;