Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| note:thu_jun_19_2025 [2025/06/19 09:38] – root1 | note:thu_jun_19_2025 [2025/06/19 09:42] (current) – root1 | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| ====== The type hierarchy in TypeScript ====== | ====== The type hierarchy in TypeScript ====== | ||
| - | {{ :note:mermaid-diagram-2025-06-19-173738.png? | + | {{ :note:screenshot_2025-06-19_at_17.41.18.png |}} |
| - | + | ||
| - | ++++ Mermaid | | + | |
| - | <code lang=mermaid> | + | |
| - | %% TypeScript Type Hierarchy Graph | + | |
| - | graph TD | + | |
| - | Top[Top Types] --> Any(any) | + | |
| - | Top --> Unknown(unknown) | + | |
| - | + | ||
| - | Primitives[Primitive Types] --> String(string) | + | |
| - | Primitives --> Number(number) | + | |
| - | Primitives --> Boolean(boolean) | + | |
| - | Primitives --> Null(null) | + | |
| - | Primitives --> Undefined(undefined) | + | |
| - | Primitives --> Symbol(symbol) | + | |
| - | Primitives --> BigInt(bigint) | + | |
| - | + | ||
| - | Literals[Literal Types] --> StringLiteral("' | + | |
| - | Literals --> NumberLiteral(42) | + | |
| - | Literals --> BooleanLiteral(true) | + | |
| - | + | ||
| - | ObjectTypes[Object Types] --> Object(object) | + | |
| - | ObjectTypes --> Interface(" | + | |
| - | ObjectTypes --> Class(" | + | |
| - | + | ||
| - | Composite[Composite Types] --> Union(" | + | |
| - | Composite --> Intersection(" | + | |
| - | + | ||
| - | Functions[Function Types] --> Function(" | + | |
| - | Functions --> Constructor(" | + | |
| - | + | ||
| - | Arrays[Array/ | + | |
| - | Arrays --> Tuple(" | + | |
| - | + | ||
| - | Special[Special Types] --> Void(void) | + | |
| - | Special --> Never(never) | + | |
| - | Special --> Enum(" | + | |
| - | + | ||
| - | Bottom[Bottom Type] --> Never | + | |
| - | + | ||
| - | %% Relationships | + | |
| - | Any --> Primitives | + | |
| - | Unknown --> Primitives | + | |
| - | Primitives --> Literals | + | |
| - | ObjectTypes --> Composite | + | |
| - | Composite --> Functions | + | |
| - | Functions --> Arrays | + | |
| - | Arrays --> Special | + | |
| - | Special --> Bottom | + | |
| - | </ | + | |
| - | + | ||
| - | ++++ | + | |