mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
32 lines
529 B
TypeScript
32 lines
529 B
TypeScript
//// [tests/cases/compiler/anonterface.ts] ////
|
|
|
|
//// [anonterface.ts]
|
|
namespace M {
|
|
export class C {
|
|
m(fn:{ (n:number):string; },n2:number):string {
|
|
return fn(n2);
|
|
}
|
|
}
|
|
}
|
|
|
|
var c=new M.C();
|
|
c.m(function(n) { return "hello: "+n; },18);
|
|
|
|
|
|
|
|
|
|
|
|
//// [anonterface.js]
|
|
"use strict";
|
|
var M;
|
|
(function (M) {
|
|
class C {
|
|
m(fn, n2) {
|
|
return fn(n2);
|
|
}
|
|
}
|
|
M.C = C;
|
|
})(M || (M = {}));
|
|
var c = new M.C();
|
|
c.m(function (n) { return "hello: " + n; }, 18);
|