test: remove ts-ignore (#53169)

* test: remove ts-ignore

* test: remove ts-ignore
This commit is contained in:
lijianan 2025-03-15 13:03:55 +08:00 committed by GitHub
parent 50dba154b6
commit 2b90267d5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 9 deletions

View File

@ -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');
}

View File

@ -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'));
});
};