type Equal<A, B> = (<T>() => T extends A ? 1 : 0) extends <T>() => T extends B
? 1
: 0
? true
: false
class Point {
x: number
y: number
constructor(x: number, y: number) {
this.x = x
this.y = y
}
}
interface PointConstructor {
new (x: number, y: number): Point
}
type bo = Equal<typeof Point, PointConstructor> // type bo = false
type bo1 = typeof Point extends PointConstructor ? true : false // type bo1 = true
type bo1 = PointConstructor extends typeof Point ? true : false // type bo2 = true
Why are the Point constructor types and PointConstructor interfaces different In the Equal type tool?