<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Typescript on 蛇索尼 Aiden</title><link>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/</link><description>Recent content in Typescript on 蛇索尼 Aiden</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>shesl-meow@qq.com (佘崧林)</managingEditor><webMaster>shesl-meow@qq.com (佘崧林)</webMaster><lastBuildDate>Mon, 26 Apr 2021 11:02:26 +0800</lastBuildDate><atom:link href="https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/index.xml" rel="self" type="application/rss+xml"/><item><title>TypeScipt 杂技大全</title><link>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/typescript%E6%9D%82%E6%8A%80%E5%A4%A7%E5%85%A8/</link><pubDate>Mon, 26 Apr 2021 11:02:26 +0800</pubDate><author>shesl-meow@qq.com (佘崧林)</author><guid>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/typescript%E6%9D%82%E6%8A%80%E5%A4%A7%E5%85%A8/</guid><description>语法糖 定义 getter setter，在类方法前使用关键字 get/set； https://www.typescriptlang.org/docs/handbook/classes.html#accessors 使用 @ 符号，引用 Decorator： https://www.typescriptlang.org/docs/handbook/decorators.html#property-decorators 使用模版字符串： https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals StackOverflow 来自 StackOverflow 上的大神教程</description></item><item><title>控制流</title><link>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/2.%E6%8E%A7%E5%88%B6%E6%B5%81/</link><pubDate>Thu, 03 Dec 2020 22:19:41 +0800</pubDate><author>shesl-meow@qq.com (佘崧林)</author><guid>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/2.%E6%8E%A7%E5%88%B6%E6%B5%81/</guid><description>条件判断 循环 函数 参数类型 函数可以指定返回值类型与参数类型，比如： 1 2 3 function add(x: number, y: number): string { // ... } 上面定义的是两个 number 类型为参数，一个 string 类型为返回值的</description></item><item><title>面向对象</title><link>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/4.%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1/</link><pubDate>Thu, 03 Dec 2020 22:19:41 +0800</pubDate><author>shesl-meow@qq.com (佘崧林)</author><guid>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/4.%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1/</guid><description>接口 TypeScript 接口定义如下： 1 2 3 4 interface RunOptions { program:string; commandline:string[]|string|(()=&amp;gt;string); } 在 Interface 中定义方法： 1 2 3 4 interface IEmployee { getSalary: (number) =&amp;gt; number; // arrow function getManagerName(number): string; } Interface 可以定义方法类型。 继承使用关键字 extends，</description></item><item><title>模块</title><link>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/5.%E6%A8%A1%E5%9D%97/</link><pubDate>Thu, 03 Dec 2020 22:19:41 +0800</pubDate><author>shesl-meow@qq.com (佘崧林)</author><guid>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/5.%E6%A8%A1%E5%9D%97/</guid><description>导出模块 模块导出使用关键字 export 关键字，语法格式如下： 1 2 3 4 // SomeInterface.ts export interface SomeInterface { // 代码部分 } 要在另外一个文件使用该模块就需要使用 import 关键字来导入: 1 import someInterfaceRef</description></item><item><title>内置类型</title><link>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/3.%E5%86%85%E7%BD%AE%E7%B1%BB%E5%9E%8B/</link><pubDate>Thu, 03 Dec 2020 22:19:41 +0800</pubDate><author>shesl-meow@qq.com (佘崧林)</author><guid>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/3.%E5%86%85%E7%BD%AE%E7%B1%BB%E5%9E%8B/</guid><description>Number 概述 TypeScript 与 JavaScript 类似，支持 Number 对象。Number 对象是原始数值的包装对象。 对象属性 Number 对象支持的属性： MAX_VALUE、MIN_VALUE、NaN</description></item><item><title>内置类型</title><link>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/1.%E5%9F%BA%E6%9C%AC%E8%AF%AD%E6%B3%95/</link><pubDate>Tue, 10 Sep 2019 16:15:13 +0800</pubDate><author>shesl-meow@qq.com (佘崧林)</author><guid>https://blog.haitai-social.com/note/%E5%B7%A5%E5%85%B7%E4%BD%BF%E7%94%A8%E6%8E%A5%E5%8F%A3/typescript/1.%E5%9F%BA%E6%9C%AC%E8%AF%AD%E6%B3%95/</guid><description>类型是 TypeScript 相较于 JavaScript 增加的特性，也是 TpyeScript 的重点内容。 变量声明 声明变量的类型及初始值： 1 var [变量名] : [类型] = 值; **注意：**变量不要使用 name 否则</description></item></channel></rss>