TypeScript Glossary
Plain-language definitions for the TypeScript terms you'll hit during a JavaScript-to-TypeScript migration. Quick reference — if you need a deep dive, links to the official TypeScript handbook are at the bottom of each section.
tsconfig.json
The configuration file for the TypeScript compiler. It picks the target ECMAScript version, module system, JSX mode, strictness flags, and which files to include or exclude. Generate one with tsc --init, or use our tsconfig generator.
tsc & ts-node
tsc is the TypeScript compiler — it produces .js files from your .ts sources. ts-node is a Node.js loader that compiles TypeScript on the fly so you can run .ts files directly during development.
strict mode
"strict": true in tsconfig enables a bundle of checks: strictNullChecks, noImplicitAny, strictFunctionTypes, strictBindCallApply, and others. Turning it on after a JS-to-TS migration surfaces real bugs but requires more annotations — enable it gradually.
type vs interface
Both declare named types. interface supports declaration merging and is conventional for object shapes you expect to extend. type aliases can describe unions, primitives, tuples, and computed types that interface cannot. For most object shapes the two are interchangeable.
utility types
Built-in generic helpers that transform existing types into related ones: Partial<T>, Required<T>, Pick<T, K>, Omit<T, K>, Record<K, V>, ReturnType<F>, Awaited<P>, and more. They let you derive types instead of rewriting them.
generics
Type parameters — placeholders that get filled in when a function or type is used. function id<T>(x: T): T preserves the caller's type. Generics let you write reusable code that doesn't fall back to any.
declaration files (.d.ts)
Files that contain only type declarations — no runtime code. They describe the shape of JavaScript libraries so TypeScript can type-check call sites. The community publishes them under @types/* on npm via the DefinitelyTyped project.
any & unknown
any opts a value out of type checking entirely — the escape hatch for code TypeScript can't reason about. unknown is the type-safe counterpart: you can assign anything to it but must narrow before use. Prefer unknown.
never
The type of values that never occur — the return type of a function that always throws, or the result of exhaustive narrowing. Useful in switch statements to enforce compile-time exhaustiveness.
narrowing
How TypeScript refines a value's type along a control-flow path. typeof, instanceof, equality checks, the in operator, and user-defined predicates (x is T) all narrow inside the matching branch.
unions & intersections
A | B is a union — either A or B. A & B is an intersection — both A and B at once. Unions are narrowed before use; intersections are common for composing mixins.
tuples
Fixed-length arrays with a specific type at each index, e.g. [string, number]. Useful for return values that bundle multiple things, like React's useState.
enums
A named set of constants. Numeric enums (default) auto-increment; string enums are inline string literals. Many teams prefer const object literals because enums emit runtime JavaScript — our TS-to-JS stripper can compile enums to Object.freeze objects for you.
decorators
Functions that modify classes, methods, or properties at definition time. TypeScript supports stage-3 ECMAScript decorators (and the older experimental syntax via experimentalDecorators).
structural typing
TypeScript checks compatibility by shape, not by name. Two types with the same members are interchangeable regardless of where they're declared. The opposite of the nominal typing used by Java or C#.
module resolution
The strategy TypeScript uses to find a module from an import specifier. Common values: NodeNext (modern Node ESM/CJS), Node (classic Node), Bundler (Vite/webpack), Classic (legacy).
JSX / TSX
JSX is the React XML-like syntax embedded in .tsx files. Set "jsx" in tsconfig to "react-jsx" (no per-file React import needed) or "preserve" (let the bundler handle it). Convert React JS to TypeScript with our JSX-to-TSX converter.
ambient declarations
Type declarations introduced with declare that emit no runtime code. Used to describe globals, modules, and value shapes that exist outside TypeScript's compilation — the .d.ts files shipped by libraries are made of these.
as const
A const assertion narrows literal values to their narrowest possible type and marks object/array literals as readonly. [1, 2, 3] as const has type readonly [1, 2, 3], useful for tuples and precise literal unions.
discriminated unions
A union of object types that share a literal property — the discriminant. Switching on the discriminant narrows the type in each branch. The standard pattern for modelling state machines and message shapes.
conditional types
Type-level if-expressions: T extends U ? X : Y. Combined with infer they derive new types from existing ones — utility types like ReturnType and Awaited are built on conditional types.
satisfies
Asserts that a value matches a target type while keeping the value's narrowest inferred type. Useful when you want both literal-precise types and shape validation.
non-null assertion (!)
The postfix ! operator tells TypeScript a value isn't null or undefined, e.g. value!.length. It silences the check rather than proving safety — narrow when you can.
strict flags
strictNullChecks—nullandundefinedare distinct types and don't assign implicitly.noImplicitAny— parameters and variables must be typed or annotated.strictFunctionTypes— stricter checking of function parameter compatibility (contravariance).strictBindCallApply—bind,call, andapplyrequire correct argument types.strictPropertyInitialization— class fields must be initialized in the constructor or marked!.alwaysStrict— emit"use strict"at the top of every file.
Ready to apply this to real code?
Try the online converter or grab the desktop app to migrate a whole project at once.