Add type definetions for TypeScript.

This will fix #8