The official TypeScript website has a guide to teach you how to write a high-quality TypeScript Declaration File. The official TypeScript wiki on codeplex.com also has a great article on how to write a good type declaration file. It is recommended you read those as it covers some important choices.