import type { DomicileHost, DomicileHostEventMap } from "../domicile-host"; /** Stops what subscribed it. */ export type Unsubscribe = () => void; /** A namespace's events, each as the listener it calls. */ export type Listeners = Record void>; /** Call `listener` on each `type` event until the returned function runs. */ export type On = (type: K, listener: L[K]) => Unsubscribe; /** What a namespace listens to on the host. */ export type EventHost = Pick; /** An `on` that subscribes each event the way `subscribers` says. */ export declare const on: (subscribers: { [K in keyof L]: (listener: L[K]) => Unsubscribe; }) => On; /** `listener` on each `type` event of `host`, until unsubscribed. */ export declare const hostEvent: (host: EventHost, type: T, listener: (event: DomicileHostEventMap[T]) => void) => Unsubscribe;