diff --git a/src/runtime/internal/environment.ts b/src/runtime/internal/environment.ts index 4c93b27835..0246306a9a 100644 --- a/src/runtime/internal/environment.ts +++ b/src/runtime/internal/environment.ts @@ -1,16 +1,18 @@ import { noop } from './utils'; - export const is_client = typeof window !== 'undefined'; - -export let now: () => number = is_client ? () => window.performance.now() : () => Date.now(); - +/** @type {() => number} */ +export let now = is_client ? () => window.performance.now() : () => Date.now(); export let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop; - // used internally for testing +/** @returns {void} */ export function set_now(fn) { - now = fn; + now = fn; } - +/** @returns {void} */ export function set_raf(fn) { - raf = fn; + raf = fn; } + + + +