type O = { a: string; b: number };
type A = Pick<O, "a">; // { a: string }
type B = Omit<O, "a">; // { b:number }
type O = { a: string; b: number };
type A = Exclude<string | number, string>; // number
type B = Extract<string | number, string>; // string
Partial<T> // 可选
Required<T> // 必填
Readonly<T> // 只读
type A = Record<string | number, any>;
// 参数1:string | number | symbol 组成的单个或联合类型,参数2 :任意类型
// keyof any = string | number | symbol
// A = {
// [x: string]: any;
// [x: number]: any;
// [x: symbol]: any;
// }
https://mp.weixin.qq.com/s?__biz=MjM5MDA2MTI1MA==&mid=2649133378&idx=1&sn=64c59bb788fa4ba7e1b1a87f495b1a50&chksm=be58b6ef892f3ff9b354c510ef2228a4409010fd4aea1a4fab0e9d524a5829627bfc38cadaf2&scene=27
网友评论