import type { Observable } from 'rxjs'; import { Subscription } from 'rxjs'; import type { PAYLOAD } from '../internal/tokens'; import type { TypeGuard } from './action'; import type { Action, ActionHandler, AnyAction, AnyActionHandler, Dispatch } from './action-bus.types'; /** * Action buses provide a way to subscribe to actions dispatched anywhere. */ export declare class ActionBus { private readonly internalAction$; protected readonly subscriptions: Subscription; /** * Getter for observable actions * * @return Action observable */ get action$(): Observable; /** * Dispatches an action into the action bus * * @param action The action to dispatch */ dispatch: Dispatch; /** * Registers a handler to this action bus * * @param handler handler that gets registered */ registerHandler(handler: AnyActionHandler): Subscription; /** * Registers a handler to this action bus * * @param guard type guard to filter actions * @param handler handler that gets registered */ registerHandler(guard: TypeGuard, handler: ActionHandler, ActionType['subtype']>>): Subscription; /** * Releases all subscriptions before destroying the action bus * */ dispose: () => void; }