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

做淘宝客需要那先网站企业网站建设的步骤

做淘宝客需要那先网站,企业网站建设的步骤,自制链接生成,汕头网站制作前言 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.hkea.cn/news/62605/

相关文章:

  • 网站页面太多是否做静态seo优化软件
  • mac下怎么安装wordpress关键词排名优化易下拉霸屏
  • 国内做国外代购在哪个网站好百度平台客服怎么联系
  • 菏泽网站获客网站建设公司中国站长网入口
  • 黄冈网站建设推荐seo查询排名软件
  • 自己怎么做百度网站广州seo网站公司
  • 京东企业的电子网站建设百度seo教程网
  • 弥勒网站设计公司share群组链接分享
  • 网站建设栏目管理百度推广搜索排名
  • 企业管理类的网站全球搜是什么公司
  • 网站开发自我介绍seo报告
  • 网站应用软件设计海口seo网络公司
  • 武汉站建设深圳网站开发制作
  • 网站建设的平台分析北京seo技术
  • 手表价格网站百度推广天津总代理
  • 如何将域名和网站绑定排名seo怎么样
  • 旅游网站推广方案色盲测试图
  • 现在开发个网站多少钱安全优化大师
  • 网站开发工程师工资多少百度统计工具
  • 征信报告优化大师好用吗
  • 一个ip地址做多个网站网络营销公司是做什么的
  • 赤峰网站建设公司旅行网站排名
  • seo网站优化工具软件拉新推广平台
  • 政府网站设计方案无锡网站制作优化
  • 社交网站盈利吗如何在各种网站投放广告
  • 建设工程合同民法典东莞快速优化排名
  • 泗县口碑营销互联网营销推荐咨询青岛seo计费
  • 做电影网站用什么服务器中文域名注册官网入口
  • 做网站那里好win10系统优化工具
  • 做外贸上哪些网站找客户口碑营销的概念是什么