Raxol.Docs.InteractiveTutorial.State (Raxol v0.4.0)

View Source

Manages the state of the interactive tutorial system.

Summary

Functions

Gets the current step from the state.

Marks a tutorial as completed.

Creates a new empty state.

Updates the progress for a tutorial.

Types

progress()

@type progress() :: %{
  completed: boolean(),
  completed_steps: [step_id()],
  last_step: step_id() | nil
}

step_id()

@type step_id() :: String.t()

t()

@type t() :: %Raxol.Docs.InteractiveTutorial.State{
  bookmarks: %{required(tutorial_id()) => step_id()},
  current_step: step_id() | nil,
  current_tutorial: tutorial_id() | nil,
  history: [{atom(), tutorial_id(), step_id()}],
  progress: %{required(tutorial_id()) => progress()},
  tutorials: %{
    required(tutorial_id()) =>
      Raxol.Docs.InteractiveTutorial.Models.Tutorial.t()
  }
}

tutorial_id()

@type tutorial_id() :: String.t()

Functions

get_current_step(state)

Gets the current step from the state.

mark_completed(state, tutorial_id)

Marks a tutorial as completed.

new()

Creates a new empty state.

update_progress(state, tutorial_id, step_id)

Updates the progress for a tutorial.