# Contents

The Itinera book for TypeScript, in reading order. It follows the plan that every language's book shares, [BOOK.md](https://github.com/itinera-dev/book/blob/main/BOOK.md), which also says what each chapter covers. Every program the chapters show is complete: the examples run with `node build/examples/NAME.js` from the book's `typescript` directory, and the tests of the programs in [tested](https://github.com/itinera-dev/book/tree/main/typescript/tested/) with `node --test build/tested/NAME.test.js`, once you have built them as [its README](https://github.com/itinera-dev/book/blob/main/typescript/README.md) says.

## Welcome

- [Welcome to Itinera](https://itinera-dev.org/book/typescript/welcome-to-itinera.md)
- [How to read this book](https://itinera-dev.org/book/typescript/how-to-read-this-book.md)

## Part 1: Why Itinera

1. [But why Itinera?](https://itinera-dev.org/book/typescript/01-but-why-itinera.md)
2. [The big picture](https://itinera-dev.org/book/typescript/02-the-big-picture.md)

## Part 2: Getting started

3. [Installing Itinera](https://itinera-dev.org/book/typescript/03-installing-itinera.md)
4. [A first step](https://itinera-dev.org/book/typescript/04-a-first-step.md)
5. [A first journey](https://itinera-dev.org/book/typescript/05-a-first-journey.md)
6. [Passing data on](https://itinera-dev.org/book/typescript/06-passing-data-on.md)
7. [Giving a step the tools it needs](https://itinera-dev.org/book/typescript/07-giving-a-step-the-tools-it-needs.md)
8. [Seeing what happened](https://itinera-dev.org/book/typescript/08-seeing-what-happened.md)
9. [Saying what only a step knows](https://itinera-dev.org/book/typescript/09-saying-what-only-a-step-knows.md)
10. [More than one reporter](https://itinera-dev.org/book/typescript/10-more-than-one-reporter.md)
11. [Naming a journey](https://itinera-dev.org/book/typescript/11-naming-a-journey.md)
12. [Trying again](https://itinera-dev.org/book/typescript/12-trying-again.md)
13. [A carrier for each attempt](https://itinera-dev.org/book/typescript/13-a-carrier-for-each-attempt.md)
14. [Repairing, then trying once more](https://itinera-dev.org/book/typescript/14-repairing-then-trying-once-more.md)
15. [Reacting to what a step did](https://itinera-dev.org/book/typescript/15-reacting-to-what-a-step-did.md)
16. [Skipping a step](https://itinera-dev.org/book/typescript/16-skipping-a-step.md)
17. [Giving up a step early](https://itinera-dev.org/book/typescript/17-giving-up-a-step-early.md)
18. [Doing something when the journey ends](https://itinera-dev.org/book/typescript/18-doing-something-when-the-journey-ends.md)
19. [Letting policies act on the outside world](https://itinera-dev.org/book/typescript/19-letting-policies-act-on-the-outside-world.md)
20. [An optional input](https://itinera-dev.org/book/typescript/20-an-optional-input.md)
21. [Deciding where a step's data comes from](https://itinera-dev.org/book/typescript/21-deciding-where-a-steps-data-comes-from.md)

## Part 3: Controlling the flow

22. [Finishing a journey early](https://itinera-dev.org/book/typescript/22-finishing-a-journey-early.md)
23. [Undoing a charge when the shipping fails](https://itinera-dev.org/book/typescript/23-undoing-a-charge-when-the-shipping-fails.md)

## Part 4: Running it for real

24. [Running many journeys](https://itinera-dev.org/book/typescript/24-running-many-journeys.md)
25. [Reading the result](https://itinera-dev.org/book/typescript/25-reading-the-result.md)
26. [Running async journeys while others wait](https://itinera-dev.org/book/typescript/26-running-async-journeys-while-others-wait.md)
27. [Testing a step alone](https://itinera-dev.org/book/typescript/27-testing-a-step-alone.md)
28. [Testing a hook or an adapter alone](https://itinera-dev.org/book/typescript/28-testing-a-hook-or-an-adapter-alone.md)
29. [Testing the flow with scripted steps](https://itinera-dev.org/book/typescript/29-testing-the-flow-with-scripted-steps.md)
30. [Testing a whole journey](https://itinera-dev.org/book/typescript/30-testing-a-whole-journey.md)
31. [Stopping a journey when its log fails](https://itinera-dev.org/book/typescript/31-stopping-a-journey-when-its-log-fails.md)
32. [Seeing every event of a journey](https://itinera-dev.org/book/typescript/32-seeing-every-event-of-a-journey.md)
33. [Giving every reporter what it needs](https://itinera-dev.org/book/typescript/33-giving-every-reporter-what-it-needs.md)
34. [Saying which attempt took the money](https://itinera-dev.org/book/typescript/34-saying-which-attempt-took-the-money.md)
35. [Giving the rescue step a service of its own](https://itinera-dev.org/book/typescript/35-giving-the-rescue-step-a-service-of-its-own.md)
36. [Orders refused before they start](https://itinera-dev.org/book/typescript/36-orders-refused-before-they-start.md)
37. [Mistakes caught before a journey](https://itinera-dev.org/book/typescript/37-mistakes-caught-before-a-journey.md)
38. [Declaring by hand](https://itinera-dev.org/book/typescript/38-declaring-by-hand.md)

## Part 5: Designing with Itinera

39. [Deciding where a decision belongs](https://itinera-dev.org/book/typescript/39-deciding-where-a-decision-belongs.md)
40. [Recognising a decision in the wrong place](https://itinera-dev.org/book/typescript/40-recognising-a-decision-in-the-wrong-place.md)
41. [Bringing Itinera into existing code](https://itinera-dev.org/book/typescript/41-bringing-itinera-into-existing-code.md)
42. [Using a step in another workflow](https://itinera-dev.org/book/typescript/42-using-a-step-in-another-workflow.md)
43. [Working with agents](https://itinera-dev.org/book/typescript/43-working-with-agents.md)

## Appendices

- Appendix 1: [Cheat sheet](https://itinera-dev.org/book/typescript/appendix-1-cheat-sheet.md)
- Appendix 2: [Glossary](https://itinera-dev.org/book/typescript/appendix-2-glossary.md)
- Appendix 3: [What this version supports](https://itinera-dev.org/book/typescript/appendix-3-what-this-version-supports.md)
