Type Alias CommonMethodsOrProperties<A, B>

CommonMethodsOrProperties<A, B>: {
    [P in keyof A & keyof B]: A[P] | B[P]
}

Declares a type that extracts common properties or methods of two classes. Usage: "type CommonType = CommonMethodsOrProperties<ClassA, ClassB>;" To use on multiple classes, nest the definitions: "CommonMethodsOrProperties<ClassA, CommonMethodsOrProperties<ClassB, ClassC>>;"

Type Parameters

  • A extends {}

    extends {}

  • B extends {}

    extends {}