Typescript All In One
TypeScript 3.5 is now available.
https://www.typescriptlang.org/#download-links
# INSTALL
$ npm i -g typescript
# COMPILE
$ tsc helloworld.ts
TypeScript & Interface & Type alias
https://github.com/xgqfrms/ts/issues/6
TypeScript Types
https://www.typescriptlang.org/docs/handbook/basic-types.html
https://www.typescriptlang.org/docs/handbook/advanced-types.html
Boolean
Number
String
Array
Tuple
Enum
Any
Void
Null and Undefined
Never
Object
// Type assertions
// A note about ‘let’
Intersection Types
Union Types
Type Guards and Differentiating Types
User-Defined Type Guards
Using type predicates
Using the in operator
typeof type guards
instanceof type guards
Nullable types
Optional parameters and properties
Type guards and type assertions
Type Aliases
Interfaces vs. Type Aliases
String Literal Types
Numeric Literal Types
Enum Member Types
Discriminated Unions
Exhaustiveness checking
Polymorphic this types
Index types
Index types and index signatures
Mapped types
Inference from mapped types
Conditional Types
Distributive conditional types
Type inference in conditional types
Predefined conditional types
https://www.typescriptlang.org/docs/handbook/utility-types.html
Partial<T>
Readonly<T>
Record<K,T>
Pick<T,K>
Omit<T,K>
Exclude<T,U>
Extract<T,U>
NonNullable<T>
Parameters<T>
ConstructorParameters<T>
ReturnType<T>
InstanceType<T>
Required<T>
ThisParameterType
OmitThisParameter
ThisType<T>
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!