工具泛型
typeof
interface Person {
name: string;
age: number;
}
const user: Person = { name: "张三", age: 30 };
type User = typeof user; // type User = Person
const hoel: User = { name: "hoel", age: 5 };in
type Keys = "a" | "b" | "c";
type Obj = {
[p in Keys]: any;
}; // -> { a: any, b: any, c: any }keyof
extends
infer
ReturnType
Required
Pick
Omit
Exclude
Extract
Record
Partial
NonNullable
Parameters
ConstructorParameters
readonly
最后更新于