no more ReturnType<typeof>

This commit is contained in:
2025-10-19 15:55:52 +01:00
parent a6f066d738
commit 252027dab2
13 changed files with 1242 additions and 90 deletions
+5 -4
View File
@@ -1,6 +1,9 @@
import { useState, useRef, useEffect } from "react";
import type { TimerManager } from '../types';
export function useTimer() {
export type { TimerManager } from '../types';
export function useTimer(): TimerManager {
const [timeValue, setTimeValue] = useState(0);
const startTimeRef = useRef<number | null>(null);
const frameRef = useRef<number | null>(null);
@@ -42,7 +45,5 @@ export function useTimer() {
};
}, []);
return { timeValue, startTimer, stopTimer, resetTimer };
return { timeValue, startTimer, stopTimer, resetTimer };
}
export type UseTimerReturn = ReturnType<typeof useTimer>;