/** * Runs on BOTH server (SSR) and client — safe for data loading, initial state setup. * Call async operations here; executes before onMount. */ export declare function onInit(fn: () => void | Promise): void; /** * Runs on CLIENT ONLY after first render — DOM is available. * Never called during SSR. */ export declare function onMount(fn: () => void): void; /** * Runs on CLIENT ONLY when component is removed / app.destroy() called. * Never called during SSR. */ export declare function onDestroy(fn: () => void): void; /** * Reactive side effect. Runs immediately and re-runs whenever any signal read * inside fn() changes. Returns a dispose function that stops the effect. * * When called inside a component setup, the effect is automatically disposed * when the component is destroyed — no manual cleanup needed. * * @example * // Inside a component — auto-cleaned on destroy * effect(() => { * chart.setData(prices()); // re-runs whenever prices changes * }); * * // Standalone — dispose manually * const stop = effect(() => console.log('count:', count())); * stop(); // unsubscribe * * // With cleanup * effect(() => { * const sub = store.subscribe(handler); * return () => sub.unsubscribe(); // called before next run and on dispose * }); */ export declare function effect(fn: () => void | (() => void)): () => void; /** * Starts a repeating interval when the component mounts and clears it * automatically when the component is destroyed. Client-only. * * @example * useInterval(() => setTick(t => t + 1), 1000); */ export declare function useInterval(fn: () => void, ms: number): void; /** * Schedules a one-shot timeout when the component mounts and cancels it * automatically if the component is destroyed before it fires. Client-only. * * Returns a `retrigger` function that resets the timer from event handlers — * each call cancels the pending timeout and starts a fresh one. * * @example * // Fire once at mount * useTimeout(() => setVisible(false), 3000); * * // Re-trigger on user activity (debounce pattern) * const resetIdle = useTimeout(() => setIdle(true), 5000); * return () =>
...
; */ export declare function useTimeout(fn: () => void, ms: number): () => void;