import './floating-drawer.styles.scss'; import { Component, CSSProperties } from 'react'; import { DrawerProps } from 'antd/es/drawer'; /** * Type for the getContainer property function that returns an HTMLElement */ declare type getContainerFunc = () => HTMLElement; interface FloatingDrawerProps extends DrawerProps { /** * If `dismissable` is true, then a close icon will display in the top right of drawer. You must * provide an `onClose` handler to update the `visible` property passed to this component in order * to dismiss the drawer. */ dismissable?: boolean; /** * `closable` is a property used by the Ant Design Drawer component. We override that property * and force a `false` value as using this property throws an error in our main application. * Please ignore the `closable` property and instead use `dismissable` along with `onClose`. */ closable?: boolean; /** * `mask` is a property for the original Ant Design Drawer component that we omit in this * component. We force a value of `false` here. Please just ignore this property. */ mask?: boolean; /** * Use the `style` property to provide custom styles to the FloatingDrawer component wrapper. * This wrapper will have a class of `floating-drawer`. */ style?: CSSProperties; /** * The Floating Drawer can be nested inside a container or appended to `body`. If * omitted, the drawer will be attached to the `body` and */ getContainer?: string | false | HTMLElement | getContainerFunc; closeIconStyle?: CSSProperties; } /** * A panel that slides in from one of the edges of a container or viewport. * * Under the hood, this component uses the Ant Design Drawer component * @see https://ant.design/components/drawer/ * * We pass these properties directly to the Ant Design Drawer instance. * */ declare class FloatingDrawer extends Component { /** * Default properties */ static defaultProps: FloatingDrawerProps; /** * FloatingDrawer constructor * @param props */ constructor(props: FloatingDrawerProps); /** * Displays a close icon within the drawer. */ renderCloseIcon(): JSX.Element; /** * Renders the component */ render(): JSX.Element; } export { FloatingDrawer };