import { CONFIG } from '../shared/config'; import { ExplicitCondition, ExtendsCaseMapA, ExtendsCaseMapB, ExtendsCaseMapC } from './app'; type IfMode = CONFIG['conditionWay']; type AType = ExtendsCaseMapA[IfMode]; type BType = ExtendsCaseMapB[IfMode]; type CType = ExtendsCaseMapC[IfMode]; interface Explicit { condition: Condition; then: Then; else: Else; } interface Modes { 'singleLine': Explicit; 'natural': Explicit; 'explicit': Explicit; } declare global { /** * @rt_keyword * * Conditional type that selects one of two possible types based on a boolean condition or a condition object. * The way as you declare condition can be changed in your rt.config.ts file * * @example * 'Single Line' * type A = If; * // ^ Type A = string * * 'natural' * type A = If; * * 'explicit' * type A = If<{ * condition: true; * then: string; * else: number; * }>; */ type $if = ExplicitCondition[IfMode]>; } export {};