import { Signals, SignalsFactory } from './signals-factory'; import { DerivedId, EventId } from './store-utils'; export declare const TRIGGER_NO_VALUE = "$INTERNAL_TRIGGER_NO_VALUE$"; export type TriggerNoValueType = typeof TRIGGER_NO_VALUE; /** * Type specifying the input {@link TriggerSignals} (the corresponding signal-sources are NOT added to the store * by the TriggerSignals-setup, but by whoever uses the signals, e.g. by extendSetup or fmap or just using dispatch). * * @template T - specifies the value type for the triggered signal */ export type TriggerInputSignals = { /** Behavior representing the input signal */ triggerInput: DerivedId; /** Event that triggers the current input as output */ trigger: EventId; }; /** * Type specifying the output {@link TriggerSignals} (signals produced by TriggerSignals). * * @template T - specifies the value type for the triggered signal */ export type TriggerOutputSignals = { /** * Behavior representing the triggered output signal. * Triggering the same input multiple times will NOT lead to multiple outputs (all behaviors are distinctUntilChanged). * You can instead use the triggered event, if you need to take action on each trigger event. */ triggeredOutput: DerivedId; /** * Event with the triggered output. * In contrast to triggeredOutput, triggering the same input multiple times will lead to the same number of triggered events. */ triggered: EventId; }; /** * This type specifies input and output signals of a triggerable behavior. * * @template T - specifies the value type for the triggered signal */ export type TriggerSignals = Signals, TriggerOutputSignals>; /** * This type specifies the type of the argument to {@link TriggerSignalsBuild}, hence the configuration of {@link TriggerSignals}. */ export type TriggerConfiguration = { /** Optional string to be used as argument to calls of getBehaviorId and getEventId */ nameExtension?: string; }; /** * Type specifying the {@link SignalsBuild} function for {@link TriggerSignals}, hence a function taking an {@link TriggerConfiguration} and producing TriggerSignals. * * @template T - specifies the value type for the triggered signal * @param {TriggerConfiguration} config - the configuration for the TriggerSignals */ export type TriggerSignalsBuild = (config: TriggerConfiguration) => TriggerSignals; /** * This type specifies a {@link SignalsFactory} wrapping {@link TriggerSignals}. * * @template T - specifies the value type for the triggered signal */ export type TriggerSignalsFactory = SignalsFactory, TriggerOutputSignals, TriggerConfiguration>; /** * This function creates a {@link TriggerSignalsFactory}. * * @template T - specifies the value type for the triggered signal * @returns {TriggerSignalsFactory} */ export declare const getTriggerSignalsFactory: () => TriggerSignalsFactory;