Skip to content

Commit

Permalink
fix(confirm): type definitions not exported
Browse files Browse the repository at this point in the history
add index.d.ts file to export type definitions
extend Dialog type definitions
sort props type definitions
add event argument to onConfirm type definition

Fixes #3710
Fixes #3809
  • Loading branch information
grabkowski committed Apr 9, 2021
1 parent 769ad47 commit e9557cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/components/confirm/confirm.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import * as React from "react";
import { DialogProps } from "../dialog/dialog";

export interface ConfirmProps {
// ** A custom event handler when a confirmation takes place */
onConfirm: () => void;
// ** Customise the confirm button label */
confirmLabel?: string;
export interface ConfirmProps extends DialogProps {
/** Allows to setup buttonType into cancel button */
cancelButtonType?: "primary" | "secondary" | "tertiary";
// ** Customise the cancel button label */
cancelLabel?: string;
// ** Customise the confirm button label */
confirmLabel?: string;
/** Apply destructive style to the buttons */
destructive?: boolean;
/** Defines an Icon type within the button (see Icon for options) */
iconType?: "error" | "warning";
/** Makes cancel button disabled */
disableCancel?: boolean;
/** Makes confirm button disabled */
disableConfirm?: boolean;
/** Allows to setup buttonType into cancel button */
cancelButtonType?: "primary" | "secondary" | "tertiary";
/** Defines an Icon type within the button (see Icon for options) */
iconType?: "error" | "warning";
/** Adds isLoading state into confirm button */
isLoadingConfirm?: boolean;
// ** A custom event handler when a confirmation takes place */
onConfirm: (ev: React.MouseEvent<HTMLButtonElement>) => void;
}

declare class Confirm extends React.Component<ConfirmProps> {}
Expand Down
1 change: 1 addition & 0 deletions src/components/confirm/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "./confirm";

0 comments on commit e9557cf

Please sign in to comment.