diff --git a/lib/tick.ts b/lib/tick.ts index a4b8c2b..d158357 100644 --- a/lib/tick.ts +++ b/lib/tick.ts @@ -1,13 +1,9 @@ -import { Cancel, Source } from "./source"; +import { Source } from "./source"; export type PhysicsTick = ["physics"]; export type RenderTick = ["render", number]; export function tick(fps: number): Source { - function tickSource(): PhysicsTick; - function tickSource( - callback: (tick: PhysicsTick | RenderTick) => void - ): Cancel; function tickSource(callback?: (tick: PhysicsTick | RenderTick) => void) { if (callback) { let lastPhysicsTick: number = new Date().getTime(); @@ -32,5 +28,5 @@ export function tick(fps: number): Source { } } - return tickSource; + return tickSource as Source; }