How to exclude an overload in TypeScript?
19:25 30 Dec 2025

How can I achieve the reverse of joining two function signatures together in TypeScript?


type A = (v1: number, v2: number) => number
type B = (v1: string, v2: string) => string

type C = A & B;

declare const c: C;

c(1, 2);
c("a", "b");
c(1, "b"); // <- gives error as expected

type D = Exclude // never

related: Reuse function overloading in typescript

typescript