@empathyco/x-components
Version:
Empathy X Components
38 lines • 1.88 kB
TypeScript
import type { Observable } from 'rxjs';
import type { Store } from 'vuex';
import type { RootXStoreState } from '../store/store.types';
import type { MaybeArray } from '../utils/types';
import type { XBus } from '../x-bus';
import type { XEvent, XEventsTypes } from './events.types';
import type { TimedWireOperatorOptions, TimeSelector, WireMetadata } from './wiring.types';
/**
* Creates the observable for the events that will be racing the wire's execution.
*
* @param events - The events to merge its observables.
* @param on - The on function of the XBus where the events will run.
* @returns The observable for the racing events.
* @internal
*/
export declare function mergeEvents(events: MaybeArray<XEvent>, on: XBus<XEventsTypes, WireMetadata>['on']): Observable<void>;
/**
* Checks how to retrieve the timeout time, retrieves it and returns it in ms.
*
* @param timeInMs - Time for the timeout in ms.
* @param store - The store of the wire that will be timed out.
* @returns The time in ms for the timeout.
* @internal
*/
export declare function normalizeTime(timeInMs: TimeSelector | number, store: Store<RootXStoreState>): number;
/**
* Creates a timer observable that depending on the provided options might be aborted or forced.
*
* @param durationInMs - The duration in ms for the timer.
* @param options - Options to configure the timer, like an events to force it or cancel it.
* @param options.cancelOn - cancelOn option.
* @param options.forceOn - forceOn option.
* @param on - The {@link XBus.on} method.
* @returns A timer observable that can be aborted or forced depending on the provided options.
* @internal
*/
export declare function createTimer(durationInMs: number, { cancelOn, forceOn }: TimedWireOperatorOptions, on: XBus<XEventsTypes, WireMetadata>['on']): Observable<unknown>;
//# sourceMappingURL=wires-operators.utils.d.ts.map