import { type WalletInterface, type WalletNotification } from './generated/bark'; type Unsubscribe = () => void; /** * Wraps the pull-based {@link NotificationHolderInterface} into a subscribe/unsubscribe API. * * The internal polling loop starts when the first listener subscribes and stops when the * last listener unsubscribes. Re-subscribing after all listeners have been removed creates * a fresh {@link NotificationHolderInterface} and restarts the loop. * * @example * ```ts * const notifications = new WalletNotifications(wallet); * * const unsubscribe = notifications.subscribe((event) => { * switch (event.tag) { * case WalletNotification_Tags.MovementCreated: * console.log('movement created', event.inner.movement); * break; * case WalletNotification_Tags.MovementUpdated: * console.log('movement updated', event.inner.movement); * break; * case WalletNotification_Tags.ChannelLagging: * console.log('channel lagging'); * break; * } * }); * * // later… * unsubscribe(); * ``` */ export declare class WalletNotifications { private readonly wallet; private holder; private readonly listeners; constructor(wallet: WalletInterface); subscribe(listener: (event: WalletNotification) => void): Unsubscribe; private startLoop; } export {}; //# sourceMappingURL=WalletNotifications.d.ts.map