In TypeScript, an opaque type is a subtype of a basic type (like string or number) that is used to prevent errors by making different types of data incomparable at compile time, even though they might be the same underlying type.