Generic type aliases
With TypeScript 1.6, type aliases can be generic. For example:
type Lazy<T> = T | (() => T);
var s: Lazy<string>;
s = "eager";
s = () => "lazy";
interface Tuple<A, B> {
a: A;
b: B;
}
type Pair<T> = Tuple<T, T>;
本文档使用 BookStack 构建