export type ReactiveChangeHandler = (instance: ReactiveInstance) => unknown; export type ReactiveExpression = (prev?: T) => T; export type ReactiveValue = { readonly value: T; onChanged: (handler: ReactiveChangeHandler) => void; offChanged: (handler: ReactiveChangeHandler) => void; }; export type ReactiveSource = { value: T; onChanged: (handler: ReactiveChangeHandler) => void; offChanged: (handler: ReactiveChangeHandler) => void; }; export type ReactiveInstance = { readonly value: T; markDirty(): void; rippleChanged(): void; }; /** * Creates a reactive instance with the given initial value. * * @template T - The type of the reactive instance. * @param initialValue - The initial value of the reactive instance. * @returns A reactive instance with the given initial value. */ export declare function reactiveSource(initialValue: T): ReactiveSource; /** * Creates a reactive value that tracks changes to a given expression. * * @template T - The type of the reactive value. * @param {function(prev?: T): T} expression - The expression to track changes for. * @param {T} [initialValue] - The initial value of the reactive value. * @returns {ReactiveValue} - The reactive value. */ export declare function reactive(expression: (prev?: T) => T, initialValue?: T): ReactiveValue; /** * Creates a computed value based on a reactive expression. * @param expression The reactive expression to compute. * @returns A function that returns the computed value. */ export declare function computed(expression: ReactiveExpression): () => T;