Skip to content

Commit 179707a

Browse files
committed
chore: update typing
1 parent 76190f4 commit 179707a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/components/ProgressBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import cx from 'clsx';
33

4-
import { Default, isFn, Type } from './../utils';
4+
import { Default, isFn, Type } from '../utils';
55
import { Theme, ToastClassName, TypeOptions } from '../types';
66

77
export interface ProgressBarProps {

src/types.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type Theme = 'light' | 'dark' | 'colored' | (string & {});
1212

1313
export type ToastPosition = 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left';
1414

15-
export type CloseToastFunc = (reason?: boolean | string) => void;
15+
export type CloseToastFunc = ((reason?: boolean | string) => void) & ((e: React.MouseEvent) => void);
1616

1717
export interface ToastContentProps<Data = unknown> {
1818
closeToast: CloseToastFunc;
@@ -152,6 +152,12 @@ interface CommonOptions {
152152
*/
153153
theme?: Theme;
154154

155+
/**
156+
* When set to `true` the built-in progress bar won't be rendered at all. Autoclose delay won't have any effect as well
157+
* This is only used when you want to replace the progress bar with your own.
158+
*
159+
* See https://stackblitz.com/edit/react-toastify-custom-progress-bar?file=src%2FApp.tsx for an example.
160+
*/
155161
customProgressBar?: boolean;
156162
}
157163

@@ -197,13 +203,16 @@ export interface ToastOptions<Data = unknown> extends CommonOptions {
197203
/**
198204
* Set the percentage for the controlled progress bar. `Value must be between 0 and 1.`
199205
*/
200-
progress?: number | string;
206+
progress?: number;
201207

202208
/**
203209
* Let you provide any data, useful when you are using your own component
204210
*/
205211
data?: Data;
206212

213+
/**
214+
* Let you specify the aria-label
215+
*/
207216
ariaLabel?: string;
208217

209218
/**

0 commit comments

Comments
 (0)