JQuery.d.ts - why are callbacks defined as 'any' and not functions types?

Topics: General
Oct 3, 2012 at 2:46 AM

I noticed that the jquery.d.ts file in one of the samples defines a lot of the function calbacks as 'any'.  Is there any reason for this - or is this file just a work in progress?

Oct 4, 2012 at 1:09 AM

This is a work in progress (just one of the reasons it's in 'samples').  You should be able to easily copy and modify the file if you need more specific typing for your uses.  'any' should work in all situations, just not give you much type assistance.  If you believe we have any actual errors in the typing which make it unusable, please log them in the 'issue tracker' section.  Thanks!

Oct 4, 2012 at 7:06 AM

@billti: could you elaborate on the process your team is using to generate these declarations for 3rd party libraries? Is it a process of modeling them by hand in cases where the metadata isn't already available in a computable format, eg jsdoc?