Quick Peek
Composing Types
type MyBool = true | false
type WindowStates = "open" | "closed" | "minimized";泛型 Generics
type StringArray = Array<string>;interface Backpack<Type> {
add: (obj: Type) => void;
get: () => Type;
}
// This line is a shortcut to tell TypeScript there is a
// constant called `backpack`, and to not worry about where it came from.
declare const backpack: Backpack<string>;
// object is a string, because we declared it above as the variable part of Backpack.
const object = backpack.get();Typescript 编译器
install
Emitting with errors
Downleveling
Strictness flags
noImplicityAny
strictNullChecks
Last updated