finish adding type constraints
[scpubgit/DX.git] / lib / DX / Types.pm
index b34565b..627efe6 100644 (file)
@@ -7,20 +7,21 @@ use Type::Library
     (our @CLASSES = qw(
       Hypothesis Scope ResolvedPropositionSet Proposition DependencyMap
       PropositionSequence QueryState ShellState ShellSession SearchState
-      ResolutionSpace ResolutionStrategy Resolution
+      ResolutionSpace ResolutionStrategy Resolution Expander SearchProcess
     )),
     (our @ROLES = qw(
-      Step Action ActionPolicy Predicate Value
+      Step Action ActionPolicy Predicate Value ActionBuilder Update
     )),
     qw(
       DependencyType _DependencyTree DependencySpec
-      One DependencyGroupEntry DependencyGroup
+      One DependencyGroupEntry DependencyGroup ValuePath
+      EventType ApertureList DependencyList ShellMode
     ),
   )
 ;
 use Type::Utils -all;
 use Types::Standard qw(
-  ArrayRef Tuple HashRef Dict Maybe Optional slurpy Str
+  ArrayRef Tuple HashRef Dict Maybe Optional slurpy Str Enum
 );
 use DX::Utils qw(:event_types :dep_types);
 
@@ -34,6 +35,8 @@ foreach my $role (our @ROLES) {
 
 class_type DictValue => { class => 'DX::Value::Dict' };
 
+declare ValuePath => as ArrayRef[Str];
+
 declare PropositionList => as ArrayRef[Proposition];
 
 declare DecisionList => as ArrayRef[Tuple[ResolutionSpace, SearchState]];
@@ -54,7 +57,7 @@ declare EventType => where {
 
 declare _DependencyTree => where { is_DependencyTree($_) };
 
-declare DependencySpec => as Tuple[DependencyType, slurpy ArrayRef[Str]];
+declare DependencySpec => as Tuple[DependencyType, slurpy ValuePath];
 
 declare DependencyList => as ArrayRef[DependencySpec];
 
@@ -66,6 +69,10 @@ declare DependencyTree => # [ \%subtree, \%existence_of, ... ]
        (Optional[Maybe[HashRef[One]]]) x 4
      ]];
 
+declare ApertureList => as ArrayRef[Tuple[EventType, slurpy ValuePath]];
+
+declare ShellMode => as Enum[qw(shell query)];
+
 ## These were from the dependency group thing which makes no sense until
 ## we have scoping, so revisit it then
 #