{"action":"created","issue":{"url":"https://api.github.com/repos/gcanti/tcomb/issues/160","labels_url":"https://api.github.com/repos/gcanti/tcomb/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/gcanti/tcomb/issues/160/comments","events_url":"https://api.github.com/repos/gcanti/tcomb/issues/160/events","html_url":"https://github.com/gcanti/tcomb/issues/160","id":120644276,"number":160,"title":"add TypeScript definition file","user":{"login":"gcanti","id":878912,"avatar_url":"https://avatars.githubusercontent.com/u/878912?v=3","gravatar_id":"","url":"https://api.github.com/users/gcanti","html_url":"https://github.com/gcanti","followers_url":"https://api.github.com/users/gcanti/followers","following_url":"https://api.github.com/users/gcanti/following{/other_user}","gists_url":"https://api.github.com/users/gcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/gcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcanti/subscriptions","organizations_url":"https://api.github.com/users/gcanti/orgs","repos_url":"https://api.github.com/users/gcanti/repos","events_url":"https://api.github.com/users/gcanti/events{/privacy}","received_events_url":"https://api.github.com/users/gcanti/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gcanti/tcomb/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-06T16:36:50Z","updated_at":"2015-12-30T17:25:36Z","closed_at":null,"body":""},"comment":{"url":"https://api.github.com/repos/gcanti/tcomb/issues/comments/168039248","html_url":"https://github.com/gcanti/tcomb/issues/160#issuecomment-168039248","issue_url":"https://api.github.com/repos/gcanti/tcomb/issues/160","id":168039248,"user":{"login":"gcanti","id":878912,"avatar_url":"https://avatars.githubusercontent.com/u/878912?v=3","gravatar_id":"","url":"https://api.github.com/users/gcanti","html_url":"https://github.com/gcanti","followers_url":"https://api.github.com/users/gcanti/followers","following_url":"https://api.github.com/users/gcanti/following{/other_user}","gists_url":"https://api.github.com/users/gcanti/gists{/gist_id}","starred_url":"https://api.github.com/users/gcanti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gcanti/subscriptions","organizations_url":"https://api.github.com/users/gcanti/orgs","repos_url":"https://api.github.com/users/gcanti/repos","events_url":"https://api.github.com/users/gcanti/events{/privacy}","received_events_url":"https://api.github.com/users/gcanti/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T17:25:35Z","updated_at":"2015-12-30T17:25:35Z","body":"Hi,\r\n\r\nYes it's good starting point, however there are several changes in v2. \r\nThis is my first (and incomplete) attempt https://github.com/gcanti/tcomb/blob/typescript/tcomb.d.ts.\r\nI'm using Microsoft Visual Studio Code in order to check the results in terms of IDE hints.\r\n\r\nThe main problem I'm facing is how to convince tsc that the combinators return a type:\r\n\r\n```js\r\nconst Url = t.irreducible<string>('Url', () => true);\r\n\r\nfunction f(url: Url) {} // error: Cannot find name 'Url'\r\n```\r\n\r\nI found a workaround giving a fake `t` member to `Type<T>` and then using a type query:\r\n\r\n```js\r\nconst Url = t.irreducible<string>('Url', () => true);\r\n\r\nfunction f(url: typeof Url.t) {} // ok\r\n```\r\n\r\nnot sure if is the most elegant and handy solution though\r\n\r\n/cc @hansrwindhoff @DanielRosenwasser @jedmao"}}