@@ -50,6 +50,7 @@ import { type TDeferred, Deferred, IsDeferred } from '../types/deferred.ts'
5050import { type TFunction , _Function_ , IsFunction , FunctionOptions } from '../types/function.ts'
5151import { type TCall , IsCall } from '../types/call.ts'
5252import { type TIdentifier } from '../types/identifier.ts'
53+ import { type TIf , If , IsIf , IfOptions } from '../types/if.ts'
5354import { type TIntersect , Intersect , IsIntersect , IntersectOptions } from '../types/intersect.ts'
5455import { type TIterator , Iterator , IsIterator , IteratorOptions } from '../types/iterator.ts'
5556import { type TObject , Object , IsObject , ObjectOptions } from '../types/object.ts'
@@ -305,9 +306,10 @@ export type TInstantiateType<Context extends TProperties, State extends TState,
305306 Type extends TArray < infer Type extends TSchema > ? TArray < TInstantiateType < Context , State , Type > > :
306307 Type extends TAsyncIterator < infer Type extends TSchema > ? TAsyncIterator < TInstantiateType < Context , State , Type > > :
307308 Type extends TCall < infer Target extends TSchema , infer Parameters extends TSchema [ ] > ? TCallInstantiate < Context , State , Target , Parameters > :
308- Type extends TConstructor < infer Parameters extends TSchema [ ] , infer InstanceType extends TSchema > ? TConstructor < TInstantiateTypes < Context , State , Parameters > , TInstantiateType < Context , State , InstanceType > > :
309+ Type extends TConstructor < infer Parameters extends TSchema [ ] , infer InstanceType extends TSchema > ? TConstructor < TInstantiateTypes < Context , State , Parameters > , TInstantiateType < Context , State , InstanceType > > :
309310 Type extends TDeferred < infer Action extends string , infer Types extends TSchema [ ] > ? TInstantiateDeferred < Context , State , Action , Types > :
310311 Type extends TFunction < infer Parameters extends TSchema [ ] , infer ReturnType extends TSchema > ? TFunction < TInstantiateTypes < Context , State , Parameters > , TInstantiateType < Context , State , ReturnType > > :
312+ Type extends TIf < infer If extends TSchema , infer Then extends TSchema , infer Else extends TSchema > ? TIf < TInstantiateType < Context , State , If > , TInstantiateType < Context , State , Then > , TInstantiateType < Context , State , Else > > :
311313 Type extends TIntersect < infer Types extends TSchema [ ] > ? TIntersect < TInstantiateTypes < Context , State , Types > > :
312314 Type extends TIterator < infer Type extends TSchema > ? TIterator < TInstantiateType < Context , State , Type > > :
313315 Type extends TObject < infer Properties extends TProperties > ? TObject < TInstantiateProperties < Context , State , Properties > > :
@@ -338,6 +340,7 @@ export function InstantiateType<Context extends TProperties, State extends TStat
338340 IsConstructor ( type ) ? Constructor ( InstantiateTypes ( context , state , type . parameters ) , InstantiateType ( context , state , type . instanceType ) as never , ConstructorOptions ( type ) ) :
339341 IsDeferred ( type ) ? InstantiateDeferred ( context , state , type . action , type . parameters , type . options ) :
340342 IsFunction ( type ) ? _Function_ ( InstantiateTypes ( context , state , type . parameters ) , InstantiateType ( context , state , type . returnType ) as never , FunctionOptions ( type ) ) :
343+ IsIf ( type ) ? If ( InstantiateType ( context , state , type . if ) , InstantiateType ( context , state , type . then ) , InstantiateType ( context , state , type . else ) , IfOptions ( type ) ) :
341344 IsIntersect ( type ) ? Intersect ( InstantiateTypes ( context , state , type . allOf ) , IntersectOptions ( type ) ) :
342345 IsIterator ( type ) ? Iterator ( InstantiateType ( context , state , type . iteratorItems ) , IteratorOptions ( type ) ) :
343346 IsObject ( type ) ? Object ( InstantiateProperties ( context , state , type . properties ) , ObjectOptions ( type ) ) :
0 commit comments