import { ModalProps } from "antd/lib/modal/Modal"; export interface DialogProps { props: ModalProps; close: (result: ROk) => void; dismiss: (result: RCancel) => void; } export type DialogWrapperChildProps = { dialog: DialogProps; }; export type DialogComponentType = React.ComponentType< DialogWrapperChildProps & P >; export function wrap( DialogComponent: DialogComponentType ): { Component: DialogComponentType; showModal: ( props?: P ) => { update: (props: P) => void; onClose: (handler: (result: ROk) => Promise | void) => void; onDismiss: (handler: (result: RCancel) => Promise | void) => void; close: (result: ROk) => void; dismiss: (result: RCancel) => void; }; };