import { ISignal } from "../internals"; export interface Observable extends ISignal { subscribe(run: (value: T) => void): () => void; map(mapFn: (value: T) => U): Observable; filter(predicate: (value: T) => boolean): Observable; } /** * Creates an observable that allows subscribing to values and provides methods for * mapping and filtering. The observable is hot and lazy, meaning it will only start * emitting values when it has at least one subscriber. When all subscribers unsubscribe, * it will stop emitting values. The observable is also synchronous, meaning it will * emit values immediately when they are available. The observable is also a signal, so * it can be used in place of a signal. * * @template T - The type of the values emitted by the observable. * @param {function((value: T) => void): () => void} setup - A function that sets up the * observable. It receives an emit function to emit values and returns a teardown function * to clean up resources. * @returns {Observable} An observable object with methods to map, filter, subscribe, * and convert to a signal. */ export declare function observable(setup: (emit: (value: T) => void) => () => void): Observable; /** * Creates an observable from a DOM event. * * @template K - The type of the event name, which must be a key of `HTMLElementEventMap`. * @param {HTMLElement} element - The DOM element to listen for events on. * @param {K} eventName - The name of the event to listen for. * @returns {Observable} An observable that emits events * of the specified type. */ export declare function fromDomEvent(element: HTMLElement, eventName: K): Observable; export declare function map(source: Observable, mapFn: (value: T) => U): Observable; export declare function filter(source: Observable, predicate: (value: T) => boolean): Observable;