Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

support callable objects #14

Open
nadako opened this issue Mar 10, 2015 · 1 comment
Open

support callable objects #14

nadako opened this issue Mar 10, 2015 · 1 comment

Comments

@nadako
Copy link
Collaborator

nadako commented Mar 10, 2015

TypeScript supports callable objects with multiple signatures. We could support this with the new @:selfCall metadata. So, we define a new method by some convention (how do we avoid potential name clashes?) adding all signatures as @:overload and append @:selfCall to it.

Also there are cases like this one: https://github.com/borisyankov/DefinitelyTyped/blob/1d08e36fe3ce81715cb956223f7e5a0a9882cd63/node/node.d.ts#L1341, maybe we should translate that var into an overloaded function.

@back2dos
Copy link

The authors of node's assert module went the extra mile for throws to be usable as a first class value. Meaning that you can get require('assert').throws and pass that around. They did by hand what $bind does for us automagically for methods and the .d.ts reflects that. I would just honor it.

kLabz pushed a commit to kLabz/ts2hx that referenced this issue May 25, 2018
…rom_class

Remove class parenting from interface
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants