import type { XModuleName } from '../x-modules/x-modules.types'; import type { TimedWireOperatorOptions, TimeSelector, Wire, WireParams } from './wiring.types'; /** * Creates a {@link Wire} that is only executed whenever the condition in the filterFn is true. * * @param wire - The wire to filter. * @param filterFn - A function which must return a boolean and that will be executed every time * the wire is called. * @returns The Wire function filter. * * @public */ export declare function filter(wire: Wire, filterFn: (parameters: WireParams) => boolean): Wire; /** * Creates a {@link Wire} that is only executed when the payload is truthy. A truthy value is * whatever is not a {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy | falsy value}. * * @param wire - The wire to avoid executing when the payload is falsy. * @returns The Wire function falsy filter. * * @public */ export declare function filterFalsyPayload(wire: Wire>): Wire; /** * Creates a {@link Wire} that is only executed when the payload is a * {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy | falsy value}. * * @param wire - The wire to avoid executing when the payload is truthy. * @returns The Wire function truthy filter. * * @public */ export declare function filterTruthyPayload(wire: Wire): Wire; /** * Creates a {@link Wire} that is only executed if the event is emitted from a {@link XModule} * that is included * in the `whitelist` array passed as parameter. * * @param wire - The wire to filter using the whitelist. * @param whitelist - An array of {@link XModuleName} or null. * @returns The Wire function with whitelisted modules filter. * * @public */ export declare function filterWhitelistedModules(wire: Wire, whitelist: Array): Wire; /** * Creates a {@link Wire} that is only executed if the event is emitted from a {@link XModule} * that is NOT included * in the `blacklist` array passed as parameter. * * @param wire - The wire to filter using the whitelist. * @param blacklist - An array of {@link XModuleName} or null. * @returns The Wire function with blacklisted modules filter. * * @public */ export declare function filterBlacklistedModules(wire: Wire, blacklist: Array): Wire; /** * Creates a debounced {@link Wire}. Being debounced means that it will only be executed after * the time given by `timeInMs` has passed without invoking it. * * @param wire - The wire to debounce. * @param timeInMs - The time in milliseconds to debounce the wire execution or a function to * retrieve it from the store. * @param options - Options to configure this wire with, like an event to force it or cancel it. * @returns The Wire function with a debounced timing. * * @public */ export declare function debounce(wire: Wire, timeInMs: TimeSelector | number, options?: TimedWireOperatorOptions): Wire; /** * Creates a throttled {@link Wire}. Being throttled means that it will only be executed once * every couple of milliseconds given by the `timeInMs` parameter. * * @param wire - The wire to throttle. * @param timeInMs - The time in milliseconds to throttle the wire execution or a function to * retrieve it from the store. * @param options - Options to configure this wire with, like an event to force it or cancel it. * @returns The Wire function with a throttle timing. * * @public */ export declare function throttle(wire: Wire, timeInMs: TimeSelector | number, options?: TimedWireOperatorOptions): Wire; /** * Creates a {@link Wire} from other `toWire` wire. It uses `mapFn` to transform the * `FromPayload` received to `ToPayload` which `toWire` requires. This is * useful to reuse wires in different Events where the payload doesn't fit exactly. * * @param toWire - The wire which the new Wire is created from. * @param mapFn - Function to map the payload from `FromPayload` to `ToPayload`. * @returns A new {@link Wire}. * * @public */ export declare function mapWire(toWire: Wire, mapFn: (payload: FromPayload) => ToPayload): Wire; //# sourceMappingURL=wires.operators.d.ts.map