import { Observable } from 'rxjs'; import type { Labelled, Payload, Meta, Event, EventBus } from '../events'; export interface Factory

extends Labelled { (payload: P, meta?: M): Event; is: (event: Event) => event is Event; registered?: boolean; } export declare type ErrorLabelledEvent = Pick & { error: any; caught: Observable; }; export declare type EventWithHandler = { filter: string | ((event: Event) => boolean); handler?: (event: Event) => void | Observable | Promise | Promise>; skip?: number; take?: number; throws?: boolean; timeout?: number; }; export declare const DEFAULT_EVENT_TIMEOUT = 3000; export declare const TEST_THROW_ERROR_LABEL = "test-error-label"; /** * Helper function to simplify concatenation of events within a `ReplaySubject`. It takes * an array of enriched events where an event has a mandatory `filter` filtering function and * optional `skip` parameter to reach the exact event among similar ones. * Also events carry a `handler` which does post-processing when the event is caught. * If an observable is returned than the handler * pipes it into the ReplaySubject. This allows to simulate action-reaction on events * @param eventBus the `ReplaySubject` used to pipe events * @param events `EventWithHandler`-type events enriched with a handler * @returns a `Promise` which resolves when all events have been reached and handled, * on error it rejects * @see {@link EventWithHandler} */ export declare function actOnEvents(eventBus: EventBus, events: Array, eventTimeout?: number, throwLabel?: string): Promise; export declare function completeAndCount(eventBus: EventBus): Promise;