/**
 * Utilities related to reactivity that we're not quite ready to expose in the public API but which are useful for
 * internal component development.
 *
 * @internal
 */

/**
 * @deprecated
 * @internal
 */
export interface Signal<T> {
  value: T;
  /**
   * @deprecated
   * @param mutateFn
   */
  mutate(mutateFn: (value: T) => void): void;
}

/**
 * @deprecated
 * @internal
 */
export interface ReactiveObservable {
  notify(): void;
}

/**
 * @deprecated
 * @internal
 */
export interface ReactiveTrackingTarget {
  clear(): void;
  destroy(): void;
}

/**
 * @deprecated
 * @param initialValue
 * @param equalityFunction
 * @internal
 */
export function signal<T>(initialValue: T, equalityFunction?: (a: T, b: T) => boolean): Signal<T>;

/**
 * @deprecated
 * @internal
 */
export function createObservable(): ReactiveObservable;

/**
 * @deprecated
 * @param notify
 * @internal
 */
export function createTrackingTarget(notify: () => void): ReactiveTrackingTarget;

/**
 * @deprecated
 * @param observable
 * @internal
 */
export function trackAccess(observable: ReactiveObservable): void;

/**
 * @deprecated
 * @param target
 * @param callback
 * @internal
 */
export function runTracked<T>(target: ReactiveTrackingTarget, callback: () => T): T | null;