Closed Yaojian closed 5 years ago
These should get you started, feel free to add them.
The propTypes
say that buttons
is required, but then they are supplied in defaultProps
, so I've made them optional here.
declare module 'react-confirm-alert' {
export interface ReactConfirmAlertProps {
title?: string;
message?: string;
buttons?: Array<{
label: string;
onClick: () => void;
}>;
childrenElement?: () => React.ReactNode;
customUI?: (customUiOptions: { title: string, message: string, onClose: () => void }) => React.ReactNode;
willUnmount?: () => void;
}
export function confirmAlert(options: ReactConfirmAlertProps): void;
export default class ReactConfirmAlert extends React.Component<ReactConfirmAlertProps>{
}
}
@danzel Can you make this PR?
Great lib, and it will be even greater provides the typescript
.d.ts
^_^.