<commit_before>import { FSM } from './ea-state-machine'

export interface State {
  name: string
  count?: number
  order?: number
  valid?: boolean
  changed?: boolean
  data?: any
}

export interface StateMap {
  [index: string]: State
  [index: number]: State
}

export interface Transition {
  name: string
  failingGuards: Guard[]
  fromState: State
  toState: State
  transitionDefinition: TransitionDefinition
}
export interface TransitionDefinitionMap {
  [index: string]: TransitionDefinition
  [index: number]: TransitionDefinition
}

export interface TransitionDefinition {
  name?: string
  order?: number
  valid?: boolean
  data?: any
  guards?: Guard[]
  from: State | State[] | StateResolveFunc
  to: State | State[] | StateResolveFunc
  select?(transitions, fsm)
  action(fsm: FSM)
}

export type StateResolveFunc = (fsm: FSM) => State[]

export interface Guard {
  (allStates: string, to: number, order: number, valid: boolean, data?: any)
}

export type TransitionFilter = (tansitions: Transition[], fsm?: FSM) => Transition[]
<commit_msg>fix(ts): types for action<commit_after>import { FSM } from './ea-state-machine'

export interface State {
  name: string
  count?: number
  order?: number
  valid?: boolean
  changed?: boolean
  data?: any
}

export interface StateMap {
  [index: string]: State
  [index: number]: State
}

export interface Transition {
  name: string
  failingGuards: Guard[]
  fromState: State
  toState: State
  transitionDefinition: TransitionDefinition
}
export interface TransitionDefinitionMap {
  [index: string]: TransitionDefinition
  [index: number]: TransitionDefinition
}

export interface TransitionDefinition {
  name?: string
  order?: number
  valid?: boolean
  data?: any
  guards?: Guard[]
  from: State | State[] | StateResolveFunc
  to: State | State[] | StateResolveFunc
  select?(transitions, fsm)
  action(fsm: FSM, from: State, to: State)
}

export type StateResolveFunc = (fsm: FSM) => State[]

export interface Guard {
  (allStates: string, to: number, order: number, valid: boolean, data?: any)
}

export type TransitionFilter = (tansitions: Transition[], fsm?: FSM) => Transition[]

{'fraction_non_alphanumeric': 0.11384758364312268, 'fraction_numerical': 0.0, 'mean_word_length': 4.695767195767195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2039695', 'n_tokens_mistral': 641, 'n_tokens_neox': 634, 'n_words': 211}