import { UseCase , Context , Store } from "../../src" ; class MyStore extends Store < { } > { constructor ( args ) { super ( ) ; this . name = args . name ; } getState ( ) { return { } ; } } class MyUseCaseNoArgument extends UseCase { execute ( ) { } } class MyUseCaseA extends UseCase { execute ( _a ) { } } class MyUseCaseB extends UseCase { execute ( _a , _b ) { } } class MyUseCaseObj extends UseCase { execute ( _args ) { } } class MyUseCaseOptional extends UseCase { execute ( _value ? ) { } } class MyUseCaseDefault extends UseCase { execute ( _value = "default value" ) { } } const context = new Context ( { store : new MyStore ( { name : "test" } ) } ) ; context . useCase ( new MyUseCaseNoArgument ( ) ) . execute ( ) ; context . useCase ( new MyUseCaseA ( ) ) . execute ( "A" ) ; context . useCase ( new MyUseCaseB ( ) ) . execute ( "B" , 2 ) ; context . useCase ( new MyUseCaseObj ( ) ) . execute ( { a : "A" , b : 2 } ) ; context . useCase ( new MyUseCaseOptional ( ) ) . execute ( ) ; context . useCase ( new MyUseCaseOptional ( ) ) . execute ( "string" ) ; context . useCase ( new MyUseCaseDefault ( ) ) . execute ( ) ; context . useCase ( new MyUseCaseDefault ( ) ) . execute ( "string" ) ; context . useCase ( new MyUseCaseA ( ) ) . execute ( ) ; context . useCase ( new MyUseCaseA ( ) ) . execute ( 1 ) ; context . useCase ( new MyUseCaseA ( ) ) . execute ( 1 , 2 ) ; context . useCase ( new MyUseCaseA ( ) ) . execute ( { key : "value" } ) ; context . useCase ( new MyUseCaseB ( ) ) . execute ( 1 , 2 ) ; context . useCase ( new MyUseCaseObj ( ) ) . execute ( { a : 1 , b : 2 } ) ; context . useCase ( new MyUseCaseOptional ( ) ) . execute ( 1 , 1 ) ; context . useCase ( new MyUseCaseA ( ) ) . execute ( "A" , 1 , 1 ) ; context . useCase ( new MyUseCaseA ( ) ) . executor ( ( useCase ) => useCase . execute ( "A" , 1 , 1 ) ) ; context . useCase ( new MyUseCaseDefault ( ) ) . execute ( { "incompatible type" : 1 } ) ;