Add TypeScript declarations for API.