12 lines
No EOL
261 B
TypeScript
12 lines
No EOL
261 B
TypeScript
interface IComparable<T> {
|
|
compareTo(other: T);
|
|
}
|
|
|
|
declare function sort<U extends IComparable<any>>(items: U[]): U[];
|
|
|
|
interface StringComparable extends IComparable<string> {
|
|
}
|
|
|
|
var sc: StringComparable[];
|
|
|
|
var x = sort(sc); |