diff --git a/src/lib/subtype.ts b/src/lib/subtype.ts index 2756f93..335fc44 100644 --- a/src/lib/subtype.ts +++ b/src/lib/subtype.ts @@ -5,8 +5,16 @@ import { TestedType } from "./misc"; * otherwise type `false`. */ export type IsSubType = A extends B ? true : false; + /** * Type {@typeparam A} if {@typeparam A} is a subtype of {@typeparam B}; * otherwise type `never`. */ export type SubType = TestedType>; + +/** + * A stricter version of [[`IsSubType`]]. + * Type `true` if {@typeparam A} is a subtype of {@typeparam B}; + * compile-time error otherwise. + */ +export type RequireSubType = IsSubType