type: update event string type (#49387)

This commit is contained in:
lijianan 2024-06-13 09:32:53 +08:00 committed by GitHub
parent d118e31fe2
commit 0601867703
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import throttle from 'lodash/throttle';
import scrollTo from '../../../../components/_util/scrollTo';
const listenerEvents = ['scroll', 'resize'] as const;
const listenerEvents: (keyof WindowEventMap)[] = ['scroll', 'resize'];
const useStyle = createStyles(({ token, css }) => {
const { boxShadowSecondary, antCls } = token;

View File

@ -9,7 +9,7 @@ import { ConfigContext } from '../config-provider';
import useStyle from './style';
import { getFixedBottom, getFixedTop, getTargetRect } from './utils';
const TRIGGER_EVENTS = [
const TRIGGER_EVENTS: (keyof WindowEventMap)[] = [
'resize',
'scroll',
'touchstart',
@ -17,7 +17,7 @@ const TRIGGER_EVENTS = [
'touchend',
'pageshow',
'load',
] as const;
];
function getDefaultTarget() {
return typeof window !== 'undefined' ? window : null;