fix: use ReturnType for setTimeout/setInterval to fix TS errors

This commit is contained in:
复语
2026-05-09 16:42:32 +08:00
parent b7c6dc6f6d
commit b38f7c7ba3
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ const alertIcons = {
info: Info info: Info
} }
let intervalId: number let intervalId: ReturnType<typeof setInterval>
onMounted(() => { onMounted(() => {
intervalId = setInterval(() => { intervalId = setInterval(() => {
+1 -1
View File
@@ -114,7 +114,7 @@ export function debounce<T extends (...args: unknown[]) => unknown>(
func: T, func: T,
wait: number wait: number
): (...args: Parameters<T>) => void { ): (...args: Parameters<T>) => void {
let timeout: number | null = null let timeout: ReturnType<typeof setTimeout> | null = null
return (...args: Parameters<T>) => { return (...args: Parameters<T>) => {
if (timeout) { if (timeout) {