Update TypeScript definitions

Made the "index" parameter optional to reflect the JS version.
Merge pull request #787 from luispedrofonseca/master

Updated TypeScript definitions