@coorpacademy/progression-engine
Version:
7 lines (5 loc) • 3.28 kB
Flow
// @flow
import updateState from "./update-state";
import {getConfig} from "./config";
import type {Config, Progression, State} from "./types";
declare export default function(progression: {actions: Array<{type: "init"} | {payload: {instructions: Array<{field: string, type: "add" | "set", value: number | boolean | string}> | null, nextContent: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}}, type: "move"} | {payload: {answer: Array<string>, content: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}, godMode: ?boolean, instructions: Array<{field: string, type: "add" | "set", value: number | boolean | string}> | null, isCorrect: ?boolean, nextContent: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}}, type: "answer"} | {payload: {content: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}}, type: "clue"} | {payload: {content: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}, instructions: Array<{field: string, type: "add" | "set", value: number | boolean | string}> | null, nextContent: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}}, type: "extraLifeAccepted"} | {payload: {content: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}, nextContent: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}}, type: "extraLifeRefused"} | {payload: {content: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}, resource: {ref: string, type: "video" | "pdf", version?: string}}, type: "resource"} | {payload: {instructions: Array<{field: string, type: "add" | "set", value: number | boolean | string}> | null, nextContent: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}}, type: "move"}>, content: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}, engine: {ref: string, version: string}, engineOptions: {lives?: number, livesDisabled?: boolean}}): {content?: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}, nextContent: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}} & {allAnswers: Array<{answer: Array<string>, isCorrect: ?boolean, slideRef: string}>, content?: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}, hasViewedAResourceAtThisStep: boolean, isCorrect: ?boolean, lives: number, livesDisabled?: boolean, nextContent?: {ref: string, type: string, version?: string} | {ref: string, type: "video" | "pdf", version?: string}, remainingLifeRequests: number, requestedClues: Array<string>, slides: Array<string>, stars: number, step: {current: number}, variables: {[_: string]: string | boolean | number}, viewedResources: Array<{ref: string, resources: Array<string>, type: mixed /* UNEXPECTED TYPE: EvalT */}>};