25 lines
392 B
TypeScript
25 lines
392 B
TypeScript
//// [declFileForTypeParameters.ts]
|
|
|
|
class C<T> {
|
|
x: T;
|
|
foo(a: T): T {
|
|
return this.x;
|
|
}
|
|
}
|
|
|
|
//// [declFileForTypeParameters.js]
|
|
var C = (function () {
|
|
function C() {
|
|
}
|
|
C.prototype.foo = function (a) {
|
|
return this.x;
|
|
};
|
|
return C;
|
|
})();
|
|
|
|
|
|
//// [declFileForTypeParameters.d.ts]
|
|
declare class C<T> {
|
|
x: T;
|
|
foo(a: T): T;
|
|
}
|