Type alias
A type alias is a declaration that gives an existing type an alternative name without creating a distinct type or representation.
Essential TypeScript 5, Third Edition
A type alias is a named TypeScript type definition that can represent an existing type or a composed type.
- How it is used
- Names reusable type definitions to reduce duplication in function signatures, object shapes, and application data schemas.
- How deep it goes
- Defines the syntax and works through several applications, while noting that an alias does not change compiler treatment.
- Examples
- Uses item counts, product arrays, city strings, a Lowdb task schema, and objects created by a constructor function.
- What you can do after
- Apply it via TypeScript annotations and assertions to reuse type definitions and check shaped application data.
Read how Essential TypeScript 5, Third Edition explains type alias →
Go in Action, Second Edition
A type alias gives an existing type an alternate name without creating a distinct type.
- How it is used
- Gives an existing type a context-specific name while keeping its values interchangeable with the original type.
- How deep it goes
- Defines `type A = B` and contrasts compiler behavior and methods with defined types; does not develop a larger alias implementation.
- Examples
- Uses byte and rune as built-in aliases, then contrasts an illustrative measurement alias with a distinct Magnitude type.
- What you can do after
- Evaluate/understand when an alternate name suffices and when a distinct type provides compiler-enforced separation or methods.
Learn Haskell by Example
A type synonym gives an existing type an alternate name without creating a distinct representation or type identity.
- How it is used
- Clarifies the intended role of ordinary representations such as character lists, filenames, and strings.
- How deep it goes
- Defines aliases, demonstrates interchangeability, and stops short of creating a distinct type identity.
- Examples
- Uses Alphabet for cipher alphabets, FilePath for command-line filenames, and GHCi commands for inspection.
- What you can do after
- Apply type synonyms in Haskell code and inspect their resulting values and signatures through GHCi.
Kotlin in Action, 2E
A type alias is a Kotlin declaration that gives an alternative name to an existing type without creating a distinct type.
- How it is used
- Improves readability by naming long generic or functional types without changing how those types behave.
- How deep it goes
- Explains declaration syntax, usage, tradeoffs, and compile-time expansion, but stops short of adding type safety.
- Examples
- Uses the NameCombiner functional alias and contrasts a ValidatedInput alias with a value class.
- What you can do after
- Apply it by naming repeated complex types while recognizing when a distinct value class is required for stronger type separation.
Learn C++ by Example
A type alias is a declaration that gives an existing type an alternative name.
- How it is used
- Defines a readable name for a custom std::chrono duration used in practical time conversions.
- How deep it goes
- Defines the using form through a century-duration example and defers broader details about using to later coverage.
- Examples
- Uses a centuries alias to represent two hundred years and convert that duration into seconds, hours, and days.
- What you can do after
- Build it from scratch by naming a parameterized chrono duration with using and applying the alias in conversions.
Modern C
A type alias is an alternative name for an existing C type that does not create a distinct type.
- How it is used
- Introduces readable names for existing C types, especially structures and arrays.
- How deep it goes
- Explains alias identity, structure forward declarations, array syntax, and _t reservation rules.
- Examples
- Uses multidimensional double arrays, staged array aliases, structure declarations, and size_t as examples.
- What you can do after
- Apply it via typedef to name existing structures, arrays, and other C types without changing their identities.
Related concepts
- typedefproduced by · typedef is a C and C++ declaration mechanism that introduces an alternative name for an existing type.
- newtype idiomcontrasts with · The newtype idiom defines a distinct type by wrapping an existing type, typically preserving its representation while enabling type-specific distinctions or behavior.
- atomic typeequivalent to · An atomic type is a type whose supported accesses and operations are indivisible with respect to concurrent execution and provide defined synchronization semantics.
- jmp_bufincludes · jmp_buf is an opaque C library-defined type representing a saved execution environment for setjmp and longjmp.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





