@@ -31,7 +31,7 @@ THE SOFTWARE.
3131
3232import { type TSchema , type TSchemaOptions } from '../types/schema.ts'
3333import { type TDeferred , Deferred } from '../types/deferred.ts'
34- import { type TInstantiate , Instantiate } from '../engine/instantiate.ts'
34+ import { type TConditionalAction , ConditionalAction } from '../engine/conditional /instantiate.ts'
3535
3636// ------------------------------------------------------------------
3737// Deferred
@@ -41,17 +41,17 @@ export type TConditionalDeferred<Left extends TSchema, Right extends TSchema, Tr
4141 TDeferred < 'Conditional' , [ Left , Right , True , False ] >
4242)
4343/** Creates a deferred Conditional action. */
44- export function ConditionalDeferred < Left extends TSchema , Right extends TSchema , True extends TSchema , False extends TSchema > ( left : Left , right : Right , true_ : True , false_ : False , options : TSchemaOptions = { } ) : TConditionalDeferred < Left , Right , True , False > {
44+ export function ConditionalDeferred < Left extends TSchema , Right extends TSchema , True extends TSchema , False extends TSchema >
45+ ( left : Left , right : Right , true_ : True , false_ : False , options : TSchemaOptions = { } ) :
46+ TConditionalDeferred < Left , Right , True , False > {
4547 return Deferred ( 'Conditional' , [ left , right , true_ , false_ ] , options ) as never
4648}
4749// ------------------------------------------------------------------
4850// Type
4951// ------------------------------------------------------------------
5052/** Applies a Conditional action to the given types. */
51- export type TConditional < Left extends TSchema , Right extends TSchema , True extends TSchema , False extends TSchema > = (
52- TInstantiate < { } , TConditionalDeferred < Left , Right , True , False > >
53- )
54- /** Applies a Conditional action to the given types. */
55- export function Conditional < Left extends TSchema , Right extends TSchema , True extends TSchema , False extends TSchema > ( left : Left , right : Right , true_ : True , false_ : False , options : TSchemaOptions = { } ) : TConditional < Left , Right , True , False > {
56- return Instantiate ( { } , ConditionalDeferred ( left , right , true_ , false_ , options ) ) as never
53+ export function Conditional < Left extends TSchema , Right extends TSchema , True extends TSchema , False extends TSchema >
54+ ( left : Left , right : Right , true_ : True , false_ : False , options : TSchemaOptions = { } ) :
55+ TConditionalAction < { } , { callstack : [ ] } , Left , Right , True , False > {
56+ return ConditionalAction ( { } , { callstack : [ ] } , left , right , true_ , false_ , options ) as never
5757}
0 commit comments