// @flow import type {Content} from '../types'; import type {OperatorKeys} from './condition-operators'; type Target = | { scope: 'variable', field: 'lives' | 'stars' | string } | { scope: 'slide', ref: string, field: 'isCorrect' | 'answer' }; type Condition = { target: Target, operator: OperatorKeys, values: Array> }; type Instruction = { field: string, type: 'add' | 'set', value: number | boolean | string }; type ChapterRule = { source: Content, destination: Content, instructions: Array, conditions: Array, priority: number, ref?: string }; type Variables = { lives: number, stars: number, variables: {[string]: string | boolean | number} }; export type {ChapterRule, Condition, Instruction, OperatorKeys, Target, Variables};