1

For example:

declare function foo(x : string, y : boolean) : string;

module Bar {
    export function foo(x : string) { return ???.foo(x, true); }
}

How can I access the global foo from anywhere inside Bar (where a raw foo reference will implicitly reference Bar.foo)?

1 Answer 1

3

There isn't a good way to do this.

Technically you could write window['foo'], but this will break in runtimes where the global object is not called window.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.