1
declare function foo(x : string, y : boolean) : string;
module Bar {
export function foo(x : string) { return ???.foo(x, true); }
}
我怎样才能从任何地方内Bar
(其中原始foo
引用将隐含引用Bar.foo
)访问全球foo
?
declare function foo(x : string, y : boolean) : string;
module Bar {
export function foo(x : string) { return ???.foo(x, true); }
}
我怎样才能从任何地方内Bar
(其中原始foo
引用将隐含引用Bar.foo
)访问全球foo
?
没有一个好方法来做到这一点。
从技术上讲,您可以编写window['foo']
,但是在全局对象未调用window
的运行时中,这会中断。