/** * Solid.js-style reactive signals. * * Key principles: * - Components run ONCE (setup phase) * - Signals created inside components are local to that instance * - Fine-grained reactivity: only re-run what depends on changed signals * - No rules of hooks - signals are just values */ export type Accessor = () => T; export type Setter = { (value: T): void; (fn: (prev: T) => T): void; }; export type Signal = [Accessor, Setter]; /** * Create a reactive signal. * * @example * ```tsx * function Counter() { * const [count, setCount] = createSignal(0); * return ( * * Count: {count()} * setCount(c => c + 1)}>+ * * ); * } * ``` */ export declare function createSignal(initialValue: T): Signal; /** * Create a reactive effect that runs when its dependencies change. * Returns a dispose function to stop the effect. * * @example * ```tsx * const [count, setCount] = createSignal(0); * * createEffect(() => { * console.log("Count is:", count()); * }); * ``` */ export declare function createEffect(fn: () => void | (() => void)): () => void; /** * Create a memoized computation. * Only re-computes when dependencies change. */ export declare function createMemo(fn: () => T): Accessor; export interface Owner { disposables: (() => void)[]; } /** * Create a reactive root. All reactive primitives created inside * will be cleaned up when the root is disposed. */ export declare function createRoot(fn: (dispose: () => void) => T): T; /** * Register a cleanup function to run when the current owner is disposed. */ export declare function onCleanup(fn: () => void): void; /** * Batch multiple signal updates into a single update cycle. */ export declare function batch(fn: () => T): T; /** * Read a signal without tracking it as a dependency. */ export declare function untrack(fn: () => T): T; /** * Check if we're currently inside a reactive tracking context. */ export declare function isTracking(): boolean; export type Component

= (props: P) => VNodeResult; export type VNodeResult = unknown; /** * Helper to create a component with reactive children. * Children that are functions will be treated as reactive accessors. */ export declare function children(fn: () => T): Accessor; //# sourceMappingURL=reactive.d.ts.map