index.d.ts 1.3 KB

123456789101112131415161718192021222324252627282930
  1. import * as React from 'react';
  2. import type { RenderFunction } from '../_util/getRenderPropValue';
  3. import type { ButtonProps, LegacyButtonType } from '../button/button';
  4. import type { AbstractTooltipProps, TooltipRef } from '../tooltip';
  5. import PurePanel from './PurePanel';
  6. export interface PopconfirmProps extends AbstractTooltipProps {
  7. title: React.ReactNode | RenderFunction;
  8. description?: React.ReactNode | RenderFunction;
  9. disabled?: boolean;
  10. onConfirm?: (e?: React.MouseEvent<HTMLElement>) => void;
  11. onCancel?: (e?: React.MouseEvent<HTMLElement>) => void;
  12. okText?: React.ReactNode;
  13. okType?: LegacyButtonType;
  14. cancelText?: React.ReactNode;
  15. okButtonProps?: ButtonProps;
  16. cancelButtonProps?: ButtonProps;
  17. showCancel?: boolean;
  18. icon?: React.ReactNode;
  19. onOpenChange?: (open: boolean, e?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLDivElement>) => void;
  20. onPopupClick?: (e: React.MouseEvent<HTMLElement>) => void;
  21. }
  22. export interface PopconfirmState {
  23. open?: boolean;
  24. }
  25. declare const InternalPopconfirm: React.ForwardRefExoticComponent<PopconfirmProps & React.RefAttributes<TooltipRef>>;
  26. type CompoundedComponent = typeof InternalPopconfirm & {
  27. _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
  28. };
  29. declare const Popconfirm: CompoundedComponent;
  30. export default Popconfirm;