-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow quoted names in ambient contexts #9846
Labels
Suggestion
An idea for TypeScript
Too Complex
An issue which adding support for may be too complex for the value it adds
Comments
RyanCavanaugh
added
Suggestion
An idea for TypeScript
In Discussion
Not yet reached consensus
labels
Jul 20, 2016
This actually prevents some objects from being correctly represented. Consider if you had some object class d extends foo.var { }
let d = new foo.var();
let e = foo.default; |
RyanCavanaugh
added
Too Complex
An issue which adding support for may be too complex for the value it adds
and removed
In Discussion
Not yet reached consensus
labels
Aug 22, 2016
9 tasks
Note that declare function yargs(): void;
declare namespace yargs {
function _default(): void;
export { _default as _default };
}
export = yargs; |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Suggestion
An idea for TypeScript
Too Complex
An issue which adding support for may be too complex for the value it adds
The node module
yargs
is callable (typeof require('yargs') === 'function'
). It also has a property nameddefault
that is a function.This makes writing a definition file very difficult. You'd be inclined to write
There's not an obvious workaround that doesn't have bad side effects (e.g. rewriting the whole mess as a
var
doesn't really work in the case where there's a nested class), possibly requiring a massive restructuring of the entire file.Wherever an identifier appears in an ambient context where it could have been initialized as a property, it should be allowed to be quoted. For example
The text was updated successfully, but these errors were encountered: