/**
 * Forma Reactive - Signal
 *
 * Fine-grained reactive primitive backed by alien-signals.
 * API: createSignal returns [getter, setter] tuple following SolidJS conventions.
 *
 * TC39 Signals equivalent: Signal.State
 */
/** Debug name of a signal getter, if one was provided (dev-only). */
declare function getSignalName(fn: unknown): string | undefined;
/** A function that reads the current value of a signal. */
type SignalGetter<T> = () => T;
/** A function that updates a signal — accepts a value or an updater function. */
type SignalSetter<T> = (v: T | ((prev: T) => T)) => void;
interface SignalOptions<T> {
    /** Debug name — attached to getter in dev mode for devtools inspection. */
    name?: string;
    /**
     * Custom equality check. When provided, the setter will read the current
     * value and only update the signal if `equals(prev, next)` returns `false`.
     *
     * Default: none (alien-signals uses strict inequality `!==` internally).
     *
     * ```ts
     * const [pos, setPos] = createSignal(
     *   { x: 0, y: 0 },
     *   { equals: (a, b) => a.x === b.x && a.y === b.y },
     * );
     *
     * setPos({ x: 0, y: 0 }); // skipped — equals returns true
     * setPos({ x: 1, y: 0 }); // applied — equals returns false
     * ```
     */
    equals?: (prev: T, next: T) => boolean;
}
/**
 * Wrap a value so the setter treats it as a literal value, not a functional updater.
 *
 * When `T` is itself a function type, passing a function to the setter is
 * ambiguous -- it looks like a functional update (`prev => next`). Use
 * `value()` to disambiguate:
 *
 * ```ts
 * const [getFn, setFn] = createSignal<() => void>(() => console.log('a'));
 *
 * // BUG: interpreted as a functional update -- calls the arrow with prev
 * // setFn(() => console.log('b'));
 *
 * // Correct: wraps in a thunk so the setter stores it as-is
 * setFn(value(() => console.log('b')));
 * ```
 */
declare function value<T>(v: T): () => T;
/**
 * Create a reactive signal.
 *
 * ```ts
 * const [count, setCount] = createSignal(0);
 * console.log(count()); // 0
 * setCount(1);
 * setCount(prev => prev + 1);
 * ```
 *
 * With custom equality:
 *
 * ```ts
 * const [pos, setPos] = createSignal(
 *   { x: 0, y: 0 },
 *   { equals: (a, b) => a.x === b.x && a.y === b.y },
 * );
 * ```
 */
declare function createSignal<T>(initialValue: T, options?: SignalOptions<T>): [get: SignalGetter<T>, set: SignalSetter<T>];

export { type SignalGetter as S, type SignalSetter as a, type SignalOptions as b, createSignal as c, getSignalName as g, value as v };
