index.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import * as React from 'react';
  2. import type { DrawerProps as RcDrawerProps } from 'rc-drawer';
  3. import type { Placement } from 'rc-drawer/lib/Drawer';
  4. import type { DrawerClassNames, DrawerPanelProps, DrawerStyles } from './DrawerPanel';
  5. declare const _SizeTypes: readonly ["default", "large"];
  6. type sizeType = (typeof _SizeTypes)[number];
  7. export interface PushState {
  8. distance: string | number;
  9. }
  10. export interface DrawerProps extends Omit<RcDrawerProps, 'maskStyle' | 'destroyOnClose'>, Omit<DrawerPanelProps, 'prefixCls'> {
  11. size?: sizeType;
  12. open?: boolean;
  13. afterOpenChange?: (open: boolean) => void;
  14. /** @deprecated Please use `open` instead */
  15. visible?: boolean;
  16. /** @deprecated Please use `afterOpenChange` instead */
  17. afterVisibleChange?: (open: boolean) => void;
  18. classNames?: DrawerClassNames;
  19. styles?: DrawerStyles;
  20. /** @deprecated Please use `destroyOnHidden` instead */
  21. destroyOnClose?: boolean;
  22. /**
  23. * @since 5.25.0
  24. */
  25. destroyOnHidden?: boolean;
  26. }
  27. declare const Drawer: React.FC<DrawerProps> & {
  28. _InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
  29. };
  30. interface PurePanelInterface {
  31. prefixCls?: string;
  32. style?: React.CSSProperties;
  33. className?: string;
  34. placement?: Placement;
  35. }
  36. /** @private Internal Component. Do not use in your production. */
  37. declare const PurePanel: React.FC<Omit<DrawerPanelProps, 'prefixCls'> & PurePanelInterface>;
  38. export default Drawer;