On this page
typescript/builtins
Prev: typescript | Up: typescript | Next: utility_types
Rel: type_system, Type-Checking & Erasure Pipeline
Ref: TypeScript Handbook — Everyday Types
Tags: #public #web #typescript #builtins #index
Overview
Built-in TypeScript types, type-level operators, and keywords available globally without imports.
Core (#tier/core)
- `unknown` (Top Type) — Type-safe counterpart to
any: accepts any value, but requires narrowing (typeof, type guard) before any property access or call. - `never` (Bottom Type) — Represents values that can never occur (functions that always throw/loop forever, or impossible branches after exhaustive narrowing).
- `void` (Return Type) — Indicates a function's return value is not used.
- `keyof` (Type Operator) — Produces a union of all public property keys (string, number, or symbol) of a type.
- `typeof` (Type Operator) — In type position, extracts the static TypeScript type of a runtime value or function without duplicating type definitions.
- `satisfies` (Operator (TS 4.9+)) — Validates that an expression matches a target type without widening its inferred literal/specific type.
- `as const` (Const Assertion) — Marks an object or array literal deeply
readonlyand narrows values to their exact literal types. - `readonly` (Modifier) — Prevents compile-time reassignment of properties, array elements (
readonly T[]), or tuples (readonly [number, number]).
Standard (#tier/standard)
- `is` (Type Predicate) — User-defined type guard return annotation that narrows a parameter's type in the calling scope when the function returns
true. - `asserts` (Assertion Function) — Narrows the argument's type for the remainder of the calling block if the function returns normally (without throwing).
Specialized (#tier/specialized)
- `infer` (Conditional Type Keyword) — Declares a type variable to be extracted from within the
extendsclause of a conditional type.
Legacy / Avoid (#tier/legacy)
- `any` (Escape-Hatch Type) — Disables type checking completely for
xand silently propagates infectiously to expressions derived from it. Prefer unknown. - `enum` (Non-Erasable Runtime Construct) — Generates runtime JavaScript IIFE objects (not erasable syntax; incompatible with Node
--experimental-strip-types/erasableSyntaxOnly). Prefer as const. - `namespace` (Pre-ESM Module Wrapper) — Legacy TypeScript internal module syntax predating ES Modules (
import/export); emits runtime IIFE code. Prefer ES Modules.
Linked from
- tuts/typescript
- tuts/typescript/builtins/any
- tuts/typescript/builtins/as_const
- tuts/typescript/builtins/asserts
- tuts/typescript/builtins/enum
- tuts/typescript/builtins/infer
- tuts/typescript/builtins/is
- tuts/typescript/builtins/keyof
- tuts/typescript/builtins/namespace
- tuts/typescript/builtins/never
- tuts/typescript/builtins/readonly
- tuts/typescript/builtins/satisfies
- tuts/typescript/builtins/typeof
- tuts/typescript/builtins/unknown
- tuts/typescript/builtins/void
- tuts/typescript/type_system
- tuts/typescript/utility_types
- tuts/typescript/utility_types/function_and_promise
- tuts/typescript/utility_types/object_transforms
- tuts/typescript/utility_types/string_manipulation
- tuts/typescript/utility_types/union_and_nullability
Related notes
- tuts/typescript Linked here; links to this page; shared tags: #index, #typescript, #web
- tuts/typescript/builtins/any Linked here; links to this page; shared tags: #builtins, #typescript, #web
- tuts/typescript/builtins/as_const Linked here; links to this page; shared tags: #builtins, #typescript, #web
- tuts/typescript/builtins/asserts Linked here; links to this page; shared tags: #builtins, #typescript, #web
- tuts/typescript/builtins/enum Linked here; links to this page; shared tags: #builtins, #typescript, #web
- tuts/typescript/builtins/infer Linked here; links to this page; shared tags: #builtins, #typescript, #web
- tuts/typescript/builtins/is Linked here; links to this page; shared tags: #builtins, #typescript, #web
- tuts/typescript/builtins/keyof Linked here; links to this page; shared tags: #builtins, #typescript, #web
- tuts/typescript/builtins/namespace Linked here; links to this page; shared tags: #builtins, #typescript, #web
- tuts/typescript/builtins/never Linked here; links to this page; shared tags: #builtins, #typescript, #web