jqueyry prop wrong definition

Topics: General
Oct 31, 2012 at 9:18 PM

e.q. $("#something").prop("checked") will return bool
$("#something").prop("selectedIndex") will return number 

probably this should be :any

Oct 31, 2012 at 10:40 PM
At the risk of being one of those people that annoy the p*** out of me... you know what would be cool? Some kind of inline substitution technique, so that you could define properties on classes or interfaces that compiled directly to something else.
Using $.prop as an example:
$.("something").checked
// compiles to
$.("something").prop("checked")
To be effective, it should be possible to define these in definition files, maybe something like
interface JQueryElement {
define checked: bool {
get { return this.prop("checked"); }
set { this.prop("checked", value); }
}
define selectedIndex: number {
get { return this.prop("selectedIndex"); }
set { this.prop("selectedIndex", value); }
}
}
I appreciate that this looks a lot like macros, so I’m likely to get shot down by Anders, but I thought it was worth suggesting.
Cheers,
Mark
Sent from Windows Mail on my Surface RT
From: rekna
Sent: ‎31‎ ‎October‎ ‎2012 ‎13‎:‎18
To: mark@markrendle.net
Subject: jqueyry prop wrong definition [typescript:401477]

From: rekna

e.q. $("#something").prop("checked") will return bool
$("#something").prop("selectedIndex") will return number

probably this should be :any

Read the full discussion online.

To add a post to this discussion, reply to this email (typescript@discussions.codeplex.com)

To start a new discussion for this project, email typescript@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Coordinator
Nov 1, 2012 at 4:34 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.