import { FunctionComponent, ReactNode } from 'react' import { ViewProps, ButtonProps as TaroButtonProps } from '@tarojs/components' import { ButtonProps } from './button' import { PopupProps } from './popup' export interface DialogProps extends ViewProps, Omit, Omit { show?: boolean title?: ReactNode width?: string | number zIndex?: number theme?: 'round-button' cancelButtonColor?: string confirmButtonColor?: string onConfirm?: (event: { detail: { action: string; dialog?: { dialog: any } } }) => void onCancel?: (event: { detail: { action: string; dialog?: { dialog: any } } }) => void onClose?: (event: { detail: string }) => void message?: ReactNode overlay?: boolean selector?: string ariaLabel?: string className?: string style?: string transition?: 'fade' | 'none' /** * @deprecated use beforeClose instead */ asyncClose?: boolean beforeClose?: (action: string) => Promise | void | boolean messageAlign?: 'left' | 'right' confirmButtonText?: ReactNode confirmButtonDisabled?: boolean cancelButtonText?: ReactNode showConfirmButton?: boolean showCancelButton?: boolean closeOnClickOverlay?: boolean confirmButtonOpenType?: TaroButtonProps.OpenType renderTitle?: ReactNode } interface dialog { alert(options: DialogProps): Promise<'confirm' | 'cancel'> confirm(options: DialogProps): Promise<'confirm' | 'cancel'> setDefaultOptions(options: DialogProps): void resetDefaultOptions(): void close(): void stopLoading(): void } // & DialogCom declare const Dialog: FunctionComponent & dialog export { Dialog, dialog }