/**
 * 获取除了第二个参数的key外所有的属性
 * type demo = {
 *  a:string;
 *  b:string;
 *  c:string;
 * }
 * type demo2 = ExcludePick<demo,"a">;
 * demo2的值就是
 * type demo = {
 *  b:string;
 *  c:string;
 * }
 */
export type ExcludePick<U, K extends keyof U> = {
  [P in Exclude<keyof U, K>]: U[P];
};

// 返回参数为必选,其他为非必选
export type ExpectMustKey<P, K extends keyof P> = { [M in K]: P[M] } & {
  [Un in Exclude<keyof P, K>]?: P[Un];
};

// 返回参数非必选,其他为必选
export type ExpectUnMustKey<P, K extends keyof P> = { [Un in K]?: P[Un] } & {
  [M in Exclude<keyof P, K>]: P[M];
};
