@@ -26,7 +26,7 @@ import {Subtract} from 'utility-types'; // eslint-disable-line @typescript-eslin
26
26
import { MDCRippleFoundation } from '@material/ripple/foundation' ;
27
27
import { MDCRippleAdapter } from '@material/ripple/adapter' ;
28
28
import { supportsCssVariables , applyPassive } from '@material/ripple/util' ;
29
- import { SpecificEventListener } from '@material/base/types' ;
29
+ import { EventType , SpecificEventListener } from '@material/base/types' ;
30
30
import { matches } from '@material/dom/ponyfill' ;
31
31
32
32
export interface RippledComponentProps < T > {
@@ -197,18 +197,18 @@ export function withRipple<
197
197
classList . delete ( className ) ;
198
198
this . setState ( { classList} ) ;
199
199
} ,
200
- registerDocumentInteractionHandler : (
201
- evtType : string ,
202
- handler : EventListener
200
+ registerDocumentInteractionHandler : < K extends EventType > (
201
+ evtType : K ,
202
+ handler : SpecificEventListener < K >
203
203
) =>
204
204
document . documentElement . addEventListener (
205
205
evtType ,
206
206
handler ,
207
207
applyPassive ( )
208
208
) ,
209
- deregisterDocumentInteractionHandler : (
210
- evtType : string ,
211
- handler : EventListener
209
+ deregisterDocumentInteractionHandler : < K extends EventType > (
210
+ evtType : K ,
211
+ handler : SpecificEventListener < K >
212
212
) =>
213
213
document . documentElement . removeEventListener (
214
214
evtType ,
@@ -324,6 +324,7 @@ export function withRipple<
324
324
if ( value === null ) {
325
325
delete updatedStyle [ varName as keyof React . CSSProperties ] ;
326
326
} else {
327
+ // @ts -ignore CSS values now strongly typed
327
328
updatedStyle [ varName as keyof React . CSSProperties ] = value ;
328
329
}
329
330
0 commit comments