@empathyco/x-components
Version:
Empathy X Components
36 lines • 1.83 kB
TypeScript
import { Observable } from 'rxjs';
import { Store } from 'vuex';
import { XBus } from '@empathyco/x-bus';
import { RootXStoreState } from '../store/store.types';
import { MaybeArray } from '../utils/types';
import { XEvent, XEventsTypes } from './events.types';
import { 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 {@link @empathyco/x-bus#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 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