@@ -73,18 +73,14 @@ export declare namespace Target {
73
73
* @param target A React ref or HTML element
74
74
* @param options Configuration options
75
75
*/
76
- export declare function useA11yCloseButton <
77
- T extends HTMLElement ,
78
- E extends React . MouseEvent < T , MouseEvent >
79
- > (
76
+ export declare function useA11yCloseButton < T extends HTMLElement > (
80
77
target : React . RefObject < T > | T | null ,
81
- { onClick} ?: UseA11yCloseButtonOptions < E >
78
+ { onClick} ?: UseA11yCloseButtonOptions
82
79
) : {
83
80
readonly 'aria-controls' : string | undefined
84
81
readonly 'aria-expanded' : boolean
85
82
readonly 'aria-label' : 'Close'
86
83
} & {
87
- readonly onClick : ( event : E ) => void
88
84
readonly role : 'button'
89
85
readonly tabIndex : 0
90
86
}
@@ -117,19 +113,15 @@ export declare namespace CloseButton {
117
113
* @param target A React ref or HTML element
118
114
* @param options Configuration options
119
115
*/
120
- export declare function useA11yTrigger <
121
- T extends HTMLElement ,
122
- E extends React . MouseEvent < T , MouseEvent >
123
- > (
116
+ export declare function useA11yTrigger < T extends HTMLElement > (
124
117
target : React . RefObject < T > | T | null ,
125
- options ?: UseA11yTriggerOptions < E >
118
+ options ?: UseA11yTriggerOptions
126
119
) : {
127
120
readonly 'aria-controls' : string | undefined
128
121
readonly 'aria-expanded' : boolean
129
122
readonly className : string | undefined
130
123
readonly style : React . CSSProperties | undefined
131
124
} & {
132
- readonly onClick : ( event : E ) => void
133
125
readonly role : 'button'
134
126
readonly tabIndex : 0
135
127
}
@@ -206,7 +198,7 @@ export interface DisclosureProps {
206
198
*/
207
199
children : React . ReactNode
208
200
}
209
- export interface UseA11yTriggerOptions < E = React . MouseEvent < any , MouseEvent > > {
201
+ export interface UseA11yTriggerOptions {
210
202
/**
211
203
* Adds this class name to props when the disclosure is open
212
204
*/
@@ -227,10 +219,9 @@ export interface UseA11yTriggerOptions<E = React.MouseEvent<any, MouseEvent>> {
227
219
* Adds an onClick handler in addition to the default one that
228
220
* toggles the disclosure's open state.
229
221
*/
230
- onClick ?: ( e : E ) => any
222
+ onClick ?: ( e : MouseEvent ) => any
231
223
}
232
- export interface TriggerProps
233
- extends Omit < UseA11yTriggerOptions < any > , 'onClick' > {
224
+ export interface TriggerProps extends Omit < UseA11yTriggerOptions , 'onClick' > {
234
225
/**
235
226
* The child is cloned by this component and has aria attributes injected
236
227
* into its props as well as the events defined above.
@@ -285,14 +276,12 @@ export interface TargetProps extends UseA11yTargetOptions {
285
276
*/
286
277
children : JSX . Element | React . ReactElement
287
278
}
288
- export interface UseA11yCloseButtonOptions <
289
- E = React . MouseEvent < any , MouseEvent >
290
- > {
279
+ export interface UseA11yCloseButtonOptions {
291
280
/**
292
281
* Adds an onClick handler in addition to the default one that
293
282
* closes the disclosure.
294
283
*/
295
- onClick ?: ( e : E ) => any
284
+ onClick ?: ( e : MouseEvent ) => any
296
285
}
297
286
export interface CloseButtonProps {
298
287
/**
0 commit comments