Type alias NonTypePropertyNames<T, KT>

NonTypePropertyNames<T, KT>: { [ K in keyof T]: T[K] extends KT ? never : K }[keyof T]

获取T类型中除值为KT类型以外的所有键

class A
{
a = 1;
f(){}
}

var a: NonTypePropertyNames<A, number>; //var a:"f"
var a1: NonTypePropertyNames<A, Function>; //var a:"a"

Type Parameters

  • T

  • KT

Generated using TypeDoc