import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { ContextValue } from '../configProvider/context'; import '@douyinfe/semi-foundation/lib/es/_portal/portal.css'; export interface PortalProps { children: React.ReactNode; style?: React.CSSProperties; prefixCls?: string; className?: string; getPopupContainer?: () => HTMLElement; didUpdate?: (props: PortalProps) => void; } export interface PortalState { container: undefined | HTMLElement; } declare class Portal extends PureComponent { static contextType: React.Context; static defaultProps: { prefixCls: string; }; static propTypes: { children: PropTypes.Requireable; prefixCls: PropTypes.Requireable; getPopupContainer: PropTypes.Requireable<(...args: any[]) => any>; className: PropTypes.Requireable; didUpdate: PropTypes.Requireable<(...args: any[]) => any>; }; el: HTMLElement; context: ContextValue; constructor(props: PortalProps, context: ContextValue); componentDidMount(): void; initContainer: (context: ContextValue, catchError?: boolean) => HTMLElement; componentDidUpdate(prevProps: PortalProps): void; componentWillUnmount(): void; addStyle: (style?: {}) => void; addClass: (prefixCls: string, context?: ContextValue, ...classNames: string[]) => void; render(): React.ReactPortal; } export default Portal;