ts-flex-query
Version:
Flexible and type-safe data queries
6 lines (5 loc) • 649 B
TypeScript
import { PipeOperator } from '../../core';
/** Returns the @see thenValue if @see condition evaluates to true and @see elseValue otherwise. */
export declare function ifThenElse<TInput, TThen, TElse>(condition: NoInfer<PipeOperator<TInput, boolean>>, thenValue: PipeOperator<TInput, TThen>, elseValue: PipeOperator<TInput, TElse>): PipeOperator<TInput, TThen | TElse>;
/** Returns the @see thenValue if @see condition evaluates to true. Otherwise, returns undefined. */
export declare function ifThen<TInput, TThen>(condition: NoInfer<PipeOperator<TInput, boolean>>, thenValue: PipeOperator<TInput, TThen>): PipeOperator<TInput, TThen | undefined>;