File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import cx from 'clsx' ;
33
4- import { Default , isFn , Type } from './. ./utils' ;
4+ import { Default , isFn , Type } from '../utils' ;
55import { Theme , ToastClassName , TypeOptions } from '../types' ;
66
77export interface ProgressBarProps {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export type Theme = 'light' | 'dark' | 'colored' | (string & {});
1212
1313export 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
1717export 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 /**
You can’t perform that action at this time.
0 commit comments