mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
test: remove ts-ignore (#53169)
* test: remove ts-ignore * test: remove ts-ignore
This commit is contained in:
parent
50dba154b6
commit
2b90267d5f
@ -64,7 +64,6 @@ const useThemeAnimation = () => {
|
||||
event: React.MouseEvent<HTMLElement, MouseEvent>,
|
||||
isDark: boolean,
|
||||
) => {
|
||||
// @ts-ignore
|
||||
if (!(event && typeof document.startViewTransition === 'function')) {
|
||||
return;
|
||||
}
|
||||
@ -85,13 +84,10 @@ const useThemeAnimation = () => {
|
||||
'color-scheme',
|
||||
);
|
||||
document
|
||||
// @ts-ignore
|
||||
.startViewTransition(async () => {
|
||||
// wait for theme change end
|
||||
while (colorBgElevated === animateRef.current.colorBgElevated) {
|
||||
await new Promise((resolve) => {
|
||||
setTimeout(resolve, 1000 / 60);
|
||||
});
|
||||
await new Promise<void>((resolve) => setTimeout(resolve, 1000 / 60));
|
||||
}
|
||||
const root = document.documentElement;
|
||||
root.classList.remove(isDark ? 'dark' : 'light');
|
||||
@ -111,7 +107,6 @@ const useThemeAnimation = () => {
|
||||
|
||||
// inject transition style
|
||||
useEffect(() => {
|
||||
// @ts-ignore
|
||||
if (typeof document.startViewTransition === 'function') {
|
||||
updateCSS(viewTransitionStyle, 'view-transition-style');
|
||||
}
|
||||
|
@ -2,14 +2,12 @@ import type { UploadProps } from '../interface';
|
||||
|
||||
export const successRequest: UploadProps['customRequest'] = ({ onSuccess, file }) => {
|
||||
setTimeout(() => {
|
||||
// @ts-ignore
|
||||
onSuccess?.(null, file);
|
||||
});
|
||||
};
|
||||
|
||||
export const errorRequest: UploadProps['customRequest'] = ({ onError }) => {
|
||||
setTimeout(() => {
|
||||
// @ts-ignore
|
||||
onError?.();
|
||||
onError?.(new Error('test error'));
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user