# cyberspacedk/typescript-book architecture

> Architecture diagram of the GitHub repository cyberspacedk/typescript-book, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cyberspacedk/typescript-book
- Repository: https://github.com/cyberspacedk/typescript-book

## Overview

This repository is a TypeScript learning resource: its README organizes lessons from JavaScript foundations and modern syntax through TypeScript projects, types, errors, tips, and compiler internals. The principal workflow is a learner consulting a topic and its runnable or illustrative code example. The tree contains examples rather than a runtime application, so there is no application data pipeline. The README establishes the learning topics; sampled examples show their implementation, but do not establish links between separate examples.

Main entry points: [`code/javascript/closure.ts`](https://github.com/cyberspacedk/typescript-book/blob/master/code/javascript/closure.ts) (Closures), [`code/async-await/es6/asyncAwaitES6.ts`](https://github.com/cyberspacedk/typescript-book/blob/master/code/async-await/es6/asyncAwaitES6.ts) (Async await), [`code/es6/classes/class.ts`](https://github.com/cyberspacedk/typescript-book/blob/master/code/es6/classes/class.ts) (Classes), [`code/es6/iterators.ts`](https://github.com/cyberspacedk/typescript-book/blob/master/code/es6/iterators.ts) (Iterators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_javascript["JavaScript foundations"]
  node_closures["Closures<br/>[closure.ts]"]
end

subgraph group_syntax["Language features"]
  node_async["Async await<br/>[asyncAwaitES6.ts]"]
  node_classes["Classes<br/>[class.ts]"]
  node_iterators["Iterators<br/>[iterators.ts]"]
  node_syntax_examples["ES features"]
end

subgraph group_typescript["TypeScript concepts"]
  node_dynamic_import["Dynamic import"]
  node_declaration_spaces["Declaration spaces"]
  node_type_inference["Type inference<br/>[type-inference.ts]"]
  node_interfaces["Interfaces<br/>[interfaces.ts]"]
  node_generics["Generics<br/>[generics.ts]"]
  node_type_guards["Type guards<br/>[typeGuard.ts]"]
  node_freshness["Freshness<br/>[freshness.ts]"]
  node_type_system["Type system examples"]
  node_errors["Type errors"]
  node_tips["TypeScript tips"]
end

subgraph group_internals["Compiler examples"]
  node_scanner["Scanner demos<br/>[runScanner.ts]"]
  node_scanner_positions["Scanner positions"]
  node_parser["Parser demo<br/>[runParser.ts]"]
end

node_learner(("Learner"))

node_learner -->|"studies"| node_closures
node_learner -->|"studies"| node_async
node_learner -->|"studies"| node_classes
node_learner -->|"studies"| node_iterators
node_learner -->|"studies"| node_syntax_examples
node_learner -->|"studies"| node_dynamic_import
node_learner -->|"studies"| node_declaration_spaces
node_learner -->|"studies"| node_type_inference
node_learner -->|"studies"| node_interfaces
node_learner -->|"studies"| node_generics
node_learner -->|"studies"| node_type_guards
node_learner -->|"studies"| node_freshness
node_learner -->|"studies"| node_type_system
node_learner -->|"studies"| node_errors
node_learner -->|"studies"| node_tips
node_learner -->|"studies"| node_scanner
node_learner -->|"studies"| node_scanner_positions
node_learner -->|"studies"| node_parser

click node_closures "https://github.com/cyberspacedk/typescript-book/blob/master/code/javascript/closure.ts"
click node_async "https://github.com/cyberspacedk/typescript-book/blob/master/code/async-await/es6/asyncAwaitES6.ts"
click node_classes "https://github.com/cyberspacedk/typescript-book/blob/master/code/es6/classes/class.ts"
click node_iterators "https://github.com/cyberspacedk/typescript-book/blob/master/code/es6/iterators.ts"
click node_syntax_examples "https://github.com/cyberspacedk/typescript-book/tree/master/code/es6"
click node_dynamic_import "https://github.com/cyberspacedk/typescript-book/blob/master/code/dynamic-import-expressions/dynamicImportExpression.ts"
click node_declaration_spaces "https://github.com/cyberspacedk/typescript-book/blob/master/code/declarationspaces/declarationspace.ts"
click node_type_inference "https://github.com/cyberspacedk/typescript-book/blob/master/code/types/type-inference.ts"
click node_interfaces "https://github.com/cyberspacedk/typescript-book/blob/master/code/types/interfaces.ts"
click node_generics "https://github.com/cyberspacedk/typescript-book/blob/master/code/types/generics.ts"
click node_type_guards "https://github.com/cyberspacedk/typescript-book/blob/master/code/types/typeGuard.ts"
click node_freshness "https://github.com/cyberspacedk/typescript-book/blob/master/code/types/freshness/freshness.ts"
click node_type_system "https://github.com/cyberspacedk/typescript-book/tree/master/code/types"
click node_errors "https://github.com/cyberspacedk/typescript-book/blob/master/code/errors/interpreting-errors.ts"
click node_tips "https://github.com/cyberspacedk/typescript-book/tree/master/code/tips"
click node_scanner "https://github.com/cyberspacedk/typescript-book/blob/master/code/compiler/scanner/runScanner.ts"
click node_scanner_positions "https://github.com/cyberspacedk/typescript-book/blob/master/code/compiler/scanner/runScannerWithPositions.ts"
click node_parser "https://github.com/cyberspacedk/typescript-book/blob/master/code/compiler/parser/runParser.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_closures toneBlue
class node_async,node_classes,node_iterators,node_syntax_examples toneAmber
class node_dynamic_import,node_declaration_spaces,node_type_inference,node_interfaces,node_generics,node_type_guards,node_freshness,node_type_system,node_errors,node_tips toneMint
class node_scanner,node_scanner_positions,node_parser toneRose
class node_learner toneIndigo
```

## Components

### JavaScript foundations

- [Closures](https://github.com/cyberspacedk/typescript-book/blob/master/code/javascript/closure.ts): `code/javascript/closure.ts`

### Language features

- [Async await](https://github.com/cyberspacedk/typescript-book/blob/master/code/async-await/es6/asyncAwaitES6.ts): `code/async-await/es6/asyncAwaitES6.ts`
- [Classes](https://github.com/cyberspacedk/typescript-book/blob/master/code/es6/classes/class.ts): `code/es6/classes/class.ts`
- [Iterators](https://github.com/cyberspacedk/typescript-book/blob/master/code/es6/iterators.ts): `code/es6/iterators.ts`
- [ES features](https://github.com/cyberspacedk/typescript-book/tree/master/code/es6): `code/es6`

### TypeScript concepts

- [Dynamic import](https://github.com/cyberspacedk/typescript-book/blob/master/code/dynamic-import-expressions/dynamicImportExpression.ts): `code/dynamic-import-expressions/dynamicImportExpression.ts`
- [Declaration spaces](https://github.com/cyberspacedk/typescript-book/blob/master/code/declarationspaces/declarationspace.ts): `code/declarationspaces/declarationspace.ts`
- [Type inference](https://github.com/cyberspacedk/typescript-book/blob/master/code/types/type-inference.ts): `code/types/type-inference.ts`
- [Interfaces](https://github.com/cyberspacedk/typescript-book/blob/master/code/types/interfaces.ts): `code/types/interfaces.ts`
- [Generics](https://github.com/cyberspacedk/typescript-book/blob/master/code/types/generics.ts): `code/types/generics.ts`
- [Type guards](https://github.com/cyberspacedk/typescript-book/blob/master/code/types/typeGuard.ts): `code/types/typeGuard.ts`
- [Freshness](https://github.com/cyberspacedk/typescript-book/blob/master/code/types/freshness/freshness.ts): `code/types/freshness/freshness.ts`
- [Type system examples](https://github.com/cyberspacedk/typescript-book/tree/master/code/types): `code/types`
- [Type errors](https://github.com/cyberspacedk/typescript-book/blob/master/code/errors/interpreting-errors.ts): `code/errors/interpreting-errors.ts`
- [TypeScript tips](https://github.com/cyberspacedk/typescript-book/tree/master/code/tips): `code/tips`

### Compiler examples

- [Scanner demos](https://github.com/cyberspacedk/typescript-book/blob/master/code/compiler/scanner/runScanner.ts): `code/compiler/scanner/runScanner.ts`
- [Scanner positions](https://github.com/cyberspacedk/typescript-book/blob/master/code/compiler/scanner/runScannerWithPositions.ts): `code/compiler/scanner/runScannerWithPositions.ts`
- [Parser demo](https://github.com/cyberspacedk/typescript-book/blob/master/code/compiler/parser/runParser.ts): `code/compiler/parser/runParser.ts`

### Other components

- **Learner**

## Connections

- Learner → Closures: studies
- Learner → Async await: studies
- Learner → Classes: studies
- Learner → Iterators: studies
- Learner → ES features: studies
- Learner → Dynamic import: studies
- Learner → Declaration spaces: studies
- Learner → Type inference: studies
- Learner → Interfaces: studies
- Learner → Generics: studies
- Learner → Type guards: studies
- Learner → Freshness: studies
- Learner → Type system examples: studies
- Learner → Type errors: studies
- Learner → TypeScript tips: studies
- Learner → Scanner demos: studies
- Learner → Scanner positions: studies
- Learner → Parser demo: studies
