UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

21 lines 1.08 kB
import { TListener } from "../eventing/t-listener.js"; import { IBroadcastChannel } from "../eventing/i-broadcast-channel.js"; import type { ICleanupRegistry } from "../lifecycle/cleanup-registry.js"; /** * @public * Like {@link BroadcastChannel} but without holding strong references. Available in debug contexts only. */ export declare class DebugWeakBroadcastChannel<TKey extends string, TArgs extends unknown[]> implements IBroadcastChannel<TKey, TArgs> { private readonly key; constructor(key: TKey); addListener(listener: TListener<TKey, TArgs>): void; addListener(store: ICleanupRegistry, listener: TListener<TKey, TArgs>): void; addOneTimeListener(listener: TListener<TKey, TArgs>): void; addOneTimeListener(store: ICleanupRegistry, listener: TListener<TKey, TArgs>): void; emit(...args: TArgs): void; removeListener(listener: TListener<TKey, TArgs>): void; getTargets(): readonly TListener<TKey, TArgs>[]; private readonly listenersSet; private readonly listenersMap; } //# sourceMappingURL=debug-weak-broadcast-event.d.ts.map