当前位置: 首页 > news >正文

做的好微信商城网站吗百度app客服人工电话

做的好微信商城网站吗,百度app客服人工电话,网站公司郑州,做亚马逊网站一般发什么快递公司前言 TypeScript 越来越火&#xff0c;现在很多前端团队都使用它&#xff0c;因此咱们前端码农要想胜任以后的前端工作&#xff0c;就要更加熟悉它。 入门练手题 interface A {x: number;y: number; }type T Partial<A>;const a: T { x: 0, y: 0 }; const b: T { …

前言

TypeScript 越来越火,现在很多前端团队都使用它,因此咱们前端码农要想胜任以后的前端工作,就要更加熟悉它。
在这里插入图片描述

入门练手题

interface A {x: number;y: number;
}type T = Partial<A>;const a: T = { x: 0, y: 0 };
const b: T = { x: 0 };
const c: T = { y: 0 };
const d: T = {};type MyPartial<T> = {[P in keyof T]?: T[P];
};interface B {x?: number;y: number;
}type T0 = Required<B>;const a0: T0 = { x: 0, y: 0 };type MyRequired<T> = {[P in keyof T]-?: T[P];
};interface C {x?: number;y: number;
}type T1 = Readonly<C>;const a1: T1 = { x: 0, y: 0 };// a1.x=1type MyReadonly<T> = {readonly [P in keyof T]: T[P];
};interface Cat {age: number;gender: string;
}type CatName = "seraph" | "ashe" | "ahri";const cats: Record<CatName, Cat> = {seraph: { age: 10, gender: "male" },ashe: { age: 5, gender: "female" },ahri: { age: 16, gender: "female" },
};/* 在 TypeScript 中,当你看到 K extends keyof any 这样的表达时,
它的作用是约束类型 K 为一个有效的类型,可以作为对象的键。
这里的 keyof any 是指所有可能的 JavaScript 值的键的联合类型。
简单来说,keyof any 通常等价于 string | number | symbol ,
因为在 JavaScript 中,对象的键可以是这三种类型。
你可以使用 string,number 或者 symbol 作为对象属性的键。 */type MyRecord<K extends keyof any, T> = {[P in K]: T;
};interface Todo {title: string;description: string;done: boolean;
}type TodoPreview = Pick<Todo, "title" | "done">;const todo: TodoPreview = {title: "play games",done: false,
};type MyPick<T, K extends keyof T> = {[P in K]: T[P];
};type E0 = Exclude<"a" | "b", "a">;type E1 = Exclude<string | number | (() => void), Function>;type MyExclude<T, U> = T extends U ? never : T;interface Todos {title: string;desc: string;done: boolean;no: number;
}type TodoPre = Omit<Todos, "desc">;const todopre: TodoPre = {title: "play",done: false,no: 2,
};type TodoInfo = Omit<Todos, "desc" | "no">;const todoInfo: TodoInfo = {title: "play",done: false,
};type MyOmit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;type E = Extract<"a" | "b", "a" | "f">;type E3 = Extract<string | number | (() => void), Function>;type MyExtrat<T, U> = T extends U ? T : never;declare function f(args: { a: number; b: string }): void;type P0 = Parameters<() => string>; // []type P1 = Parameters<(s: string) => void>; // [s: string]type P2 = Parameters<<T>(arg: T) => T>; // [arg: unknown]type P3 = Parameters<typeof f>;type MyParameters<T extends (...args: any) => any> = T extends (...args: infer P
) => any? P: never;type R = ReturnType<() => void>;const add = (x: number, y: number): number => {return x + y;
};type R1 = MyReturnType<typeof add>;type MyReturnType<T extends (...args: any) => any> = T extends (...args: any
) => infer R? R: any;
http://www.jinmujx.cn/news/110498.html

相关文章:

  • 设计需求网站网站seo诊断分析
  • 站酷网素材软文营销广告
  • 免费发布信息网站有哪些上海短视频培训机构
  • 朋友圈网站文章怎么做个人开发app最简单方法
  • 苏州专业做网站公司软件外包公司排行榜
  • 做门户网站 公司营业范围是啥脚本外链生成工具
  • 衡水公司做网站查权重工具
  • dremrever做网站流程无锡百度
  • 手机网站 等比缩放台州百度快照优化公司
  • wordpress 自动链接郑州seo外包收费标准
  • 普通网站能不能用vue做几个小功能seo的重要性
  • 香港主机做擦边球网站快速的网站设计制作
  • 做网站需注意什么潍坊seo按天收费
  • 自己做网站卖货多少钱seo课程培训班费用
  • ppt免费网站推广方案如何写
  • 学做前端的网站云搜索
  • 深度科技商业官方网站关系网站优化公司
  • 二维码制作app福州短视频seo机会
  • 哪些网站做免费送东西的广告6泰安seo
  • 安徽省六安市建设局网站免费网站注册平台
  • 网站推广到底应该怎么做成功的网络营销案例及分析
  • 辽阳哪里做网站2022最新引流推广平台
  • php 建设网站制作地推团队如何收费
  • 欧亚达网站是哪家公司做的竞价账户托管的公司有哪些
  • 网站的开发方式seo优化培训
  • 烟台网站建设推广seo网站优化培训怎么样
  • win主机 wordpress静态武汉企业seo推广
  • 装酷网浙江网站seo
  • wordpress隐藏前台注册seo网站推广优化论文
  • 做设计的地图网站手机端关键词排名免费软件